Skip to content

Commit

Permalink
Remove references to chaco.shell from the documentation (#669)
Browse files Browse the repository at this point in the history
* update user_manual/chaco_tutorial.rst and remove chaco.shell

* remove mention of shell from user guide intro

* remove Ipython tutorial entirely

* Update docs/source/user_manual/chaco_tutorial.rst

Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com>

* readd script oriented approach only using matplotlib

* typo

Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com>
  • Loading branch information
aaronayres35 and Poruri Sai Rahul authored Apr 19, 2021
1 parent d704ad6 commit 4e7831c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 286 deletions.
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ give a good overview of the capabilities of Chaco:

* :ref:`Sample Plot Gallery <examples>`
* :ref:`Tutorial: Interactive plotting with Chaco <tutorial>`
* :ref:`Tutorial: Using Chaco from IPython <tutorial_ipython>`
* Examples:

- :ref:`Modeling Van del Waal's Equations <tutorial_van_der_waal>`
Expand Down
38 changes: 17 additions & 21 deletions docs/source/user_manual/chaco_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ be used primarily by scientific programmers, and this tutorial requires only
basic familiarity with Python.

Knowledge of NumPy can be helpful for certain parts of the tutorial. Knowledge
of GUI programming concepts such as widgets, windows, and events are helpful
for the last portion of the tutorial, but it is not required.
of GUI programming concepts such as widgets, windows, and events is helpful,
but it is not required.

This tutorial demonstrates using Chaco with Traits(UI), so knowledge of the
`Traits User Manual <http://docs.enthought.com/traits/>`_ framework is also
Expand Down Expand Up @@ -100,7 +100,6 @@ drop-down menus (not show here), the user can change plot attributes like the
colormap and the number of contour levels used in the center plot, as well as
the actual function being plotted.


Script-oriented plotting
========================

Expand All @@ -110,19 +109,19 @@ of how the library is written, as well as the code you write to use the
library.

Here is a simple example of the "script-oriented" approach for creating
a static plot. This is probably familiar to anyone who has used Gnuplot,
MATLAB, or Matplotlib::
a static plot for which we use Matplotlib. This approach will also probably
look familiar to anyone who has used Gnuplot or MATLAB::

from numpy import linspace, pi, sin
from chaco.shell import *
import matplotlib.pyplot as plt

x = linspace(-2*pi, 2*pi, 100)
y = sin(x)

plot(x, y, "r-")
title("First plot")
ytitle("sin(x)")
show()
plt.plot(x, y, "r-")
plt.title("First plot")
plt.ylabel("sin(x)")
plt.show()

This creates this plot:

Expand All @@ -135,22 +134,19 @@ functions to plot the data and configure the plot. There is a global concept of
generated plot is then usually saved to disk for inclusion in a journal article
or presentation slides.

Now, as it so happens, this particular example uses the `chaco.shell`
script plotting package, so when you run this script, the plot that Chaco opens
does have some basic interactivity. You can pan and zoom, and even move forwards
and backwards through your zoom history. But ultimately it's a pretty static
Now, as it so happens, the plot that opens does have some basic interactivity.
You can pan, zoom, mess with layout, etc. But ultimately it's a pretty static
view into the data.


.. _line_plot_example:

Application-oriented plotting
=============================

The second approach to plotting can be thought of as "application-oriented", for
lack of a better term. There is definitely a bit more code, and the plot
initially doesn't look much different, but it sets us up to do more interesting
things, as you will see later on::
The chaco approach to plotting can be thought of as
"application-oriented", for lack of a better term. The code may appear a bit
verbose given the simple plot it generates, but it sets us up to do more
interesting things, as you will see later on::

from numpy import linspace, sin
from traits.api import HasTraits, Instance
Expand Down Expand Up @@ -183,7 +179,7 @@ things, as you will see later on::
LinePlot().configure_traits()


This produces a plot similar to the previous script-oriented code snippet:
This produces the following plot:

.. image:: images/first_plot.png
:height: 300pt
Expand Down Expand Up @@ -1301,4 +1297,4 @@ trait editor and reusing an existing tool from the built-in set of tools.


*This tutorial is based on the "Interactive plotting with Chaco" tutorial
that was presented by Peter Wang at Scipy 2008*
that was presented by Peter Wang at Scipy*
Binary file modified docs/source/user_manual/images/script_oriented.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions docs/source/user_manual/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ of several of graphical back ends <embedding>`. Working at this level allows the
maximum flexibility, but requires understanding
:ref:`Chaco's basic elements <basic_elements>`.

Chaco defines two abstraction layers that allow a more high-level (albeit
less flexible) plotting experience. First, Chaco contains a
Chaco defines an abstraction layer that allows a more high-level (albeit
less flexible) plotting experience. Namely, Chaco contains a
:class:`~chaco.plot.Plot` class that defines several methods that create a
complete plot given one or more data sets. In other words,
:class:`~chaco.plot.Plot` knows how to package data for the most common kinds
of plots. Second, Chaco has a :mod:`shell` module that defines high-level
plotting functions. This module allows using Chaco as an interactive plotting
tool that will be familiar to users of matplotlib.
of plots.

.. _basic_elements:

Expand Down
259 changes: 0 additions & 259 deletions docs/source/user_manual/tutorial_ipython.rst

This file was deleted.

0 comments on commit 4e7831c

Please sign in to comment.