@@ -167,8 +167,10 @@ outputs, and each of these capabilities is called a backend; the
167167"frontend" is the user facing code, ie the plotting code, whereas the
168168"backend" does all the hard work behind-the-scenes to make the
169169figure. There are two types of backends: user interface backends (for
170- use in pygtk, wxpython, tkinter, qt, macosx, or fltk) and hardcopy backends to
171- make image files (PNG, SVG, PDF, PS).
170+ use in pygtk, wxpython, tkinter, qt, macosx, or fltk; also
171+ referred to as "interactive backends") and hardcopy backends to
172+ make image files (PNG, SVG, PDF, PS; also referred to as "non-interactive
173+ backends").
172174
173175There are a two primary ways to configure your backend. One is to set
174176the ``backend `` parameter in your ``matplotlibrc `` file (see
@@ -184,23 +186,28 @@ The other is to use the matplotlib :func:`~matplotlib.use` directive::
184186If you use the ``use `` directive, this must be done before importing
185187:mod: `matplotlib.pyplot ` or :mod: `matplotlib.pylab `.
186188
187- If you are unsure what to do, and just want to get coding, just set
188- your backend to ``TkAgg ``. This will do the right thing for most
189- users. It gives you the option of running your scripts in batch or
190- working interactively from the python shell, with the least amount of
191- hassles, and is smart enough to do the right thing when you ask for
192- postscript, or pdf, or other image formats.
189+ .. note ::
190+ Backend name specifications are not case-sensitive; e.g., 'GTKAgg'
191+ and 'gtkagg' are equivalent.
192+
193+ With a typical installation of matplotlib, such as from a
194+ binary installer or a linux distribution package, a good default
195+ backend will already be set, allowing both interactive work and
196+ plotting from scripts, with output to the screen and/or to
197+ a file, so at least initially you will not need to use either of the
198+ two methods given above.
193199
194- If however, you want to write graphical user interfaces, or a web
200+ If, however, you want to write graphical user interfaces, or a web
195201application server (:ref: `howto-webapp `), or need a better
196202understanding of what is going on, read on. To make things a little
197203more customizable for graphical user interfaces, matplotlib separates
198204the concept of the renderer (the thing that actually does the drawing)
199205from the canvas (the place where the drawing goes). The canonical
200206renderer for user interfaces is ``Agg `` which uses the `Anti-Grain
201207Geometry `_ C++ library to make a raster (pixel) image of the figure.
202- All of the user interfaces can be used with agg rendering, eg
203- ``WXAgg ``, ``GTKAgg ``, ``QTAgg ``, ``TkAgg ``, ``CocoaAgg ``. In
208+ All of the user interfaces except ``macosx `` can be used with
209+ agg rendering, eg
210+ ``WXAgg ``, ``GTKAgg ``, ``QT4Agg ``, ``TkAgg ``. In
204211addition, some of the user interfaces support other rendering engines.
205212For example, with GTK, you can also select GDK rendering (backend
206213``GTK ``) or Cairo rendering (backend ``GTKCairo ``).
@@ -214,7 +221,8 @@ generate a pixel representation of the line whose accuracy depends on a
214221DPI setting.
215222
216223Here is a summary of the matplotlib renderers (there is an eponymous
217- backed for each):
224+ backed for each; these are *non-interactive backends *, capable of
225+ writing to a file):
218226
219227============= ============ ================================================
220228Renderer Filetypes Description
@@ -238,7 +246,10 @@ SVG :term:`svg` :term:`vector graphics` --
238246 ...
239247============= ============ ================================================
240248
241- And here are the user interfaces and renderer combinations supported:
249+ And here are the user interfaces and renderer combinations supported;
250+ these are *interactive backends *, capable of displaying to the screen
251+ and of using appropriate renderers from the table above to write to
252+ a file:
242253
243254============ ================================================================
244255Backend Description
@@ -253,9 +264,14 @@ WX Native :term:`wxWidgets` drawing to a :term:`wxWidgets` Canvas
253264 (not recommended) (requires wxPython _)
254265TkAgg Agg rendering to a :term: `Tk ` canvas (requires TkInter _)
255266QtAgg Agg rendering to a :term: `Qt ` canvas (requires PyQt _)
267+ (not recommended; use Qt4Agg)
256268Qt4Agg Agg rendering to a :term: `Qt4 ` canvas (requires PyQt4 _)
257269FLTKAgg Agg rendering to a :term: `FLTK ` canvas (requires pyFLTK _)
270+ (not widely used; consider TKAgg, GTKAgg, WXAgg, or
271+ QT4Agg instead)
258272macosx Cocoa rendering in OSX windows
273+ (presently lacks blocking show() behavior when matplotlib
274+ is in non-interactive mode)
259275============ ================================================================
260276
261277.. _`Anti-Grain Geometry` : http://www.antigrain.com/
@@ -272,21 +288,6 @@ macosx Cocoa rendering in OSX windows
272288.. _pyFLTK : http://pyfltk.sourceforge.net
273289
274290
275- .. _pygtk-2.4 :
276-
277- Compile matplotlib with PyGTK-2.4
278- -------------------------------------------
279-
280- There is a `bug in PyGTK-2.4 `_. You need to edit
281- :file: `pygobject.h ` to add the :c:macro: `G_BEGIN_DECLS ` and :c:macro: `G_END_DECLS `
282- macros, and rename :c:data: `typename ` parameter to :c:data: `typename_ `::
283-
284- - const char *typename,
285- + const char *typename_,
286-
287- .. _`bug in PyGTK-2.4` : http://bugzilla.gnome.org/show_bug.cgi?id=155304
288-
289-
290291OS-X questions
291292==============
292293
0 commit comments