@@ -66,15 +66,15 @@ Other python interpreters
66
66
=========================
67
67
68
68
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
71
71
are going to need to understand what a matplotlib backend is
72
72
:ref: `what-is-a-backend `.
73
73
74
74
75
75
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
78
78
``backend : TkAgg `` and ``interactive : True `` in your
79
79
:file: `matplotlibrc ` file (see :ref: `customizing-matplotlib `) and fire
80
80
up python. Then::
@@ -83,18 +83,22 @@ up python. Then::
83
83
>>> plot([1,2,3])
84
84
>>> xlabel('hi mom')
85
85
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
87
90
figures from scripts, interactive mode can be slow since it redraws
88
91
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.
98
102
99
103
.. _controlling-interactive :
100
104
0 commit comments