Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references to chaco.shell from the documentation #669

Merged
merged 6 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
58 changes: 8 additions & 50 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,57 +100,15 @@ 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
========================
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is stil worth comparing/contrasting these two styles - script-oriented vs application-oriented - so we would be using matplotlib instead of chaco.shell to demonstrate the script-oriented style of plotting.


We distinguish between "static" plots and "interactive visualizations"
because these different applications of a library affect the structure
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::

from numpy import linspace, pi, sin
from chaco.shell import *

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

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

This creates this plot:

.. image:: images/script_oriented.png
:height: 300pt

The basic structure of this example is that we generate some data, then we call
functions to plot the data and configure the plot. There is a global concept of
"the active plot", and the functions do high-level manipulations on it. The
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
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 main chaco approach to plotting can be thought of as
aaronayres35 marked this conversation as resolved.
Show resolved Hide resolved
"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 +141,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 +1259,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*
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.