1Changes in 1.4.x 2================ 3 4Code changes 5------------ 6 7* A major refactoring of the axes module was made. The axes module has been 8 split into smaller modules: 9 10 - the ``_base`` module, which contains a new private ``_AxesBase`` class. 11 This class contains all methods except plotting and labelling methods. 12 - the `~matplotlib.axes` module, which contains the `.axes.Axes` class. 13 This class inherits from ``_AxesBase``, and contains all plotting and 14 labelling methods. 15 - the ``_subplot`` module, with all the classes concerning subplotting. 16 17There are a couple of things that do not exists in the `~matplotlib.axes` 18module's namespace anymore. If you use them, you need to import them from their 19original location: 20 21 - ``math`` -> ``import math`` 22 - ``ma`` -> ``from numpy import ma`` 23 - ``cbook`` -> ``from matplotlib import cbook`` 24 - ``docstring`` -> ``from matplotlib import docstring`` 25 - ``is_sequence_of_strings`` -> ``from matplotlib.cbook import is_sequence_of_strings`` 26 - ``is_string_like`` -> ``from matplotlib.cbook import is_string_like`` 27 - ``iterable`` -> ``from matplotlib.cbook import iterable`` 28 - ``itertools`` -> ``import itertools`` 29 - ``martist`` -> ``from matplotlib import artist as martist`` 30 - ``matplotlib`` -> ``import matplotlib`` 31 - ``mcoll`` -> ``from matplotlib import collections as mcoll`` 32 - ``mcolors`` -> ``from matplotlib import colors as mcolors`` 33 - ``mcontour`` -> ``from matplotlib import contour as mcontour`` 34 - ``mpatches`` -> ``from matplotlib import patches as mpatches`` 35 - ``mpath`` -> ``from matplotlib import path as mpath`` 36 - ``mquiver`` -> ``from matplotlib import quiver as mquiver`` 37 - ``mstack`` -> ``from matplotlib import stack as mstack`` 38 - ``mstream`` -> ``from matplotlib import stream as mstream`` 39 - ``mtable`` -> ``from matplotlib import table as mtable`` 40 41* As part of the refactoring to enable Qt5 support, the module 42 ``matplotlib.backends.qt4_compat`` was renamed to 43 ``matplotlib.backends.qt_compat``. ``qt4_compat`` is deprecated in 1.4 and 44 will be removed in 1.5. 45 46* The :func:`~matplotlib.pyplot.errorbar` method has been changed such that 47 the upper and lower limits (*lolims*, *uplims*, *xlolims*, *xuplims*) now 48 point in the correct direction. 49 50* The *fmt* kwarg for :func:`~matplotlib.pyplot.errorbar` now supports 51 the string 'none' to suppress drawing of a line and markers; use 52 of the *None* object for this is deprecated. The default *fmt* 53 value is changed to the empty string (''), so the line and markers 54 are governed by the :func:`~matplotlib.pyplot.plot` defaults. 55 56* A bug has been fixed in the path effects rendering of fonts, which now means 57 that the font size is consistent with non-path effect fonts. See 58 https://github.com/matplotlib/matplotlib/issues/2889 for more detail. 59 60* The Sphinx extensions ``ipython_directive`` and 61 ``ipython_console_highlighting`` have been moved to the IPython 62 project itself. While they remain in Matplotlib for this release, 63 they have been deprecated. Update your extensions in :file:`conf.py` to 64 point to ``IPython.sphinxext.ipython_directive`` instead of 65 ``matplotlib.sphinxext.ipython_directive``. 66 67* In ``matplotlib.finance``, almost all functions have been deprecated 68 and replaced with a pair of functions name ``*_ochl`` and ``*_ohlc``. 69 The former is the 'open-close-high-low' order of quotes used 70 previously in this module, and the latter is the 71 'open-high-low-close' order that is standard in finance. 72 73* For consistency the ``face_alpha`` keyword to 74 :class:`matplotlib.patheffects.SimplePatchShadow` has been deprecated in 75 favour of the ``alpha`` keyword. Similarly, the keyword ``offset_xy`` is now 76 named ``offset`` across all :class:`~matplotlib.patheffects.AbstractPathEffect`\ s. 77 ``matplotlib.patheffects._Base`` has 78 been renamed to :class:`matplotlib.patheffects.AbstractPathEffect`. 79 ``matplotlib.patheffect.ProxyRenderer`` has been renamed to 80 :class:`matplotlib.patheffects.PathEffectRenderer` and is now a full 81 RendererBase subclass. 82 83* The artist used to draw the outline of a `.Figure.colorbar` has been changed 84 from a `matplotlib.lines.Line2D` to `matplotlib.patches.Polygon`, thus 85 `.colorbar.ColorbarBase.outline` is now a `matplotlib.patches.Polygon` 86 object. 87 88* The legend handler interface has changed from a callable, to any object 89 which implements the ``legend_artists`` method (a deprecation phase will 90 see this interface be maintained for v1.4). See 91 :doc:`/tutorials/intermediate/legend_guide` for further details. Further legend changes 92 include: 93 94 * ``matplotlib.axes.Axes._get_legend_handles`` now returns a generator of 95 handles, rather than a list. 96 97 * The :func:`~matplotlib.pyplot.legend` function's *loc* positional 98 argument has been deprecated. Use the *loc* keyword argument instead. 99 100* The :rc:`savefig.transparent` has been added to control 101 default transparency when saving figures. 102 103* Slightly refactored the `.Annotation` family. The text location in 104 `.Annotation` is now entirely handled by the underlying `.Text` 105 object so ``.set_position`` works as expected. The attributes *xytext* and 106 *textcoords* have been deprecated in favor of *xyann* and *anncoords* so 107 that `.Annotation` and `.AnnotationBbox` can share a common sensibly named 108 api for getting/setting the location of the text or box. 109 110 - *xyann* -> set the location of the annotation 111 - *xy* -> set where the arrow points to 112 - *anncoords* -> set the units of the annotation location 113 - *xycoords* -> set the units of the point location 114 - ``set_position()`` -> `.Annotation` only set location of annotation 115 116* `matplotlib.mlab.specgram`, `matplotlib.mlab.psd`, `matplotlib.mlab.csd`, 117 `matplotlib.mlab.cohere`, ``matplotlib.mlab.cohere_pairs``, 118 `matplotlib.pyplot.specgram`, `matplotlib.pyplot.psd`, 119 `matplotlib.pyplot.csd`, and `matplotlib.pyplot.cohere` now raise 120 ValueError where they previously raised AssertionError. 121 122* For `matplotlib.mlab.psd`, `matplotlib.mlab.csd`, 123 `matplotlib.mlab.cohere`, ``matplotlib.mlab.cohere_pairs``, 124 `matplotlib.pyplot.specgram`, `matplotlib.pyplot.psd`, 125 `matplotlib.pyplot.csd`, and `matplotlib.pyplot.cohere`, in cases 126 where a shape (n, 1) array is returned, this is now converted to a (n, ) 127 array. Previously, (n, m) arrays were averaged to an (n, ) array, but 128 (n, 1) arrays were returned unchanged. This change makes the dimensions 129 consistent in both cases. 130 131* Added the :rc:`axes.formatter.useoffset` to control the default value 132 of *useOffset* in `.ticker.ScalarFormatter` 133 134* Added `.Formatter` sub-class `.StrMethodFormatter` which 135 does the exact same thing as `.FormatStrFormatter`, but for new-style 136 formatting strings. 137 138* Deprecated ``matplotlib.testing.image_util`` and the only function within, 139 ``matplotlib.testing.image_util.autocontrast``. These will be removed 140 completely in v1.5.0. 141 142* The ``fmt`` argument of :meth:`~matplotlib.axes.Axes.plot_date` has been 143 changed from ``bo`` to just ``o``, so color cycling can happen by default. 144 145* Removed the class ``FigureManagerQTAgg`` and deprecated 146 ``NavigationToolbar2QTAgg`` which will be removed in 1.5. 147 148* Removed formerly public (non-prefixed) attributes ``rect`` and 149 ``drawRect`` from ``FigureCanvasQTAgg``; they were always an 150 implementation detail of the (preserved) ``drawRectangle()`` function. 151 152* The function signatures of `.tight_bbox.adjust_bbox` and 153 `.tight_bbox.process_figure_for_rasterizing` have been changed. A new 154 *fixed_dpi* parameter allows for overriding the ``figure.dpi`` setting 155 instead of trying to deduce the intended behaviour from the file format. 156 157* Added support for horizontal/vertical axes padding to 158 `mpl_toolkits.axes_grid1.axes_grid.ImageGrid` --- argument *axes_pad* can now 159 be tuple-like if separate axis padding is required. 160 The original behavior is preserved. 161 162* Added support for skewed transforms to `matplotlib.transforms.Affine2D`, 163 which can be created using the `~.Affine2D.skew` and `~.Affine2D.skew_deg` 164 methods. 165 166* Added clockwise parameter to control sectors direction in `.axes.Axes.pie` 167 168* In `matplotlib.lines.Line2D` the *markevery* functionality has been extended. 169 Previously an integer start-index and stride-length could be specified using 170 either a two-element-list or a two-element-tuple. Now this can only be done 171 using a two-element-tuple. If a two-element-list is used then it will be 172 treated as NumPy fancy indexing and only the two markers corresponding to the 173 given indexes will be shown. 174 175* Removed *prop* keyword argument from 176 `mpl_toolkits.axes_grid1.anchored_artists.AnchoredSizeBar` call. It was 177 passed through to the base-class ``__init__`` and is only used for setting 178 padding. Now *fontproperties* (which is what is really used to set the font 179 properties of `.AnchoredSizeBar`) is passed through in place of *prop*. If 180 *fontproperties* is not passed in, but *prop* is, then *prop* is used in 181 place of *fontproperties*. If both are passed in, *prop* is silently 182 ignored. 183 184 185* The use of the index 0 in `.pyplot.subplot` and related commands is 186 deprecated. Due to a lack of validation, calling ``plt.subplots(2, 2, 0)`` 187 does not raise an exception, but puts an axes in the _last_ 188 position. This is due to the indexing in subplot being 1-based (to 189 mirror MATLAB) so before indexing into the `.GridSpec` object used to 190 determine where the axes should go, 1 is subtracted off. Passing in 191 0 results in passing -1 to `.GridSpec` which results in getting the 192 last position back. Even though this behavior is clearly wrong and 193 not intended, we are going through a deprecation cycle in an 194 abundance of caution that any users are exploiting this 'feature'. 195 The use of 0 as an index will raise a warning in 1.4 and an 196 exception in 1.5. 197 198* Clipping is now off by default on offset boxes. 199 200* Matplotlib now uses a less-aggressive call to ``gc.collect(1)`` when 201 closing figures to avoid major delays with large numbers of user objects 202 in memory. 203 204* The default clip value of *all* pie artists now defaults to ``False``. 205 206 207Code removal 208------------ 209 210* Removed ``mlab.levypdf``. The code raised a NumPy error (and has for 211 a long time) and was not the standard form of the Levy distribution. 212 ``scipy.stats.levy`` should be used instead 213