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

Skip to content

Commit 3586394

Browse files
committed
Merge pull request #2026 from mdboom/deprecations-pre-13
Major deprecations and housecleaning for v1.3
2 parents cadcefc + cfdf9ec commit 3586394

Some content is hidden

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

41 files changed

+346
-2989
lines changed

doc/api/api_changes.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,77 @@ For new features that were added to matplotlib, please see
1212
:ref:`whats-new`.
1313

1414

15+
.. _changes_in_1_3:
16+
1517
Changes in 1.3.x
1618
================
1719

20+
* The following items that were deprecated in version 1.2 or earlier
21+
have now been removed completely.
22+
23+
- The Qt 3.x backends (`qt` and `qtagg`) have been removed in
24+
favor of the Qt 4.x backends (`qt4` and `qt4agg`).
25+
26+
- The FltkAgg and Emf backends have been removed.
27+
28+
- The `matplotlib.nxutils` module has been removed. Use the
29+
functionality on `matplotlib.path.Path.contains_point` and
30+
friends instead.
31+
32+
- Instead of `axes.Axes.get_frame`, use `axes.Axes.patch`.
33+
34+
- The following `kwargs` to the `legend` function have been
35+
renamed:
36+
37+
- `pad` -> `borderpad`
38+
- `labelsep` -> `labelspacing`
39+
- `handlelen` -> `handlelength`
40+
- `handletextsep` -> `handletextpad`
41+
- `axespad` -> `borderaxespad`
42+
43+
Related to this, the following rcParams have been removed:
44+
45+
- `legend.pad`, `legend.labelsep`, `legend.handlelen`,
46+
`legend.handletextsep` and `legend.axespad`
47+
48+
- For the `hist` function, instead of `width`, use `rwidth`
49+
(relative width).
50+
51+
- On `patches.Circle`, the `resolution` kwarg has been removed.
52+
For a circle made up of line segments, use
53+
`patches.CirclePolygon`.
54+
55+
- The printing functions in the Wx backend have been removed due
56+
to the burden of keeping them up-to-date.
57+
58+
- `mlab.liaupunov` has been removed.
59+
60+
- `mlab.save`, `mlab.load`, `pylab.save` and `pylab.load` have
61+
been removed. We recommend using `numpy.savetxt` and
62+
`numpy.loadtxt` instead.
63+
64+
- `widgets.HorizontalSpanSelector` has been removed. Use
65+
`widgets.SpanSelector` instead.
66+
67+
* The CocoaAgg backend has been deprecated, with the possibility for
68+
deletion or resurrection in a future release.
69+
70+
* The top-level functions in `matplotlib.path` that are implemented in
71+
C++ were never meant to be public. Instead, users should use the
72+
Pythonic wrappers for them in the `path.Path` and
73+
`collections.Collection` classes. Use the following mapping to update
74+
your code:
75+
76+
- `point_in_path` -> `path.Path.contains_point`
77+
- `get_path_extents` -> `path.Path.get_extents`
78+
- `point_in_path_collection` -> `collection.Collection.contains`
79+
- `path_in_path` -> `path.Path.contains_path`
80+
- `path_intersects_path` -> `path.Path.intersects_path`
81+
- `convert_path_to_polygons` -> `path.Path.to_polygons`
82+
- `cleanup_path` -> `path.Path.cleaned`
83+
- `points_in_path` -> `path.Path.contains_points`
84+
- `clip_path_to_rect` -> `path.Path.clip_to_bbox`
85+
1886
* `Path` objects can now be marked as `readonly` by passing
1987
`readonly=True` to its constructor. The built-in path singletons,
2088
obtained through `Path.unit*` class methods return readonly paths.

doc/faq/usage_faq.rst

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,11 @@ others in web application servers to dynamically serve up graphs.
164164
To support all of these use cases, matplotlib can target different
165165
outputs, and each of these capabilities is called a backend; the
166166
"frontend" is the user facing code, ie the plotting code, whereas the
167-
"backend" does all the hard work behind-the-scenes to make the
168-
figure. There are two types of backends: user interface backends (for
169-
use in pygtk, wxpython, tkinter, qt, macosx, or fltk; also
170-
referred to as "interactive backends") and hardcopy backends to
171-
make image files (PNG, SVG, PDF, PS; also referred to as "non-interactive
172-
backends").
167+
"backend" does all the hard work behind-the-scenes to make the figure.
168+
There are two types of backends: user interface backends (for use in
169+
pygtk, wxpython, tkinter, qt4, or macosx; also referred to as
170+
"interactive backends") and hardcopy backends to make image files
171+
(PNG, SVG, PDF, PS; also referred to as "non-interactive backends").
173172

174173
There are a two primary ways to configure your backend. One is to set
175174
the ``backend`` parameter in your ``matplotlibrc`` file (see
@@ -266,12 +265,7 @@ WXAgg Agg rendering to to a :term:`wxWidgets` canvas
266265
WX Native :term:`wxWidgets` drawing to a :term:`wxWidgets` Canvas
267266
(not recommended) (requires wxPython_)
268267
TkAgg Agg rendering to a :term:`Tk` canvas (requires TkInter_)
269-
QtAgg Agg rendering to a :term:`Qt` canvas (requires PyQt_)
270-
(deprecated; use Qt4Agg)
271268
Qt4Agg Agg rendering to a :term:`Qt4` canvas (requires PyQt4_)
272-
FLTKAgg Agg rendering to a :term:`FLTK` canvas (requires pyFLTK_)
273-
(not widely used; consider TKAgg, GTKAgg, WXAgg, or
274-
QT4Agg instead)
275269
macosx Cocoa rendering in OSX windows
276270
(presently lacks blocking show() behavior when matplotlib
277271
is in non-interactive mode)
@@ -288,9 +282,7 @@ macosx Cocoa rendering in OSX windows
288282
.. _pycairo: http://www.cairographics.org/pycairo/
289283
.. _wxPython: http://www.wxpython.org/
290284
.. _TkInter: http://wiki.python.org/moin/TkInter
291-
.. _PyQt: http://www.riverbankcomputing.co.uk/software/pyqt/intro
292285
.. _PyQt4: http://www.riverbankcomputing.co.uk/software/pyqt/intro
293-
.. _pyFLTK: http://pyfltk.sourceforge.net
294286

295287

296288

doc/glossary/index.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ Glossary
2222
EPS
2323
Encapsulated Postscript (`EPS <http://en.wikipedia.org/wiki/Encapsulated_PostScript>`_)
2424

25-
FLTK
26-
`FLTK <http://www.fltk.org/>`_ (pronounced "fulltick") is a cross-platform C++ GUI toolkit for
27-
UNIX/Linux (X11), Microsoft Windows, and MacOS X
28-
2925
freetype
3026
`freetype <http://www.freetype.org/>`_ is a font rasterization
3127
library used by matplotlib which supports TrueType, Type 1, and
@@ -68,11 +64,6 @@ Glossary
6864
channel. PDF was designed in part as a next-generation document
6965
format to replace postscript
7066

71-
pyfltk
72-
`pyfltk <http://pyfltk.sourceforge.net/>`_ provides python
73-
wrappers for the :term:`FLTK` widgets library for use with
74-
FLTKAgg
75-
7667
pygtk
7768
`pygtk <http://www.pygtk.org/>`_ provides python wrappers for
7869
the :term:`GTK` widgets library for use with the GTK or GTKAgg

doc/users/event_handling.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
Event handling and picking
55
**************************
66

7-
matplotlib works with 6 user interface toolkits (wxpython, tkinter,
8-
qt, gtk, fltk and macosx) and in order to support features like interactive
9-
panning and zooming of figures, it is helpful to the developers to
10-
have an API for interacting with the figure via key presses and mouse
11-
movements that is "GUI neutral" so we don't have to repeat a lot of
12-
code across the different user interfaces. Although the event
13-
handling API is GUI neutral, it is based on the GTK model, which was
14-
the first user interface matplotlib supported. The events that are
15-
triggered are also a bit richer vis-a-vis matplotlib than standard GUI
16-
events, including information like which :class:`matplotlib.axes.Axes`
17-
the event occurred in. The events also understand the matplotlib
18-
coordinate system, and report event locations in both pixel and data
19-
coordinates.
7+
matplotlib works with a number of user interface toolkits (wxpython,
8+
tkinter, qt4, gtk, and macosx) and in order to support features like
9+
interactive panning and zooming of figures, it is helpful to the
10+
developers to have an API for interacting with the figure via key
11+
presses and mouse movements that is "GUI neutral" so we don't have to
12+
repeat a lot of code across the different user interfaces. Although
13+
the event handling API is GUI neutral, it is based on the GTK model,
14+
which was the first user interface matplotlib supported. The events
15+
that are triggered are also a bit richer vis-a-vis matplotlib than
16+
standard GUI events, including information like which
17+
:class:`matplotlib.axes.Axes` the event occurred in. The events also
18+
understand the matplotlib coordinate system, and report event
19+
locations in both pixel and data coordinates.
2020

2121
.. _event-connections:
2222

doc/users/screenshots.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ rendering of strings with the *usetex* option.
265265
EEG demo
266266
=========
267267

268-
You can embed matplotlib into pygtk, wxpython, Tk, FLTK or Qt
268+
You can embed matplotlib into pygtk, wxpython, Tk, or Qt4
269269
applications. Here is a screenshot of an eeg viewer called pbrain
270270
which is part of the NeuroImaging in Python suite `NIPY
271271
<http://neuroimaging.scipy.org>`_. Pbrain is written in pygtk using

doc/users/whats_new.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ revision, see the :ref:`github-stats`.
2121

2222
new in matplotlib-1.3
2323
=====================
24+
25+
Housecleaning
26+
-------------
27+
28+
A number of features that were deprecated in 1.2 or earlier, or have
29+
not been in a working state for a long time have been removed.
30+
Highlights include removing the Qt version 3 backends, and the FltkAgg
31+
and Emf backends. See :ref:`changes_in_1_3` for a complete list.
32+
2433
`xkcd`-style sketch plotting
2534
----------------------------
2635

examples/animation/old_animation/animation_blit_fltk.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

examples/animation/old_animation/animation_blit_qt.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

examples/event_handling/pipong.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ def key_press(self,event):
250250

251251
if event.key == 'g':
252252
#self.ax.clear()
253-
#self.ax.grid() # seems to be necessary for qt backend
254253
self.on = not self.on
255254
if event.key == 't':
256255
self.inst = not self.inst

examples/event_handling/pong_qt.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

examples/event_handling/test_mouseclicks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#matplotlib.use("WxAgg")
66
#matplotlib.use("TkAgg")
77
#matplotlib.use("GTKAgg")
8-
#matplotlib.use("QtAgg")
98
#matplotlib.use("Qt4Agg")
109
#matplotlib.use("CocoaAgg")
1110
#matplotlib.use("MacOSX")

examples/misc/rc_traits.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class PatchRC(traits.HasTraits):
127127
antialiased = flexible_true_trait
128128

129129
timezones = 'UTC', 'US/Central', 'ES/Eastern' # fixme: and many more
130-
backends = ('GTKAgg', 'Cairo', 'FltkAgg', 'GDK', 'GTK', 'Agg',
130+
backends = ('GTKAgg', 'Cairo', 'GDK', 'GTK', 'Agg',
131131
'GTKCairo', 'PS', 'SVG', 'Template', 'TkAgg',
132132
'WX')
133133

@@ -192,6 +192,3 @@ def __init__(self,
192192
print()
193193
print('Patch')
194194
p.print_traits()
195-
196-
197-

0 commit comments

Comments
 (0)