Skip to content

Commit

Permalink
DOC: follow IPython's API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelVaroquaux committed Mar 28, 2012
1 parent c8b7df5 commit e23f03a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
9 changes: 7 additions & 2 deletions docs/source/mayavi/advanced_scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ explicit calls to the engine::

As with all Mayavi code, you need to have the GUI mainloop running to
have the visualization go live. Typing this code in `ipython -wthread`
will do this for you.
(or `ipython --gui=wx` in the recent versions) will do this for you.

This explicit, object-oriented, code thus mirrors the `mlab.pipeline`
code. It is more fine-grained, and gives you more control. For instance
Expand All @@ -126,7 +126,8 @@ are setup and its ``start`` method is called automatically. When the
object is removed from the pipeline its ``stop`` method is called
automatically. Note that if you are looking to remove an object from
the mayavi pipeline, you can use the ``remove`` method to do so. For
example (the following will require that you use ``ipython -wthread``)::
example (the following will require that you use ``ipython -wthread`` or
`ipython --gui=wx`)::

>>> from mayavi.api import Engine
>>> e = Engine()
Expand Down Expand Up @@ -226,6 +227,10 @@ one to interactively script the mayavi application::

$ ipython -wthread

In the recent IPython versions, the right switch is::

$ ipython --gui=wx

To start a visualization do the following::

from mayavi.plugins.app import main
Expand Down
4 changes: 2 additions & 2 deletions docs/source/mayavi/example_using_with_scipy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ We are going to use the `mlab` module (see
:ref:`simple-scripting-with-mlab`) to interactively visualize this
volumetric data. For this it is best to type the commands in an
interactive Python shell, either using the built-in shell of the Mayavi2
application, on in `ipython -wthread`. Let us visualize the 3D
isosurfaces of the potential::
application, on in `ipython -wthread` (`ipython --gui=wx` in recent
IPython versions). Let us visualize the 3D isosurfaces of the potential::

from mayavi import mlab
mlab.contour3d(X, Y, Z, V)
Expand Down
4 changes: 4 additions & 0 deletions docs/source/mayavi/mlab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ It is can be used interactively with IPython_.

$ ipython -wthread

Or, for IPython recent version (0.11 and above):

$ ipython --gui=wx

If you are using the `Enthought Python Distribution
<http://www.enthought.com/products/epd.php>`_, or the latest
`Python(x,y) <http://www.pythonxy.com>`_ distribution, the Pylab menu
Expand Down
8 changes: 6 additions & 2 deletions docs/source/mayavi/mlab_running_scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ scripts using IPython_'s ``%run`` command::

In [1]: %run my_script

You need to start IPython_ with the `-wthread` option (when installed
You need to start IPython_ with the `-wthread` option, that became `--gui=wx` in the recent IPython versions (when installed
with `EPD`_, the `pylab` start-menu link does this for you). In this
environment, the plotting commands are interactive: they have an
immediate effect on the figure, alleviating the need to use the
Expand All @@ -37,7 +37,11 @@ Using together with Matplotlib's pylab
If you want to use Matplotlib's pylab with Mayavi's mlab in IPython you
should:

* if your IPython version is greater than 0.8.4: start IPython with
* if your IPython version is greater than 0.11: start IPython with::

$ ipython --gui=wx --pylab=wx

* else, if your IPython version is greater than 0.8.4: start IPython with
the following options::

$ ipython -pylab -wthread
Expand Down
3 changes: 2 additions & 1 deletion mlab_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def document_function(func, func_name=None, example_code=None,

if example_code is not None:
documentation += """
**Example** (run in ``ipython -wthread`` or in the mayavi2 interactive shell,
**Example** (run in ``ipython -wthread``, ``ipython --gui=wx`` for recent
IPython versions, or in the mayavi2 interactive shell,
see :ref:`running-mlab-scripts` for more info)::
%s
Expand Down

0 comments on commit e23f03a

Please sign in to comment.