--- a/trunk/htdocs/backends.html.template +++ b/trunk/htdocs/backends.html.template @@ -1,25 +1,475 @@ -@header@ +@header@ <h2>matplotlib backends</h2> The matplotlib core graphics routines interact with an abstract renderer and graphics context to allow device independent ouput. -Currently, output to pygtk, wxPython, Tkinter, postscript, -pdf, svg, agg (antigrain geometry) and Cairo are supported. With -not too much effort, you can port matplotlib to your favorite display; -high on my list of priorities are PDF and PIL. If you are interested -in porting to one of these platforms, please contact me!<p> - -For a summary of the comparative strengths and features of the various -backends, see <a href=faq.html#WHICHBACKEND>which backend should I -use?</a>. This page describes how to install and use each backend.<p> - -You can choose your default backend in the <a -href=matplotlibrc>matplotlibrc</a> file. The default can be -overridden from the command line prompt. This allows most if not all -matplotlib scripts can generate output to any of the backends without -any alterations. Following the lead of the matlab <tt>print</tt> -command, the backend can be chosen from the command line with the +Currently, output to pygtk, wxPython, Tkinter, postscript, pdf, svg, +agg (antigrain geometry) and Cairo are supported. With not too much +effort, you can port matplotlib to your favorite display. If you are +interested in porting to one of these platforms, please contact the +<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=matplotlib-devel">matplotlib-devel</a> +mailing list.<p> + +<a name="comparision"/><h2>Comparison of backends</h2> + +The following table enumerates the capabilities of the different backends.<p> + +<!-- This HTML table template is generated by emacs 22.1.1 --> +<table border="1"> + <tr bgcolor="#dddddd"> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + output formats + </td> + <td align="left" valign="top"> + rotated text + </td> + <td align="left" valign="top"> + usetex + </td> + <td align="left" valign="top"> + alpha-blending + </td> + <td align="left" valign="top"> + arbitrary clipping<br/> (polar plots) + </td> + <td align="left" valign="top"> + images + </td> + </tr> + <tr> + <td align="left" valign="top"> + Agg + </td> + <td align="left" valign="top"> + png, raw + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + Cairo + </td> + <td align="left" valign="top"> + pdf, + png,ps, + svg, + svgz + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + CocoaAgg + </td> + <td align="left" valign="top"> + png, + raw + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + Emf + </td> + <td align="left" valign="top"> + emf + </td> + <td align="left" valign="top"> + ? + </td> + <td align="left" valign="top"> + ? + </td> + <td align="left" valign="top"> + ? + </td> + <td align="left" valign="top"> + ? + </td> + <td align="left" valign="top"> + ? + </td> + </tr> + <tr> + <td align="left" valign="top"> + FltkAgg + </td> + <td align="left" valign="top"> + png, + raw + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + Gtk + (Gdk) + </td> + <td align="left" valign="top"> + jpeg, + png, + raw + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + GtkAgg + </td> + <td align="left" valign="top"> + jpeg, + png, + raw + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + GtkCairo + </td> + <td align="left" valign="top"> + jpeg, + pdf, + png, + ps, + svg, + svgz + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + Pdf + </td> + <td align="left" valign="top"> + pdf + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + Ps + </td> + <td align="left" valign="top"> + eps,ps + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + QtAgg + </td> + <td align="left" valign="top"> + png,raw + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + Qt4Agg + </td> + <td align="left" valign="top"> + png,raw + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + Svg + </td> + <td align="left" valign="top"> + svg, + svgz + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + TkAgg + </td> + <td align="left" valign="top"> + png,raw + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + </tr> + <tr> + <td align="left" valign="top"> + Wx + </td> + <td align="left" valign="top"> + bmp, + jpeg, + pcx, + png, + raw, + tiff, + xpm + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + <td align="left" valign="top"> + + </td> + </tr> + <tr> + <td align="left" valign="top"> + WxAgg + </td> + <td align="left" valign="top"> + png,raw + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + <td align="left" valign="top"> + X + </td> + </tr> +</table> + +<p> + +In addition to these factors, there are other factors that may +affect your backend selection:<p> + +<ul> + <li><b>Scalability:</b> For print, the ability to scale the image to any + resolution is important. Postscript, Pdf and Svg are good + candidates for this. Which will work best for you depends on the + publication tools you are using. + + <li><b>Speed:</b> When running locally, the Agg-related backends are likely + to be the fastest since most of Agg is renderered in C extension + code, and most of the optimization effort has been dedicated to + it. However, when running X11 remotely, the Gtk and Wx backends + may be faster since they send high-level X commands over the + network rather than pixel data.</li> + + <li><b>Interactivity:</b> All of the GUI backends can be used interactively + from a python shell (see <a href=interactive.html>interactive</a>) but + TkAgg is the hands-down winner here since it can be use from any + python shell whereas the GTK and Wx backends require a GUI specific + shell.</li> + + <li><b>Pretty widgets:</b> If you want to embed matplotlib in an application and + pretty GUIs are important to you, Wx, GTK, GTKAgg or GTKCairo are probably + your best best. Tk and Fltk widgets are not visually stunning. </li> +</ul> + +<h3>Choosing a backend</h3> + +You can choose your default backend in +the <a href=matplotlibrc>matplotlibrc</a> file, using the 'backend' +option. The default can be overridden from the command line prompt. +This allows most if not all matplotlib scripts to generate output to +any of the backends without any alterations. Following the lead of +the matlab <tt>print</tt> command, the backend can be chosen from the +command line with the <tt>-d</tt> flag, as in <pre> @@ -59,10 +509,11 @@ matplotlib.use('PS') </pre> -The current backend strings that are supported are +The current backend strings that are supported are <a href=matplotlib.backends.backend_agg.html>Agg</a>, <a href=matplotlib.backends.backend_cairo.html>Cairo</a>, <a +href=matplotlib.backends.backend_fltkagg.html>FltkAgg</a>, <a href=matplotlib.backends.backend_gtk.html>GTK</a>, <a href=matplotlib.backends.backend_gtkagg.html>GTKAgg</a>, <a href=matplotlib.backends.backend_gtkcairo.html>GTKCairo</a>, <a @@ -90,15 +541,17 @@ Specific information for installing the other backends can be found on this page below or by clicking <ul> -<li><a href=backends.html#Agg>Agg</a></li> -<li><a href=backends.html#Cairo>Cairo</a></li> -<li><a href=backends.html#TkAgg>TkAgg</a></li> -<li><a href=backends.html#GTK>GTK</a></li> -<li><a href=backends.html#GTKAgg>GTKAgg</a></li> -<li><a href=backends.html#GTKCairo>GTKCairo</a></li> -<li><a href=backends.html#WX>WX</a></li> -<li><a href=backends.html#WXAgg>WXAgg</a></li> -<li><a href=backends.html#PS>PS</a></li> +<li><a href=#Agg>Agg</a></li> +<li><a href=#Cairo>Cairo</a></li> +<li><a href=#TkAgg>TkAgg</a></li> +<li><a href=#GTK>GTK</a></li> +<li><a href=#GTKAgg>GTKAgg</a></li> +<li><a href=#GTKCairo>GTKCairo</a></li> +<li><a href=#WX>WX</a></li> +<li><a href=#WXAgg>WXAgg</a></li> +<li><a href=#PS>PS</a></li> +<li><a href=#PDF>PDF</a></li> +<li><a href=#SVG>SVG</a></li> </ul> @@ -112,20 +565,19 @@ scripts. Agg can also be embedded in GUI applications, as in the GTKAgg and TkAgg backends -- see <tt>setup.py</tt><p> -The windows installer comes with Agg prebuilt. For other platforms, -to compile Agg from src, set the <tt>BUILD_AGG</tt> flag in -<tt>setup.py</tt>. +matplotlib includes its own copy of Agg. It does not need to be +installed separately, even if compiling matplotlib from source. <a name=Cairo><h3>Cairo</h3></a> -<a href=http://cairographics.org>Cairo</a> is a vector graphics -library designed to provide high-quality display and print output. +<a href=http://cairographics.org>Cairo</a> is a vector graphics +library designed to provide high-quality display and print output. It doesn't depend on a GUI framework and is suitable for use in web application servers generating images for html inclusion or for generating images in batch scripts. Cairo can also be embedded in GUI applications, as in the GTKCairo backend<p> -It requires pycairo version 0.5.0 or higher from +It requires pycairo version 0.5.0 or higher from <a href=http://www.freedesktop.org/Cairo/download>Cairo downloads</a> @@ -133,35 +585,23 @@ This was the first backend supported by matplotlib; it requires -<ul> +<ul> <li><a href=http://numpy.scipy.org/>numpy</a></li> <li><a href=http://prdownloads.sourceforge.net/gtk-win> -GTK runtime</a></li> +GTK runtime</a></li> <li><a href=http://www.pygtk.org>pygtk</a> version 2.0.0 or later</li> </ul> -<h4>Redhat Users</h4> - - GTK2 became the default with the Redhat Linux 8 series. If your - distro is older than that, you'll need to upgrade your desktop, - upgrade your gtk libs, or upgrade your distro.<p> - - I am not sure what the status of GTK2 versus version number is with - the other distros, but I would be happy for answers, so if you know, - please email me @myemail@. If you put matplotlib in the subject, - the email will be sure to get past my spam filters.<p> - - <h2> Windows GTK Quickstart</h2> These install instructions will provide the <a href=backends.html#GTK>GTK<a/> and <a -href=backends.html#GTKAgg>GTK<a/>GTKAgg</a> backends on windows. If +href=backends.html#GTKAgg>GTKAgg<a/> backends on windows. If you encounter troubles, please see <a href=http://matplotlib.sourceforge.net/faq.html#GTKPATH>the FAQ</a><ul> @@ -184,7 +624,7 @@ <li> Install matplotlib using the windows installer on the <a ref=http://sourceforge.net/projects/matplotlib>download page<a></li> -</ul> +</ul> <a name=WX><h3>WX</h3></a> @@ -212,7 +652,7 @@ limitation, GTKAgg marries the widgets of GTK with the rendering of <a href=http:///antigrain.com>antigrain</a>. You need the <a href=backends.html#Agg>agg</a> and <a href=backends.html#GTK>gtk</a> -prerequisites. On windows, GTKAgg is builtin, so you only need to +prerequisites. Agg is builtin, so you only need to install pygtk and the GTK runtime, as described in <a href=backends.html#GTK>gtk</a>. @@ -270,7 +710,7 @@ <a name=PS><h3>Postscript</h3></a> -The only requirement is <a href=http://numpy.scipy.org/>numpy</a><p> +The only requirement is <a href=http://numpy.scipy.org/>numpy</a>.<p> See the <a href=fonts.html#PSFONTS>fonts page</a> for more information about getting the postscript backend setup for proper font rendering; @@ -278,7 +718,13 @@ <tt>AFMPATH</tt> if you want to use fonts other than the ones that ship with matplotlib. - +<a name=PS><h3>PDF</h3></a> + +The only requirement is <a href=http://numpy.scipy.org/>numpy</a>.<p> + +<a name=PS><h3>SVG</h3></a> + +The only requirement is <a href=http://numpy.scipy.org/>numpy</a>.<p> @footer@