Skip to content

Commit 8ec30b7

Browse files
committed
Merge branch 'v1.2.x'
Conflicts: lib/matplotlib/cbook.py
2 parents 67706a6 + 445e568 commit 8ec30b7

30 files changed

+3636
-593
lines changed

test/TODO renamed to TODO_TESTS

File renamed without changes.

doc/api/api_changes.rst

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ For new features that were added to matplotlib, please see
1414
Changes in 1.2.x
1515
================
1616

17+
* The :meth:`~matplotlib.cbook.isvector` method has been removed since it
18+
is no longer functional.
19+
20+
* The `rasterization_zorder` property on `~matplotlib.axes.Axes` a
21+
zorder below which artists are rasterized. This has defaulted to
22+
-30000.0, but it now defaults to `None`, meaning no artists will be
23+
rasterized. In order to rasterize artists below a given zorder
24+
value, `set_rasterization_zorder` must be explicitly called.
25+
1726
* In :meth:`~matplotlib.axes.Axes.scatter`, and `~pyplot.scatter`,
1827
when specifying a marker using a tuple, the angle is now specified
1928
in degrees, not radians.
@@ -90,14 +99,14 @@ Changes in 1.2.x
9099
def transform(self, xy):
91100
...
92101
transform_non_affine = transform
93-
94-
102+
103+
95104
This approach will no longer function correctly and should be changed to::
96105

97106
class MyTransform(mtrans.Transform):
98107
def transform_non_affine(self, xy):
99108
...
100-
109+
101110

102111
* Artists no longer have ``x_isdata`` or ``y_isdata`` attributes; instead
103112
any artist's transform can be interrogated with
@@ -115,7 +124,7 @@ Changes in 1.2.x
115124
Bbox('array([[ 0., 0.],\n [ 90., 90.]])')
116125

117126
* One can now easily get a transform which goes from one transform's coordinate
118-
system to another, in an optimized way, using the new subtract method on a
127+
system to another, in an optimized way, using the new subtract method on a
119128
transform. For instance, to go from data coordinates to axes coordinates::
120129

121130
>>> import matplotlib.pyplot as plt
@@ -126,8 +135,8 @@ Changes in 1.2.x
126135
>>> print(data2ax.depth)
127136
2
128137

129-
for versions before 1.2 this could only be achieved in a sub-optimal way,
130-
using ``ax.transData + ax.transAxes.inverted()`` (depth is a new concept,
138+
for versions before 1.2 this could only be achieved in a sub-optimal way,
139+
using ``ax.transData + ax.transAxes.inverted()`` (depth is a new concept,
131140
but had it existed it would return 4 for this example).
132141

133142
* ``twinx`` and ``twiny`` now returns an instance of SubplotBase if
@@ -141,8 +150,8 @@ Changes in 1.2.x
141150
* :class:`~matplotlib.colors.ColorConverter`,
142151
:class:`~matplotlib.colors.Colormap` and
143152
:class:`~matplotlib.colors.Normalize` now subclasses ``object``
144-
145-
* ContourSet instances no longer have a ``transform`` attribute. Instead,
153+
154+
* ContourSet instances no longer have a ``transform`` attribute. Instead,
146155
access the transform with the ``get_transform`` method.
147156

148157
Changes in 1.1.x

doc/users/pgf.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,37 +112,37 @@ unicode handling must be configured in the preamble.
112112

113113
.. image:: /_static/pgf_texsystem.*
114114

115-
.. _pgf-hangups:
116115

117-
Possible hangups
118-
================
116+
.. _pgf-troubleshooting:
117+
118+
Troubleshooting
119+
===============
119120

120121
* Please note that the TeX packages found in some Linux distributions and
121122
MiKTeX installations are dramatically outdated. Make sure to update your
122-
package catalog and upgrade or install a recent TeX distribution before
123-
reporting problems.
123+
package catalog and upgrade or install a recent TeX distribution.
124124

125125
* On Windows, the :envvar:`PATH` environment variable may need to be modified
126126
to include the directories containing the latex, dvipng and ghostscript
127127
executables. See :ref:`environment-variables` and
128128
:ref:`setting-windows-environment-variables` for details.
129129

130+
* A limitation on Windows causes the backend to keep file handles that have
131+
been opened by your application open. As a result, it may not be possible
132+
to delete the corresponding files until the application closes (see
133+
`#1324 <https://github.com/matplotlib/matplotlib/issues/1324>`_).
134+
130135
* Sometimes the font rendering in figures that are saved to png images is
131136
very bad. This happens when the pdftocairo tool is not available and
132137
ghostscript is used for the pdf to png conversion.
133138

134-
.. _pgf-troubleshooting:
135-
136-
Troubleshooting
137-
===============
138-
139139
* Make sure what you are trying to do is possible in a LaTeX document,
140140
that your LaTeX syntax is valid and that you are using raw strings
141141
if necessary to avoid unintended escape sequences.
142142

143143
* The ``pgf.preamble`` rc setting provides lots of flexibility, and lots of
144144
ways to cause problems. When experiencing problems, try to minimalize or
145-
disable the custom preamble before reporting problems.
145+
disable the custom preamble.
146146

147147
* If you still need help, please see :ref:`reporting-problems`
148148

lib/matplotlib/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,11 +1078,13 @@ def tk_window_focus():
10781078
'matplotlib.tests.test_scale',
10791079
'matplotlib.tests.test_simplification',
10801080
'matplotlib.tests.test_spines',
1081+
'matplotlib.tests.test_subplots',
10811082
'matplotlib.tests.test_text',
10821083
'matplotlib.tests.test_ticker',
10831084
'matplotlib.tests.test_tightlayout',
10841085
'matplotlib.tests.test_triangulation',
10851086
'matplotlib.tests.test_transforms',
1087+
'matplotlib.tests.test_arrow_patches',
10861088
]
10871089

10881090

lib/matplotlib/axes.py

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import matplotlib.collections as mcoll
1717
import matplotlib.colors as mcolors
1818
import matplotlib.contour as mcontour
19-
import matplotlib.dates as _ # <-registers a date unit converter
19+
import matplotlib.dates as _ # <-registers a date unit converter
2020
from matplotlib import docstring
2121
import matplotlib.font_manager as font_manager
2222
import matplotlib.image as mimage
@@ -465,7 +465,7 @@ def __init__(self, fig, rect,
465465
self._frameon = frameon
466466
self._axisbelow = rcParams['axes.axisbelow']
467467

468-
self._rasterization_zorder = -30000
468+
self._rasterization_zorder = None
469469

470470
self._hold = rcParams['axes.hold']
471471
self._connected = {} # a dict from events to (id, func)
@@ -1852,7 +1852,9 @@ def margins(self, *args, **kw):
18521852

18531853
def set_rasterization_zorder(self, z):
18541854
"""
1855-
Set zorder value below which artists will be rasterized
1855+
Set zorder value below which artists will be rasterized. Set
1856+
to `None` to disable rasterizing of artists below a particular
1857+
zorder.
18561858
"""
18571859
self._rasterization_zorder = z
18581860

@@ -2029,7 +2031,8 @@ def draw(self, renderer=None, inframe=False):
20292031
# rasterize artists with negative zorder
20302032
# if the minimum zorder is negative, start rasterization
20312033
rasterization_zorder = self._rasterization_zorder
2032-
if len(dsu) > 0 and dsu[0][0] < rasterization_zorder:
2034+
if (rasterization_zorder is not None and
2035+
len(dsu) > 0 and dsu[0][0] < rasterization_zorder):
20332036
renderer.start_rasterizing()
20342037
dsu_rasterized = [l for l in dsu if l[0] < rasterization_zorder]
20352038
dsu = [l for l in dsu if l[0] >= rasterization_zorder]
@@ -3972,7 +3975,7 @@ def plot(self, *args, **kwargs):
39723975
39733976
plot(x, y, color='green', linestyle='dashed', marker='o',
39743977
markerfacecolor='blue', markersize=12).
3975-
3978+
39763979
See :class:`~matplotlib.lines.Line2D` for details.
39773980
39783981
The kwargs are :class:`~matplotlib.lines.Line2D` properties:
@@ -7073,7 +7076,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
70737076
**Example:**
70747077
70757078
.. plot:: mpl_examples/pylab_examples/image_demo.py
7076-
7079+
70777080
"""
70787081

70797082
if not self._hold: self.cla()
@@ -7139,6 +7142,10 @@ def pcolor(self, *args, **kwargs):
71397142
"""
71407143
Create a pseudocolor plot of a 2-D array.
71417144
7145+
Note: pcolor can be very slow for large arrays; consider
7146+
using the similar but much faster
7147+
:func:`~matplotlib.pyplot.pcolormesh` instead.
7148+
71427149
Call signatures::
71437150
71447151
pcolor(C, **kwargs)
@@ -7269,6 +7276,11 @@ def pcolor(self, *args, **kwargs):
72697276
Stroking the edges may be preferred if *alpha* is 1, but
72707277
will cause artifacts otherwise.
72717278
7279+
.. seealso::
7280+
7281+
:func:`~matplotlib.pyplot.pcolormesh`
7282+
For an explanation of the differences between
7283+
pcolor and pcolormesh.
72727284
"""
72737285

72747286
if not self._hold: self.cla()
@@ -7418,7 +7430,7 @@ def pcolormesh(self, *args, **kwargs):
74187430
74197431
If ``'None'``, edges will not be visible.
74207432
7421-
If ``'face'``, edges will have the same color as the faces.
7433+
If ``'face'``, edges will have the same color as the faces.
74227434
74237435
An mpl color or sequence of colors will set the edge color
74247436
@@ -7495,23 +7507,25 @@ def pcolorfast(self, *args, **kwargs):
74957507
"""
74967508
pseudocolor plot of a 2-D array
74977509
7498-
Experimental; this is a version of pcolor that
7499-
does not draw lines, that provides the fastest
7500-
possible rendering with the Agg backend, and that
7501-
can handle any quadrilateral grid.
7510+
Experimental; this is a pcolor-type method that
7511+
provides the fastest possible rendering with the Agg
7512+
backend, and that can handle any quadrilateral grid.
7513+
It supports only flat shading (no outlines), it lacks
7514+
support for log scaling of the axes, and it does not
7515+
have a pyplot wrapper.
75027516
75037517
Call signatures::
75047518
7505-
pcolor(C, **kwargs)
7506-
pcolor(xr, yr, C, **kwargs)
7507-
pcolor(x, y, C, **kwargs)
7508-
pcolor(X, Y, C, **kwargs)
7519+
ax.pcolorfast(C, **kwargs)
7520+
ax.pcolorfast(xr, yr, C, **kwargs)
7521+
ax.pcolorfast(x, y, C, **kwargs)
7522+
ax.pcolorfast(X, Y, C, **kwargs)
75097523
75107524
C is the 2D array of color values corresponding to quadrilateral
75117525
cells. Let (nr, nc) be its shape. C may be a masked array.
75127526
7513-
``pcolor(C, **kwargs)`` is equivalent to
7514-
``pcolor([0,nc], [0,nr], C, **kwargs)``
7527+
``ax.pcolorfast(C, **kwargs)`` is equivalent to
7528+
``ax.pcolorfast([0,nc], [0,nr], C, **kwargs)``
75157529
75167530
*xr*, *yr* specify the ranges of *x* and *y* corresponding to the
75177531
rectangular region bounding *C*. If::

0 commit comments

Comments
 (0)