Skip to content

Commit 755949b

Browse files
committed
Merge remote-tracking branch 'main/master'
Conflicts: lib/matplotlib/backends/backend_svg.py lib/matplotlib/backends/qt4_editor/formlayout.py
2 parents 0adb05e + b88b9c5 commit 755949b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+7351
-419
lines changed

CHANGELOG

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2011-06-28 3D versions of scatter, plot, plot_wireframe, plot_surface,
2+
bar3d, and some other functions now support empty inputs. - BVR
3+
4+
2011-06-16 Added *bottom* keyword parameter for the stem command.
5+
Also, implemented a legend handler for the stem plot.
6+
- JJL
7+
18
2011-04-17 Disable keyboard auto-repeat in qt4 backend by ignoring
29
key events resulting from auto-repeat. This makes
310
constrained zoom/pan work. - EF

README.osx

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
1-
Build mpl on OSX has proven to be a nightmare because of all the
1+
Building mpl on OSX has proven to be a nightmare because of all the
22
different types of zlib, png and freetype that may be on your system.
33
The recommended and supported way to build is to use the make.osx file
44
in this directory. This script requires you to set a PREFIX
5-
environment variable where you want to the install to go. It will
6-
fetch the dependencies from a remove server and install them into your
5+
environment variable where you want the install to go. It will
6+
fetch the dependencies from a remote server and install them into your
77
PREFIX dir, and then build mpl against them. It should ignore any
88
lib, png or freetype on your system
99

1010
Example usage::
1111

12-
PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install
12+
make -f make.osx PREFIX=/Users/jdhunter/dev PYVERSION=2.6 \
13+
fetch deps mpl_install_std
1314

15+
Variables:
16+
PREFIX (required): where to install the dependencies
17+
PYVERSION (optional): which python version to use
18+
(default=python, e.g. PYVERSION=2.6 uses python2.6)
19+
20+
Targets:
21+
22+
clean: remove compiled files
23+
fetch: download dependencies
24+
deps: build all dependencies (zlib, png, freetype)
25+
mpl_build: compile matplotlib
26+
mpl_install: install matplotlib in $PREFIX/lib/pythonX.Y/site-packages
27+
mpl_install_std: install matplotlib in standard site-packages directory
28+
mpl_install_egg: install matplotlib as an egg
29+
mpl_install_develop: set up egg link to working directory (for developers)
30+
binaries: create the dmg file for distribution

doc/faq/howto_faq.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,9 @@ locators as desired because the two axes are independent::
441441
Generate images without having a window popup
442442
--------------------------------------------------
443443

444-
The easiest way to do this is use an image backend (see
444+
The easiest way to do this is use a non-interactive backend (see
445445
:ref:`what-is-a-backend`) such as Agg (for PNGs), PDF, SVG or PS. In
446-
your figure generating script, just call the
446+
your figure-generating script, just call the
447447
:func:`matplotlib.use` directive before importing pylab or
448448
pyplot::
449449

doc/faq/installing_faq.rst

-142
Original file line numberDiff line numberDiff line change
@@ -144,148 +144,6 @@ setupegg.py develop` command again to compile them.
144144
There is more information on :ref:`using git <using-git>` in
145145
the developer docs.
146146

147-
Backends
148-
========
149-
150-
.. _what-is-a-backend:
151-
152-
What is a backend?
153-
------------------
154-
155-
A lot of documentation on the website and in the mailing lists refers
156-
to the "backend" and many new users are confused by this term.
157-
matplotlib targets many different use cases and output formats. Some
158-
people use matplotlib interactively from the python shell and have
159-
plotting windows pop up when they type commands. Some people embed
160-
matplotlib into graphical user interfaces like wxpython or pygtk to
161-
build rich applications. Others use matplotlib in batch scripts to
162-
generate postscript images from some numerical simulations, and still
163-
others in web application servers to dynamically serve up graphs.
164-
165-
To support all of these use cases, matplotlib can target different
166-
outputs, and each of these capabilities is called a backend; the
167-
"frontend" is the user facing code, ie the plotting code, whereas the
168-
"backend" does all the hard work behind-the-scenes to make the
169-
figure. 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).
172-
173-
There are a two primary ways to configure your backend. One is to set
174-
the ``backend`` parameter in your ``matplotlibrc`` file (see
175-
:ref:`customizing-matplotlib`)::
176-
177-
backend : WXAgg # use wxpython with antigrain (agg) rendering
178-
179-
The other is to use the matplotlib :func:`~matplotlib.use` directive::
180-
181-
import matplotlib
182-
matplotlib.use('PS') # generate postscript output by default
183-
184-
If you use the ``use`` directive, this must be done before importing
185-
:mod:`matplotlib.pyplot` or :mod:`matplotlib.pylab`.
186-
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.
193-
194-
If however, you want to write graphical user interfaces, or a web
195-
application server (:ref:`howto-webapp`), or need a better
196-
understanding of what is going on, read on. To make things a little
197-
more customizable for graphical user interfaces, matplotlib separates
198-
the concept of the renderer (the thing that actually does the drawing)
199-
from the canvas (the place where the drawing goes). The canonical
200-
renderer for user interfaces is ``Agg`` which uses the `Anti-Grain
201-
Geometry`_ 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
204-
addition, some of the user interfaces support other rendering engines.
205-
For example, with GTK, you can also select GDK rendering (backend
206-
``GTK``) or Cairo rendering (backend ``GTKCairo``).
207-
208-
For the rendering engines, one can also distinguish between `vector
209-
<http://en.wikipedia.org/wiki/Vector_graphics>`_ or `raster
210-
<http://en.wikipedia.org/wiki/Raster_graphics>`_ renderers. Vector
211-
graphics languages issue drawing commands like "draw a line from this
212-
point to this point" and hence are scale free, and raster backends
213-
generate a pixel representation of the line whose accuracy depends on a
214-
DPI setting.
215-
216-
Here is a summary of the matplotlib renderers (there is an eponymous
217-
backed for each):
218-
219-
============= ============ ================================================
220-
Renderer Filetypes Description
221-
============= ============ ================================================
222-
:term:`AGG` :term:`png` :term:`raster graphics` -- high quality images
223-
using the `Anti-Grain Geometry`_ engine
224-
PS :term:`ps` :term:`vector graphics` -- Postscript_ output
225-
:term:`eps`
226-
PDF :term:`pdf` :term:`vector graphics` --
227-
`Portable Document Format`_
228-
SVG :term:`svg` :term:`vector graphics` --
229-
`Scalable Vector Graphics`_
230-
:term:`Cairo` :term:`png` :term:`vector graphics` --
231-
:term:`ps` `Cairo graphics`_
232-
:term:`pdf`
233-
:term:`svg`
234-
...
235-
:term:`GDK` :term:`png` :term:`raster graphics` --
236-
:term:`jpg` the `Gimp Drawing Kit`_
237-
:term:`tiff`
238-
...
239-
============= ============ ================================================
240-
241-
And here are the user interfaces and renderer combinations supported:
242-
243-
============ ================================================================
244-
Backend Description
245-
============ ================================================================
246-
GTKAgg Agg rendering to a :term:`GTK` canvas (requires PyGTK_)
247-
GTK GDK rendering to a :term:`GTK` canvas (not recommended)
248-
(requires PyGTK_)
249-
GTKCairo Cairo rendering to a :term:`GTK` Canvas (requires PyGTK_)
250-
WXAgg Agg rendering to to a :term:`wxWidgets` canvas
251-
(requires wxPython_)
252-
WX Native :term:`wxWidgets` drawing to a :term:`wxWidgets` Canvas
253-
(not recommended) (requires wxPython_)
254-
TkAgg Agg rendering to a :term:`Tk` canvas (requires TkInter_)
255-
QtAgg Agg rendering to a :term:`Qt` canvas (requires PyQt_)
256-
Qt4Agg Agg rendering to a :term:`Qt4` canvas (requires PyQt4_)
257-
FLTKAgg Agg rendering to a :term:`FLTK` canvas (requires pyFLTK_)
258-
macosx Cocoa rendering in OSX windows
259-
============ ================================================================
260-
261-
.. _`Anti-Grain Geometry`: http://www.antigrain.com/
262-
.. _Postscript: http://en.wikipedia.org/wiki/PostScript
263-
.. _`Portable Document Format`: http://en.wikipedia.org/wiki/Portable_Document_Format
264-
.. _`Scalable Vector Graphics`: http://en.wikipedia.org/wiki/Scalable_Vector_Graphics
265-
.. _`Cairo graphics`: http://en.wikipedia.org/wiki/Cairo_(graphics)
266-
.. _`Gimp Drawing Kit`: http://en.wikipedia.org/wiki/GDK
267-
.. _PyGTK: http://www.pygtk.org
268-
.. _wxPython: http://www.wxpython.org/
269-
.. _TkInter: http://wiki.python.org/moin/TkInter
270-
.. _PyQt: http://www.riverbankcomputing.co.uk/software/pyqt/intro
271-
.. _PyQt4: http://www.riverbankcomputing.co.uk/software/pyqt/intro
272-
.. _pyFLTK: http://pyfltk.sourceforge.net
273-
274-
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 :file:`pygobject.h`
281-
to add the :c:macro:`G_BEGIN_DECLS` and :c:macro:`G_END_DECLS` macros,
282-
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-
289147

290148
OS-X questions
291149
==============

0 commit comments

Comments
 (0)