Skip to content

Commit 44e36cb

Browse files
committed
Started a new section in API changes, as well as updating information for imshow()
1 parent 6128bd5 commit 44e36cb

File tree

4 files changed

+52
-18
lines changed

4 files changed

+52
-18
lines changed

doc/api/api_changes.rst

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,34 @@ API Changes
55

66
This chapter is a log of changes to matplotlib that affect the
77
outward-facing API. If updating matplotlib breaks your scripts, this
8-
list may help describe what changes may be necessary in your code.
8+
list may help describe what changes may be necessary in your code or
9+
help figure out possible sources of the changes you are experiencing.
10+
11+
For new features that were added to matplotlib, please see
12+
:ref:`whats-new`.
13+
14+
Changes in 1.1.x
15+
================
16+
17+
* In :meth:`~matplotlib.pyplot.imshow`, setting *interpolation* to 'nearest'
18+
will now always mean that the nearest-neighbor interpolation is performed.
19+
If you want the no-op interpolation to be performed, choose 'none'.
20+
21+
* There were errors in how the tri-functions were handling input parameters
22+
that had to be fixed. If your tri-plots are not working correctly anymore,
23+
or you were working around apparent mistakes, please see issue #203 in the
24+
github tracker. When in doubt, use kwargs.
25+
26+
* The 'symlog' scale had some bad behavior in previous versions. This has now
27+
been fixed and users should now be able to use it without frustrations.
28+
The fixes did result in some minor changes in appearance for some users who
29+
may have been depending on the bad behavior.
30+
31+
* There is now a common set of markers for all plotting functions. Previously,
32+
some markers existed only for :meth:`~matplotlib.pyplot.scatter` or just for
33+
:meth:`~matplotlib.pyplot.plot`. This is now no longer the case. This merge
34+
did result in a conflict. The string 'd' now means "thin diamond" while
35+
'D' will mean "regular diamond".
936

1037
Changes beyond 0.99.x
1138
=====================
@@ -50,7 +77,7 @@ Changes beyond 0.99.x
5077
* The :meth:`matplotlib.axes.Axes.hist` *color* kwarg now accepts
5178
a sequence of color specs to match a sequence of datasets.
5279

53-
* The :class:'~matplotlib.collections.EllipseCollection' has been
80+
* The :class:`~matplotlib.collections.EllipseCollection` has been
5481
changed in two ways:
5582

5683
+ There is a new *units* option, 'xy', that scales the ellipse with

doc/users/whats_new.rst

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Legend
5555

5656
Jae-Joon Lee has also been working on revamping how plot legends are handled
5757
in matplotlib. This has resulted in some immediate enhancements. First,
58-
legends for complex plots such as :func:`~matplotlib.pyplot.stem` plots
58+
legends for complex plots such as :meth:`~matplotlib.pyplot.stem` plots
5959
will now display correctly. Second, the 'best' placement of a legend has
6060
been improved in the presence of NANs.
6161

@@ -84,7 +84,7 @@ as 2D plotting, Ben Root has made several improvements to the
8484
* Ticker offset display added:
8585
.. plot:: mpl_examples/mplot3d/offset_demo.py
8686

87-
* :func:`~mpl_toolkits.mplot3d.axes3d.Axes3D.contourf`
87+
* :meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.contourf`
8888
gains *zdir* and *offset* kwargs. You can now do this:
8989
.. plot:: mpl_examples/mplot3d/contourf3d_demo2.py
9090

@@ -97,8 +97,8 @@ now been completely removed from matplotlib.
9797
Markers
9898
-------
9999

100-
The list of available markers for :func:`~matplotlib.pyplot.plot` and
101-
:func:`~matplotlib.pyplot.scatter` has now been merged. While they
100+
The list of available markers for :meth:`~matplotlib.pyplot.plot` and
101+
:meth:`~matplotlib.pyplot.scatter` has now been merged. While they
102102
were mostly similar, some markers existed for one function, but not
103103
the other. This merge did result in a conflict for the 'd' diamond
104104
marker. Now, 'd' will be interpreated to always mean "thin" diamond
@@ -111,30 +111,33 @@ Other improvements
111111

112112
* Unit support for polar axes and :func:`~matplotlib.axes.Axes.arrow`
113113

114-
* :class:`~matplotlib.projections.polar.PolarAxes` gains
115-
'set_theta_direction', 'set_theta_zero_direction' and
116-
'set_theta_offset' functions.
114+
* :class:`~matplotlib.projections.polar.PolarAxes` gains getters and setters for
115+
"theta_direction", and "theta_offset" to allow for theta to go in
116+
either the clock-wise or counter-clockwise direction and to specify where zero
117+
degrees should be placed.
118+
:meth:`~matplotlib.projections.polar.PolarAxes.set_theta_zero_location` is an
119+
added convenience function.
117120

118121
* Fixed error in argument handling for tri-functions such as
119-
:func:`~matplotlib.pyplot.tripcolor`
122+
:meth:`~matplotlib.pyplot.tripcolor`
120123

121-
* 'axes.labelweight' parameter added to rcParams.
124+
* ``axes.labelweight`` parameter added to rcParams.
122125

123-
* For :func:`~matplotlib.pyplot.imshow`, *interpolation='nearest'* will
124-
now always perform an interpolation. A 'none' option has been added to
126+
* For :meth:`~matplotlib.pyplot.imshow`, *interpolation='nearest'* will
127+
now always perform an interpolation. A "none" option has been added to
125128
indicate no interpolation at all.
126129

127130
* An error in the Hammer projection has been fixed.
128131

129-
* *clabel* for :func:`~matplotlib.pyplot.contour` now accepts a callable.
132+
* *clabel* for :meth:`~matplotlib.pyplot.contour` now accepts a callable.
130133
Thanks to Daniel Hyams for the original patch!
131134

132135
* Jae-Joon Lee added the :class:`~mpl_toolkits.axes_grid1.axes_divider.HBox`
133136
and :class:`~mpl_toolkits.axes_grid1.axes_divider.VBox` classes.
134137

135-
* Christoph Gohike improved memory usage in :func:`~matplotlib.pyplot.imshow`.
138+
* Christoph Gohike improved memory usage in :meth:`~matplotlib.pyplot.imshow`.
136139

137-
* :func:`~matplotlib.pyplot.scatter` now accepts empty inputs.
140+
* :meth:`~matplotlib.pyplot.scatter` now accepts empty inputs.
138141

139142
* The behavior for 'symlog' scale has been fixed, but this may result
140143
in some minor changes to existing plots.

lib/matplotlib/axes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6645,7 +6645,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
66456645
66466646
*interpolation*:
66476647
6648-
Acceptable values are *None*, 'nearest', 'bilinear',
6648+
Acceptable values are *None*, 'none', 'nearest', 'bilinear',
66496649
'bicubic', 'spline16', 'spline36', 'hanning', 'hamming',
66506650
'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian',
66516651
'bessel', 'mitchell', 'sinc', 'lanczos'
@@ -6654,6 +6654,10 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
66546654
``image.interpolation``. See also the *filternorm* and
66556655
*filterrad* parameters
66566656
6657+
If *interpolation* is 'none', then no interpolation is performed
6658+
on the Agg, ps and pdf backends. Other backends will fall back to
6659+
'nearest'.
6660+
66576661
*norm*: [ None | Normalize ]
66586662
An :class:`matplotlib.colors.Normalize` instance; if
66596663
*None*, default is ``normalization()``. This scales

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def get_interpolation(self):
439439
440440
One of 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning',
441441
'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian',
442-
'bessel', 'mitchell', 'sinc', 'lanczos',
442+
'bessel', 'mitchell', 'sinc', 'lanczos', or 'none'.
443443
"""
444444
return self._interpolation
445445

0 commit comments

Comments
 (0)