Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd2eb53

Browse files
committed
doc: note that IDLE doesn't work with interactive mode.
1 parent 447a7cc commit fd2eb53

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

doc/faq/usage_faq.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ plotting is done with interactive mode either on or off.
320320
Interactive mode may also be turned on via :func:`matplotlib.pyplot.ion`,
321321
and turned off via :func:`matplotlib.pyplot.ioff`.
322322

323+
.. note::
324+
Interactive mode works with suitable backends in ipython and in
325+
the ordinary python shell, but it does *not* work in the IDLE IDE.
326+
327+
323328
Interactive example
324329
--------------------
325330

doc/users/shell.rst

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ Other python interpreters
6666
=========================
6767

6868
If you can't use ipython, and still want to use matplotlib/pylab from
69-
an interactive python shell, eg the plain-ole standard python
70-
interactive interpreter, or the interpreter in your favorite IDE, you
69+
an interactive python shell, e.g. the plain-ole standard python
70+
interactive interpreter, you
7171
are going to need to understand what a matplotlib backend is
7272
:ref:`what-is-a-backend`.
7373

7474

7575

76-
With the TkAgg backend, that uses the Tkinter user interface toolkit,
77-
you can use matplotlib from an arbitrary python shell. Just set your
76+
With the TkAgg backend, which uses the Tkinter user interface toolkit,
77+
you can use matplotlib from an arbitrary non-gui python shell. Just set your
7878
``backend : TkAgg`` and ``interactive : True`` in your
7979
:file:`matplotlibrc` file (see :ref:`customizing-matplotlib`) and fire
8080
up python. Then::
@@ -83,18 +83,22 @@ up python. Then::
8383
>>> plot([1,2,3])
8484
>>> xlabel('hi mom')
8585

86-
should work out of the box. Note, in batch mode, ie when making
86+
should work out of the box. This is also likely to work with recent
87+
versions of the qt4agg and gtkagg backends, and with the macosx backend
88+
on the Macintosh. Note, in batch mode,
89+
i.e. when making
8790
figures from scripts, interactive mode can be slow since it redraws
8891
the figure with each command. So you may want to think carefully
89-
before making this the default behavior.
90-
91-
For other user interface toolkits and their corresponding matplotlib
92-
backends, the situation is complicated by the GUI mainloop which takes
93-
over the entire process. The solution is to run the GUI in a separate
94-
thread, and this is the tricky part that ipython solves for all the
95-
major toolkits that matplotlib supports. There are reports that
96-
upcoming versions of pygtk will place nicely with the standard python
97-
shell, so stay tuned.
92+
before making this the default behavior via the :file:`matplotlibrc`
93+
file instead of using the functions listed in the next section.
94+
95+
Gui shells are at best problematic, because they have to run a
96+
mainloop, but interactive plotting also involves a mainloop. Ipython
97+
has sorted all this out for the primary matplotlib backends. There
98+
may be other shells and IDEs that also work with matplotlib in interactive
99+
mode, but one obvious candidate does not:
100+
the python IDLE IDE is a Tkinter gui app that does
101+
not support pylab interactive mode, regardless of backend.
98102

99103
.. _controlling-interactive:
100104

0 commit comments

Comments
 (0)