diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index 3e52ac9c7caa..31f6df4f20eb 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -10,6 +10,293 @@ out what caused the breakage and how to fix it by updating your code. For new features that were added to Matplotlib, please see :ref:`whats-new`. +API Changes in 2.1.0 +==================== + +`mpl_toolkits.axes_grid` has been deprecated +-------------------------------------------- + +All functionallity from `mpl_toolkits.axes_grid` can be found in either +`mpl_toolkits.axes_grid1` or `mpl_toolkits.axisartist`. Axes classes from +`mpl_toolkits.axes_grid` based on `Axis` from `mpl_toolkits.axisartist` can be +found in `mpl_toolkits.axisartist` + + +Improved toggling of the axes grids +----------------------------------- + +The `g` key binding now switches the states of the `x` and `y` grids +independently (by cycling through all four on/off combinations). + +The new `G` key binding switches the states of the minor grids. + +Both bindings are disabled if only a subset of the grid lines (in either +direction) is visible, to avoid making irreversible changes to the figure. + + +Removal of warning on empty legends +----------------------------------- + +``plt.legend`` used to issue a warning when no labeled artist could be +found. This warning has been removed. + + +More accurate legend autopositioning +------------------------------------ + +Automatic positioning of legends now prefers using the area surrounded +by a `Line2D` rather than placing the legend over the line itself. + + +Cleanup of stock sample data +---------------------------- + +The sample data of stocks has been cleaned up to remove redundancies and +increase portability. The ``AAPL.dat.gz``, ``INTC.dat.gz`` and ``aapl.csv`` +files have been removed entirely and will also no longer be available from +`matplotlib.cbook.get_sample_data`. If a CSV file is required, we suggest using +the ``msft.csv`` that continues to be shipped in the sample data. If a NumPy +binary file is acceptable, we suggest using one of the following two new files. +The ``aapl.npy.gz`` and ``goog.npy`` files have been replaced by ``aapl.npz`` +and ``goog.npz``, wherein the first column's type has changed from +`datetime.date` to `np.datetime64` for better portability across Python +versions. Note that matplotlib does not fully support `np.datetime64` as yet. + + +Updated qhull to 2015.2 +----------------------- + +The version of qhull shipped with Matplotlib, which is used for +Delaunay triangulation, has been updated from version 2012.1 to +2015.2. + + +Use backports.functools_lru_cache instead of functools32 +-------------------------------------------------------- + +It's better maintained and more widely used (by pylint, jaraco, etc). + + +`cbook.is_numlike` only performs an instance check, `cbook.is_string_like` is deprecated +---------------------------------------------------------------------------------------- + +`cbook.is_numlike` now only checks that its argument is an instance of +``(numbers.Number, np.Number)``. In particular, this means that arrays are now +not num-like. + +`cbook.is_string_like` and `cbook.is_sequence_of_strings` have been +deprecated. Use ``isinstance(obj, six.string_types)`` and ``iterable(obj) and +all(isinstance(o, six.string_types) for o in obj)`` instead. + + +Elliptical arcs now drawn between correct angles +------------------------------------------------ + +The `matplotlib.patches.Arc` patch is now correctly drawn between the given +angles. + +Previously a circular arc was drawn and then stretched into an ellipse, +so the resulting arc did not lie between *theta1* and *theta2*. + + +Changes to PDF backend methods +------------------------------ + +The methods `embedTeXFont` and `tex_font_mapping` of +`matplotlib.backend_pdf.PdfFile` have been removed. +It is unlikely that external users would have called +these methods, which are related to the font system +internal to the PDF backend. + + +``-d$backend`` no longer sets the backend +----------------------------------------- + +It is no longer possible to set the backend by passing ``-d$backend`` at the command line. Use the ``MPLBACKEND`` environment variable instead. + + +Path.intersects_bbox always treats the bounding box as filled +------------------------------------------------------------- + +Previously, when ``Path.intersects_bbox`` was called with ``filled`` set to +``False``, it would treat both the path and the bounding box as unfilled. This +behavior was not well documented and it is usually not the desired behavior, +since bounding boxes are used to represent more complex shapes located inside +the bounding box. This behavior has now been changed: when ``filled`` is +``False``, the path will be treated as unfilled, but the bounding box is still +treated as filled. The old behavior was arguably an implementation bug. + +When ``Path.intersects_bbox`` is called with ``filled`` set to ``True`` +(the default value), there is no change in behavior. For those rare cases where +``Path.intersects_bbox`` was called with ``filled`` set to ``False`` and where +the old behavior is actually desired, the suggested workaround is to call +``Path.intersects_path`` with a rectangle as the path:: + + from matplotlib.path import Path + from matplotlib.transforms import Bbox, BboxTransformTo + rect = Path.unit_rectangle().transformed(BboxTransformTo(bbox)) + result = path.intersects_path(rect, filled=False) + + +Removed resolution kwarg from PolarAxes +--------------------------------------- + +The kwarg `resolution` of `matplotlib.projections.polar.PolarAxes` has been +removed. It has triggered a deprecation warning of being with no effect +beyond version `0.98.x`. + + +Deprecation of `GraphicsContextBase`\'s ``linestyle`` property. +--------------------------------------------------------------- + +The ``GraphicsContextBase.get_linestyle`` and +``GraphicsContextBase.set_linestyle`` methods, which effectively had no effect, +have been deprecated. + + +NavigationToolbar2.dynamic_update is deprecated +----------------------------------------------- + +Use `FigureCanvas.draw_idle` instead. + + +Unique identifier added to `RendererBase` classes +------------------------------------------------- + +Since ``id()`` is not guaranteed to be unique between objects that exist at +different times, a new private property ``_uid`` has been added to +`RendererBase` which is used along with the renderer's ``id()`` to cache +certain expensive operations. + +If a custom renderer does not subclass `RendererBase` or `MixedModeRenderer`, +it is not required to implement this ``_uid`` property, but this may produce +incorrect behavior when the renderers' ``id()`` clashes. + + +WX no longer calls generates ``IdleEvent`` events or calls ``idle_event`` +------------------------------------------------------------------------- + +Removed unused private method ``_onIdle`` from ``FigureCanvasWx``. + +The ``IdleEvent`` class and ``FigureCanvasBase.idle_event`` method +will be removed in 2.2 + + +Correct scaling of :func:`magnitude_spectrum()` +----------------------------------------------- + +The functions :func:`matplotlib.mlab.magnitude_spectrum()` and :func:`matplotlib.pyplot.magnitude_spectrum()` implicitly assumed the sum +of windowing function values to be one. In Matplotlib and Numpy the +standard windowing functions are scaled to have maximum value of one, +which usually results in a sum of the order of n/2 for a n-point +signal. Thus the amplitude scaling :func:`magnitude_spectrum()` was +off by that amount when using standard windowing functions (`Bug 8417 +`_ ). Now the +behavior is consistent with :func:`matplotlib.pyplot.psd()` and +:func:`scipy.signal.welch()`. The following example demonstrates the +new and old scaling:: + + import matplotlib.pyplot as plt + import numpy as np + + tau, n = 10, 1024 # 10 second signal with 1024 points + T = tau/n # sampling interval + t = np.arange(n)*T + + a = 4 # amplitude + x = a*np.sin(40*np.pi*t) # 20 Hz sine with amplitude a + + # New correct behavior: Amplitude at 20 Hz is a/2 + plt.magnitude_spectrum(x, Fs=1/T, sides='onesided', scale='linear') + + # Original behavior: Amplitude at 20 Hz is (a/2)*(n/2) for a Hanning window + w = np.hanning(n) # default window is a Hanning window + plt.magnitude_spectrum(x*np.sum(w), Fs=1/T, sides='onesided', scale='linear') + + + +Default behavior of log scales changed to mask <= 0 values +---------------------------------------------------------- + +Calling `matplotlib.axes.Axes.set_xscale` or `matplotlib.axes.Axes.set_yscale` +now uses 'mask' as the default method to handle invalid values (as opposed to +'clip'). This means that any values <= 0 on a log scale will not be shown. + +Previously they were clipped to a very small number and shown. + + +Code Removal +------------ + +matplotlib.delaunay +~~~~~~~~~~~~~~~~~~~ +Remove the delaunay triangulation code which is now handled by Qhull +via ``matplotlib.tri`` + + +qt4_compat.py +~~~~~~~~~~~~~ +Moved to ``qt_compat.py``. Renamed because it now handles Qt5 as well. + + +Deprecated methods +~~~~~~~~~~~~~~~~~~ + +The ``GraphicsContextBase.set_graylevel``, ``FigureCanvasBase.onHilite`` and +``mpl_toolkits.axes_grid1.mpl_axes.Axes.toggle_axisline`` methods have been +removed. + +The ``ArtistInspector.findobj`` method, which was never working due to the lack +of a ``get_children`` method, has been removed. + +The deprecated ``point_in_path``, ``get_path_extents``, +``point_in_path_collection``, ``path_intersects_path``, +``convert_path_to_polygons``, ``cleanup_path`` and ``clip_path_to_rect`` +functions in the ``matplotlib.path`` module have been removed. Their +functionality remains exposed as methods on the ``Path`` class. + + +`Axes.set_aspect("normal")` +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Support for setting an ``Axes``' aspect to ``"normal"`` has been removed, in +favor of the synonym ``"auto"``. + + +``shading`` kwarg to ``pcolor`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``shading`` kwarg to ``pcolor`` has been removed. Set ``edgecolors`` +appropriately instead. + + +Removed internal functions +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``matplotlib.backends.backend_ps.seq_allequal`` function has been removed. +Use ``np.array_equal`` instead. + +The deprecated ``matplotlib.rcsetup.validate_maskedarray``, +``matplotlib.rcsetup.deprecate_savefig_extension`` and +``matplotlib.rcsetup.validate_tkpythoninspect`` functions, and associated +``savefig.extension`` and ``tk.pythoninspect`` rcparams entries have been +removed. + + +Deprecations +------------ + +- `matplotlib.testing.noseclasses` is deprecated and will be removed in 2.3 + + +Functions removed from the `lines` module +----------------------------------------- + +The `matplotlib.lines` module no longer imports the `pts_to_prestep`, +`pts_to_midstep` and `pts_to_poststep` functions from the `matplotlib.cbook` +module. + + API Changes in 2.0.1 ==================== diff --git a/doc/api/api_changes/2015-12-30-JHN.rst b/doc/api/api_changes/2015-12-30-JHN.rst deleted file mode 100644 index 64b826c26ef7..000000000000 --- a/doc/api/api_changes/2015-12-30-JHN.rst +++ /dev/null @@ -1,7 +0,0 @@ -`mpl_toolkits.axes_grid` has been deprecated -```````````````````````````````````````````` - -All functionallity from `mpl_toolkits.axes_grid` can be found in either -`mpl_toolkits.axes_grid1` or `mpl_toolkits.axisartist`. Axes classes from -`mpl_toolkits.axes_grid` based on `Axis` from `mpl_toolkits.axisartist` can be -found in `mpl_toolkits.axisartist` diff --git a/doc/api/api_changes/2016-08-02-toggle-grids.rst b/doc/api/api_changes/2016-08-02-toggle-grids.rst deleted file mode 100644 index fb70385afd0d..000000000000 --- a/doc/api/api_changes/2016-08-02-toggle-grids.rst +++ /dev/null @@ -1,9 +0,0 @@ -Improved toggling of the axes grids ------------------------------------ -The `g` key binding now switches the states of the `x` and `y` grids -independently (by cycling through all four on/off combinations). - -The new `G` key binding switches the states of the minor grids. - -Both bindings are disabled if only a subset of the grid lines (in either -direction) is visible, to avoid making irreversible changes to the figure. diff --git a/doc/api/api_changes/2016-09-28-AL_emptylegend.rst b/doc/api/api_changes/2016-09-28-AL_emptylegend.rst deleted file mode 100644 index 00c78cf6b95a..000000000000 --- a/doc/api/api_changes/2016-09-28-AL_emptylegend.rst +++ /dev/null @@ -1,5 +0,0 @@ -Removal of warning on empty legends -``````````````````````````````````` - -``plt.legend`` used to issue a warning when no labeled artist could be found. -This warning has been removed. diff --git a/doc/api/api_changes/2016-12-14-AL_legend-autoposition.rst b/doc/api/api_changes/2016-12-14-AL_legend-autoposition.rst deleted file mode 100644 index babbdbfe17c5..000000000000 --- a/doc/api/api_changes/2016-12-14-AL_legend-autoposition.rst +++ /dev/null @@ -1,4 +0,0 @@ -More accurate legend autopositioning -```````````````````````````````````` - -Automatic positioning of legends now prefers using the area surrounded by a `Line2D` rather than placing the legend over the line itself. diff --git a/doc/api/api_changes/2016-12-19-ESDA_sample_data.rst b/doc/api/api_changes/2016-12-19-ESDA_sample_data.rst deleted file mode 100644 index 9b5f8f974b50..000000000000 --- a/doc/api/api_changes/2016-12-19-ESDA_sample_data.rst +++ /dev/null @@ -1,13 +0,0 @@ -Cleanup of stock sample data -```````````````````````````` - -The sample data of stocks has been cleaned up to remove redundancies and -increase portability. The ``AAPL.dat.gz``, ``INTC.dat.gz`` and ``aapl.csv`` -files have been removed entirely and will also no longer be available from -`matplotlib.cbook.get_sample_data`. If a CSV file is required, we suggest using -the ``msft.csv`` that continues to be shipped in the sample data. If a NumPy -binary file is acceptable, we suggest using one of the following two new files. -The ``aapl.npy.gz`` and ``goog.npy`` files have been replaced by ``aapl.npz`` -and ``goog.npz``, wherein the first column's type has changed from -`datetime.date` to `np.datetime64` for better portability across Python -versions. Note that matplotlib does not fully support `np.datetime64` as yet. diff --git a/doc/api/api_changes/2017-01-06-IT.rst b/doc/api/api_changes/2017-01-06-IT.rst deleted file mode 100644 index 93d72c9dc923..000000000000 --- a/doc/api/api_changes/2017-01-06-IT.rst +++ /dev/null @@ -1,6 +0,0 @@ -Updated qhull to 2015.2 -``````````````````````` - -The version of qhull shipped with Matplotlib, which is used for -Delaunay triangulation, has been updated from version 2012.1 to -2015.2. diff --git a/doc/api/api_changes/2017-01-19-BFLC.rst b/doc/api/api_changes/2017-01-19-BFLC.rst deleted file mode 100644 index ed634340897e..000000000000 --- a/doc/api/api_changes/2017-01-19-BFLC.rst +++ /dev/null @@ -1,4 +0,0 @@ -Use backports.functools_lru_cache instead of functools32 -```````````````````````````````````````````````````````` - -It's better maintained and more widely used (by pylint, jaraco, etc). diff --git a/doc/api/api_changes/2017-01-30-AL_is_numlike_stringlike.rst b/doc/api/api_changes/2017-01-30-AL_is_numlike_stringlike.rst deleted file mode 100644 index 131003275271..000000000000 --- a/doc/api/api_changes/2017-01-30-AL_is_numlike_stringlike.rst +++ /dev/null @@ -1,10 +0,0 @@ -`cbook.is_numlike` only performs an instance check, `cbook.is_string_like` is deprecated -```````````````````````````````````````````````````````````````````````````````````````` - -`cbook.is_numlike` now only checks that its argument is an instance of -``(numbers.Number, np.Number)``. In particular, this means that arrays are now -not num-like. - -`cbook.is_string_like` and `cbook.is_sequence_of_strings` have been -deprecated. Use ``isinstance(obj, six.string_types)`` and ``iterable(obj) and -all(isinstance(o, six.string_types) for o in obj)`` instead. diff --git a/doc/api/api_changes/2017-02-10-DS_elliptical_arc_angle.rst b/doc/api/api_changes/2017-02-10-DS_elliptical_arc_angle.rst deleted file mode 100644 index 1570a17d9549..000000000000 --- a/doc/api/api_changes/2017-02-10-DS_elliptical_arc_angle.rst +++ /dev/null @@ -1,8 +0,0 @@ -Elliptical arcs now drawn between correct angles -```````````````````````````````````````````````` - -The `matplotlib.patches.Arc` patch is now correctly drawn between the given -angles. - -Previously a circular arc was drawn and then stretched into an ellipse, -so the resulting arc did not lie between *theta1* and *theta2*. diff --git a/doc/api/api_changes/2017-02-12-JKS.rst b/doc/api/api_changes/2017-02-12-JKS.rst deleted file mode 100644 index 490f1ea1e87c..000000000000 --- a/doc/api/api_changes/2017-02-12-JKS.rst +++ /dev/null @@ -1,8 +0,0 @@ -Changes to PDF backend methods -`````````````````````````````` - -The methods `embedTeXFont` and `tex_font_mapping` of -`matplotlib.backend_pdf.PdfFile` have been removed. -It is unlikely that external users would have called -these methods, which are related to the font system -internal to the PDF backend. diff --git a/doc/api/api_changes/2017-02-25-AL_dbackend.rst b/doc/api/api_changes/2017-02-25-AL_dbackend.rst deleted file mode 100644 index f2e2e04f5540..000000000000 --- a/doc/api/api_changes/2017-02-25-AL_dbackend.rst +++ /dev/null @@ -1,4 +0,0 @@ -``-d$backend`` no longer sets the backend -````````````````````````````````````````` - -It is no longer possible to set the backend by passing ``-d$backend`` at the command line. Use the ``MPLBACKEND`` environment variable instead. diff --git a/doc/api/api_changes/2017-02-26-MB_intersects_bbox.rst b/doc/api/api_changes/2017-02-26-MB_intersects_bbox.rst deleted file mode 100644 index ed866b219362..000000000000 --- a/doc/api/api_changes/2017-02-26-MB_intersects_bbox.rst +++ /dev/null @@ -1,21 +0,0 @@ -Path.intersects_bbox always treats the bounding box as filled -````````````````````````````````````````````````````````````` - -Previously, when ``Path.intersects_bbox`` was called with ``filled`` set to -``False``, it would treat both the path and the bounding box as unfilled. This -behavior was not well documented and it is usually not the desired behavior, -since bounding boxes are used to represent more complex shapes located inside -the bounding box. This behavior has now been changed: when ``filled`` is -``False``, the path will be treated as unfilled, but the bounding box is still -treated as filled. The old behavior was arguably an implementation bug. - -When ``Path.intersects_bbox`` is called with ``filled`` set to ``True`` -(the default value), there is no change in behavior. For those rare cases where -``Path.intersects_bbox`` was called with ``filled`` set to ``False`` and where -the old behavior is actually desired, the suggested workaround is to call -``Path.intersects_path`` with a rectangle as the path:: - - from matplotlib.path import Path - from matplotlib.transforms import Bbox, BboxTransformTo - rect = Path.unit_rectangle().transformed(BboxTransformTo(bbox)) - result = path.intersects_path(rect, filled=False) diff --git a/doc/api/api_changes/2017-05-19-resolution_polar_axes.rst b/doc/api/api_changes/2017-05-19-resolution_polar_axes.rst deleted file mode 100644 index d049b2a7b34a..000000000000 --- a/doc/api/api_changes/2017-05-19-resolution_polar_axes.rst +++ /dev/null @@ -1,6 +0,0 @@ -Removed resolution kwarg from PolarAxes -``````````````````````````````````````` - -The kwarg `resolution` of `matplotlib.projections.polar.PolarAxes` has been -removed. It has triggered a deprecation warning of being with no effect -beyond version `0.98.x`. diff --git a/doc/api/api_changes/2017-05-28-AL_graphicscontext_linestyle.rst b/doc/api/api_changes/2017-05-28-AL_graphicscontext_linestyle.rst deleted file mode 100644 index 2091a8152d19..000000000000 --- a/doc/api/api_changes/2017-05-28-AL_graphicscontext_linestyle.rst +++ /dev/null @@ -1,6 +0,0 @@ -Deprecation of `GraphicsContextBase`\'s ``linestyle`` property. -``````````````````````````````````````````````````````````````` - -The ``GraphicsContextBase.get_linestyle`` and -``GraphicsContextBase.set_linestyle`` methods, which effectively had no effect, -have been deprecated. diff --git a/doc/api/api_changes/2017-05-31-AL_dynamic_update.rst b/doc/api/api_changes/2017-05-31-AL_dynamic_update.rst deleted file mode 100644 index 565a60a4cef7..000000000000 --- a/doc/api/api_changes/2017-05-31-AL_dynamic_update.rst +++ /dev/null @@ -1,4 +0,0 @@ -NavigationToolbar2.dynamic_update is deprecated -``````````````````````````````````````````````` - -Use `FigureCanvas.draw_idle` instead. diff --git a/doc/api/api_changes/2017-06-03-ES_unique_renderer.rst b/doc/api/api_changes/2017-06-03-ES_unique_renderer.rst deleted file mode 100644 index 3dd58e0a16f3..000000000000 --- a/doc/api/api_changes/2017-06-03-ES_unique_renderer.rst +++ /dev/null @@ -1,11 +0,0 @@ -Unique identifier added to `RendererBase` classes -````````````````````````````````````````````````` - -Since ``id()`` is not guaranteed to be unique between objects that exist at -different times, a new private property ``_uid`` has been added to -`RendererBase` which is used along with the renderer's ``id()`` to cache -certain expensive operations. - -If a custom renderer does not subclass `RendererBase` or `MixedModeRenderer`, -it is not required to implement this ``_uid`` property, but this may produce -incorrect behavior when the renderers' ``id()`` clashes. diff --git a/doc/api/api_changes/2017-06-06-AL_wxidle.rst b/doc/api/api_changes/2017-06-06-AL_wxidle.rst deleted file mode 100644 index d34171d01e18..000000000000 --- a/doc/api/api_changes/2017-06-06-AL_wxidle.rst +++ /dev/null @@ -1,7 +0,0 @@ -WX no longer calls generates ``IdleEvent`` events or calls ``idle_event`` -````````````````````````````````````````````````````````````````````````` - -Removed unused private method ``_onIdle`` from ``FigureCanvasWx``. - -The ``IdleEvent`` class and ``FigureCanvasBase.idle_event`` method -will be removed in 2.2 diff --git a/doc/api/api_changes/2017-06-11-DB_magnitude_spectrum.rst b/doc/api/api_changes/2017-06-11-DB_magnitude_spectrum.rst deleted file mode 100644 index 67efbb580a99..000000000000 --- a/doc/api/api_changes/2017-06-11-DB_magnitude_spectrum.rst +++ /dev/null @@ -1,31 +0,0 @@ -Correct scaling of :func:`magnitude_spectrum()` -``````````````````````````````````````````````` - -The functions :func:`matplotlib.mlab.magnitude_spectrum()` and :func:`matplotlib.pyplot.magnitude_spectrum()` implicitly assumed the sum -of windowing function values to be one. In Matplotlib and Numpy the -standard windowing functions are scaled to have maximum value of one, -which usually results in a sum of the order of n/2 for a n-point -signal. Thus the amplitude scaling :func:`magnitude_spectrum()` was -off by that amount when using standard windowing functions (`Bug 8417 -`_ ). Now the -behavior is consistent with :func:`matplotlib.pyplot.psd()` and -:func:`scipy.signal.welch()`. The following example demonstrates the -new and old scaling:: - - import matplotlib.pyplot as plt - import numpy as np - - tau, n = 10, 1024 # 10 second signal with 1024 points - T = tau/n # sampling interval - t = np.arange(n)*T - - a = 4 # amplitude - x = a*np.sin(40*np.pi*t) # 20 Hz sine with amplitude a - - # New correct behavior: Amplitude at 20 Hz is a/2 - plt.magnitude_spectrum(x, Fs=1/T, sides='onesided', scale='linear') - - # Original behavior: Amplitude at 20 Hz is (a/2)*(n/2) for a Hanning window - w = np.hanning(n) # default window is a Hanning window - plt.magnitude_spectrum(x*np.sum(w), Fs=1/T, sides='onesided', scale='linear') - diff --git a/doc/api/api_changes/2017-07-03-DS-logscale_masked.rst b/doc/api/api_changes/2017-07-03-DS-logscale_masked.rst deleted file mode 100644 index 5de845f90a7c..000000000000 --- a/doc/api/api_changes/2017-07-03-DS-logscale_masked.rst +++ /dev/null @@ -1,8 +0,0 @@ -Default behavior of log scales changed to mask <= 0 values -`````````````````````````````````````````````````````````` - -Calling `matplotlib.axes.Axes.set_xscale` or `matplotlib.axes.Axes.set_yscale` -now uses 'mask' as the default method to handle invalid values (as opposed to -'clip'). This means that any values <= 0 on a log scale will not be shown. - -Previously they were clipped to a very small number and shown. diff --git a/doc/api/api_changes/README.rst b/doc/api/api_changes/README.rst index f317cab10d41..f59c3cb6edc4 100644 --- a/doc/api/api_changes/README.rst +++ b/doc/api/api_changes/README.rst @@ -3,7 +3,10 @@ a file in this folder with the name :file:`YYYY-MM-DD-[initials].rst` (ex :file:`2014-07-31-TAC.rst`) with contents following the form: :: Brief description of change - ``````````````````````````` + --------------------------- Long description of change, justification, and work-arounds to maintain old behavior (if any). + + +If you need more heading levels, please use ``~~~~`` and ``++++``. diff --git a/doc/api/api_changes/code_removal.rst b/doc/api/api_changes/code_removal.rst deleted file mode 100644 index 879fa1bf5a60..000000000000 --- a/doc/api/api_changes/code_removal.rst +++ /dev/null @@ -1,56 +0,0 @@ -Code Removal -```````````` - -matplotlib.delaunay -------------------- -Remove the delaunay triangulation code which is now handled by Qhull -via ``matplotlib.tri`` - - -qt4_compat.py -------------- -Moved to ``qt_compat.py``. Renamed because it now handles Qt5 as well. - - -Deprecated methods ------------------- - -The ``GraphicsContextBase.set_graylevel``, ``FigureCanvasBase.onHilite`` and -``mpl_toolkits.axes_grid1.mpl_axes.Axes.toggle_axisline`` methods have been -removed. - -The ``ArtistInspector.findobj`` method, which was never working due to the lack -of a ``get_children`` method, has been removed. - -The deprecated ``point_in_path``, ``get_path_extents``, -``point_in_path_collection``, ``path_intersects_path``, -``convert_path_to_polygons``, ``cleanup_path`` and ``clip_path_to_rect`` -functions in the ``matplotlib.path`` module have been removed. Their -functionality remains exposed as methods on the ``Path`` class. - - -`Axes.set_aspect("normal")` ---------------------------- - -Support for setting an ``Axes``' aspect to ``"normal"`` has been removed, in -favor of the synonym ``"auto"``. - - -``shading`` kwarg to ``pcolor`` -------------------------------- - -The ``shading`` kwarg to ``pcolor`` has been removed. Set ``edgecolors`` -appropriately instead. - - -Removed internal functions --------------------------- - -The ``matplotlib.backends.backend_ps.seq_allequal`` function has been removed. -Use ``np.array_equal`` instead. - -The deprecated ``matplotlib.rcsetup.validate_maskedarray``, -``matplotlib.rcsetup.deprecate_savefig_extension`` and -``matplotlib.rcsetup.validate_tkpythoninspect`` functions, and associated -``savefig.extension`` and ``tk.pythoninspect`` rcparams entries have been -removed. diff --git a/doc/api/api_changes/deprecations.rst b/doc/api/api_changes/deprecations.rst deleted file mode 100644 index a7b53d663c75..000000000000 --- a/doc/api/api_changes/deprecations.rst +++ /dev/null @@ -1,4 +0,0 @@ -Deprecations -```````````` - -- `matplotlib.testing.noseclasses` is deprecated and will be removed in 2.3 diff --git a/doc/api/api_changes/lines_removed_api.rst b/doc/api/api_changes/lines_removed_api.rst deleted file mode 100644 index c8b32ebb29c5..000000000000 --- a/doc/api/api_changes/lines_removed_api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Functions removed from the `lines` module -````````````````````````````````````````` - -The `matplotlib.lines` module no longer imports the `pts_to_prestep`, -`pts_to_midstep` and `pts_to_poststep` functions from the `matplotlib.cbook` -module. diff --git a/doc/users/next_whats_new/2015-10-31_TransformedPatchPath.rst b/doc/users/next_whats_new/2015-10-31_TransformedPatchPath.rst deleted file mode 100644 index 32a0458c822d..000000000000 --- a/doc/users/next_whats_new/2015-10-31_TransformedPatchPath.rst +++ /dev/null @@ -1,13 +0,0 @@ -New TransformedPatchPath caching object ---------------------------------------- - -A newly added :class:`~matplotlib.transforms.TransformedPatchPath` provides a -means to transform a :class:`~matplotlib.patches.Patch` into a -:class:`~matplotlib.path.Path` via a :class:`~matplotlib.transforms.Transform` -while caching the resulting path. If neither the patch nor the transform have -changed, a cached copy of the path is returned. - -This class differs from the older -:class:`~matplotlib.transforms.TransformedPath` in that it is able to refresh -itself based on the underlying patch while the older class uses an immutable -path. diff --git a/doc/users/next_whats_new/CheckButtons_widget_get_status.rst b/doc/users/next_whats_new/CheckButtons_widget_get_status.rst deleted file mode 100644 index 8c945fdf7f0d..000000000000 --- a/doc/users/next_whats_new/CheckButtons_widget_get_status.rst +++ /dev/null @@ -1,4 +0,0 @@ -CheckButtons widget get_status function ---------------------------------------- - -A :func:`get_status` function has been added the :class:`matplotlib.widgets.CheckButtons` class. This :func:`get_status` function allows user to query the status (True/False) of all of the buttons in the CheckButtons object. diff --git a/doc/users/next_whats_new/README.rst b/doc/users/next_whats_new/README.rst index cb09068bb0e1..5c9b9bb8c486 100644 --- a/doc/users/next_whats_new/README.rst +++ b/doc/users/next_whats_new/README.rst @@ -16,4 +16,4 @@ existing features. Include contents of the form: :: to use it. A sub-section - ````````````` + ~~~~~~~~~~~~~ diff --git a/doc/users/next_whats_new/abstract_movie_writer.rst b/doc/users/next_whats_new/abstract_movie_writer.rst deleted file mode 100644 index 44dc7bd5f182..000000000000 --- a/doc/users/next_whats_new/abstract_movie_writer.rst +++ /dev/null @@ -1,8 +0,0 @@ -Abstract base class for movie writers -------------------------------------- - -The new :class:`~matplotlib.animation.AbstractMovieWriter` class defines -the API required by a class that is to be used as the `writer` in the -`save` method of the :class:`~matplotlib.animation.Animation` class. -The existing :class:`~matplotlib.animation.MovieWriter` class now derives -from the new abstract base class. diff --git a/doc/users/next_whats_new/anchoredsizebar_fill_bar_argument.rst b/doc/users/next_whats_new/anchoredsizebar_fill_bar_argument.rst deleted file mode 100644 index 7426f2b25978..000000000000 --- a/doc/users/next_whats_new/anchoredsizebar_fill_bar_argument.rst +++ /dev/null @@ -1,13 +0,0 @@ -Add fill_bar argument to ``AnchoredSizeBar`` --------------------------------------------- - -The mpl_toolkits class -:class:`~mpl_toolkits.axes_grid1.anchored_artists.AnchoredSizeBar` now has an -additional ``fill_bar`` argument, which makes the size bar a solid rectangle -instead of just drawing the border of the rectangle. The default is ``None``, -and whether or not the bar will be filled by default depends on the value of -``size_vertical``. If ``size_vertical`` is nonzero, ``fill_bar`` will be set to -``True``. If ``size_vertical`` is zero then ``fill_bar`` will be set to -``False``. If you wish to override this default behavior, set ``fill_bar`` to -``True`` or ``False`` to unconditionally always or never use a filled patch -rectangle for the size bar. diff --git a/doc/users/next_whats_new/annotation-default-arrow.rst b/doc/users/next_whats_new/annotation-default-arrow.rst deleted file mode 100644 index e885b5b7f71a..000000000000 --- a/doc/users/next_whats_new/annotation-default-arrow.rst +++ /dev/null @@ -1,5 +0,0 @@ -Annotation can use a default arrow style ----------------------------------------- - -Annotations now use the default arrow style when setting `arrowprops={}`, -rather than no arrow (the new behavior actually matches the documentation). diff --git a/doc/users/next_whats_new/axes3d_orthographic_projection.rst b/doc/users/next_whats_new/axes3d_orthographic_projection.rst deleted file mode 100644 index 61242c43b755..000000000000 --- a/doc/users/next_whats_new/axes3d_orthographic_projection.rst +++ /dev/null @@ -1,3 +0,0 @@ -Orthographic projection for mplot3d ------------------------------------ -:class:`~mpl_toolkits.mplot3d.axes3d.Axes3D` now accepts ``proj_type`` kwarg and has a method :meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.set_proj_type`. The default option is ``'persp'`` as before, and supplying ``'ortho'`` enables orthographic view. diff --git a/doc/users/next_whats_new/barbs_dates_and_units.rst b/doc/users/next_whats_new/barbs_dates_and_units.rst deleted file mode 100644 index 9cc35854c85b..000000000000 --- a/doc/users/next_whats_new/barbs_dates_and_units.rst +++ /dev/null @@ -1,7 +0,0 @@ -Barbs and Quiver Support Dates ------------------------------- - -When using the :func:`quiver` and :func:`barbs` plotting methods, -it is now possible to pass dates, just like for other methods like -:func:`plot`. This also allows these functions to handle values -that need unit-conversion applied. diff --git a/doc/users/next_whats_new/default_hexbin_linecolor.rst b/doc/users/next_whats_new/default_hexbin_linecolor.rst deleted file mode 100644 index df26a7b2e1a3..000000000000 --- a/doc/users/next_whats_new/default_hexbin_linecolor.rst +++ /dev/null @@ -1,5 +0,0 @@ -Hexbin default line color -------------------------- - -The default ``linecolor`` kwarg for :func:`hexbin` is now ``'face'``, and -supplying ``'none'`` now prevents lines from being drawn around the hexagons. diff --git a/doc/users/next_whats_new/figure_legend_no_args.rst b/doc/users/next_whats_new/figure_legend_no_args.rst deleted file mode 100644 index 7b9f844b59c7..000000000000 --- a/doc/users/next_whats_new/figure_legend_no_args.rst +++ /dev/null @@ -1,6 +0,0 @@ -figure.legend() can be called without arguments ------------------------------------------------ - -Calling :func:`figure.legend` can now be done with no arguments. In this case a -legend will be created that contains all the artists on all the axes contained -within the figure. diff --git a/doc/users/next_whats_new/figure_new_clear_keyword.rst b/doc/users/next_whats_new/figure_new_clear_keyword.rst deleted file mode 100644 index 7b7706a86eeb..000000000000 --- a/doc/users/next_whats_new/figure_new_clear_keyword.rst +++ /dev/null @@ -1,32 +0,0 @@ -New parameter `clear` for :func:`~matplotlib.pyplot.figure` ------------------------------------------------------------ - -When the pyplot's function :func:`~matplotlib.pyplot.figure` is called -with a ``num`` parameter, a new window is only created if no existing -window with the same value exists. A new bool parameter `clear` was -added for explicitly clearing its existing contents. This is particularly -useful when utilized in interactive sessions. Since -:func:`~matplotlib.pyplot.subplots` also accepts keyword arguments -from :func:`~matplotlib.pyplot.figure`, it can also be used there:: - - import matplotlib.pyplot as plt - - fig0 = plt.figure(num=1) - fig0.suptitle("A fancy plot") - print("fig0.texts: ", [t.get_text() for t in fig0.texts]) - - fig1 = plt.figure(num=1, clear=False) # do not clear contents of window - fig1.text(0.5, 0.5, "Really fancy!") - print("fig0 is fig1: ", fig0 is fig1) - print("fig1.texts: ", [t.get_text() for t in fig1.texts]) - - fig2, ax2 = plt.subplots(2, 1, num=1, clear=True) # clear contents - print("fig0 is fig2: ", fig0 is fig2) - print("fig2.texts: ", [t.get_text() for t in fig2.texts]) - - # The output: - # fig0.texts: ['A fancy plot'] - # fig0 is fig1: True - # fig1.texts: ['A fancy plot', 'Really fancy!'] - # fig0 is fig2: True - # fig2.texts: [] \ No newline at end of file diff --git a/doc/users/next_whats_new/fix_avconv.rst b/doc/users/next_whats_new/fix_avconv.rst deleted file mode 100644 index afa033e37515..000000000000 --- a/doc/users/next_whats_new/fix_avconv.rst +++ /dev/null @@ -1,3 +0,0 @@ -AVConv writer is back ---------------------- -Correct a bug that prevented detection of AVconv for matplotlib.animation. diff --git a/doc/users/next_whats_new/invalid_axes_limits_errors.rst b/doc/users/next_whats_new/invalid_axes_limits_errors.rst deleted file mode 100644 index 6008e2359905..000000000000 --- a/doc/users/next_whats_new/invalid_axes_limits_errors.rst +++ /dev/null @@ -1,6 +0,0 @@ -Invalid (Non-finite) Axis Limit Error -------------------------------------- - -When using :func:`set_xlim` and :func:`set_ylim`, passing non-finite values now -results in a ValueError. The previous behavior resulted in the limits being -erroneously reset to `(-0.001, 0.001)`. diff --git a/doc/users/next_whats_new/metadata_savefig_kwarg.rst b/doc/users/next_whats_new/metadata_savefig_kwarg.rst deleted file mode 100644 index 3167cac2c4f9..000000000000 --- a/doc/users/next_whats_new/metadata_savefig_kwarg.rst +++ /dev/null @@ -1,20 +0,0 @@ -Metadata savefig kwarg ----------------------- - -:func:`~matplotlib.pyplot.savefig` now accepts `metadata` as a keyword argument. -It can be used to store key/value pairs in the image metadata. - -Supported formats and backends -`````````````````````````````` -* 'png' with Agg backend -* 'pdf' with PDF backend (see - :func:`~matplotlib.backends.backend_pdf.PdfFile.writeInfoDict` for a list of - supported keywords) -* 'eps' and 'ps' with PS backend (only 'Creator' key is accepted) - -Example -``````` -:: - - plt.savefig('test.png', metadata={'Software': 'My awesome software'}) - diff --git a/doc/users/next_whats_new/min_log_scale_exponent.rst b/doc/users/next_whats_new/min_log_scale_exponent.rst deleted file mode 100644 index 70a28a86b90a..000000000000 --- a/doc/users/next_whats_new/min_log_scale_exponent.rst +++ /dev/null @@ -1,5 +0,0 @@ -Specify minimum value to format as scalar for ``LogFormatterMathtext`` ----------------------------------------------------------------------- - -``LogFormatterMathtext`` now includes the option to specify a minimum value -exponent to format as a scalar (ie. 0.001 instead of 10^-3). diff --git a/doc/users/next_whats_new/multiple_legend_keys.rst b/doc/users/next_whats_new/multiple_legend_keys.rst deleted file mode 100644 index 982ce6fbae70..000000000000 --- a/doc/users/next_whats_new/multiple_legend_keys.rst +++ /dev/null @@ -1,14 +0,0 @@ -Multiple legend keys for legend entries ---------------------------------------- - -A legend entry can now contain more than one legend key. The extended -``HandlerTuple`` class now accepts two parameters: ``ndivide`` divides the -legend area in the specified number of sections; ``pad`` changes the padding -between the legend keys. - -.. figure:: /gallery/text_labels_and_annotations/images/sphx_glr_legend_demo_004.png - :target: ../../gallery/text_labels_and_annotations/legend_demo.html - :align: center - :scale: 50 - - Multiple Legend Keys diff --git a/doc/users/next_whats_new/path_simplification_updates.rst b/doc/users/next_whats_new/path_simplification_updates.rst deleted file mode 100644 index 20acd227e2fe..000000000000 --- a/doc/users/next_whats_new/path_simplification_updates.rst +++ /dev/null @@ -1,24 +0,0 @@ -Path simplification updates ---------------------------- - -Line simplification controlled by the ``path.simplify`` and -``path.simplify_threshold`` parameters has been improved. You should -notice better rendering performance when plotting large amounts of -data (as long as the above parameters are set accordingly). Only the -line segment portion of paths will be simplified -- if you are also -drawing markers and experiencing problems with rendering speed, you -should consider using the ``markevery`` option to ``plot``. -See the :ref:`performance` section in the usage tutorial for more -information. - -The simplification works by iteratively merging line segments -into a single vector until the next line segment's perpendicular -distance to the vector (measured in display-coordinate space) -is greater than the ``path.simplify_threshold`` parameter. Thus, higher -values of ``path.simplify_threshold`` result in quicker rendering times. -If you are plotting just to explore data and not for publication quality, -pixel perfect plots, then a value of ``1.0`` can be safely used. If you -want to make sure your plot reflects your data *exactly*, then you should -set ``path.simplify`` to false and/or ``path.simplify_threshold`` to ``0``. -Matplotlib currently defaults to a conservative value of ``1/9``, smaller -values are unlikely to cause any visible differences in your plots. diff --git a/doc/users/next_whats_new/percent_formatter.rst b/doc/users/next_whats_new/percent_formatter.rst deleted file mode 100644 index 5948d588ca90..000000000000 --- a/doc/users/next_whats_new/percent_formatter.rst +++ /dev/null @@ -1,6 +0,0 @@ -Added `matplotlib.ticker.PercentFormatter` ------------------------------------------- - -The new formatter has some nice features like being able to convert from -arbitrary data scales to percents, a customizable percent symbol and -either automatic or manual control over the decimal points. diff --git a/doc/users/next_whats_new/quiverkey_angle_kwarg.rst b/doc/users/next_whats_new/quiverkey_angle_kwarg.rst deleted file mode 100644 index f2622c063f22..000000000000 --- a/doc/users/next_whats_new/quiverkey_angle_kwarg.rst +++ /dev/null @@ -1,5 +0,0 @@ -New quiverkey angle kwarg -------------------------- - -Plotting a :func:`quiverkey` now admits the ``angle`` kwarg, -which sets the angle at which to draw the key arrow. diff --git a/doc/users/next_whats_new/reproducible_ps_pdf.rst b/doc/users/next_whats_new/reproducible_ps_pdf.rst deleted file mode 100644 index a8c9e9cf9d59..000000000000 --- a/doc/users/next_whats_new/reproducible_ps_pdf.rst +++ /dev/null @@ -1,28 +0,0 @@ -Reproducible PS, PDF and SVG output ------------------------------------ - -The ``SOURCE_DATE_EPOCH`` environment variable can now be used to set -the timestamp value in the PS and PDF outputs. See -https://reproducible-builds.org/specs/source-date-epoch/ - -Alternatively, calling ``savefig`` with ``metadata={'creationDate': None}`` -will omit the timestamp altogether. - -The reproducibility of the output from the PS and PDF backends has so -far been tested using various plot elements but only default values of -options such as ``{ps,pdf}.fonttype`` that can affect the output at a -low level, and not with the mathtext or usetex features. When -matplotlib calls external tools (such as PS distillers or LaTeX) their -versions need to be kept constant for reproducibility, and they may -add sources of nondeterminism outside the control of matplotlib. - -For SVG output, the ``svg.hashsalt`` rc parameter has been added in an -earlier release. This parameter changes some random identifiers in the -SVG file to be deterministic. The downside of this setting is that if -more than one file is generated using deterministic identifiers -and they end up as parts of one larger document, the identifiers can -collide and cause the different parts to affect each other. - -These features are now enabled in the tests for the PDF and SVG -backends, so most test output files (but not all of them) are now -deterministic. diff --git a/doc/users/next_whats_new/reversed_colormap.rst b/doc/users/next_whats_new/reversed_colormap.rst deleted file mode 100644 index fb42757a7e5c..000000000000 --- a/doc/users/next_whats_new/reversed_colormap.rst +++ /dev/null @@ -1,7 +0,0 @@ -Colormap reversed method ------------------------- - -The methods :meth:`~matplotlib.colors.LinearSegmentedColormap.reversed` and -:meth:`~matplotlib.colors.ListedColormap.reversed` return a reversed -instance of the Colormap. This implements a way for any Colormap to be -reversed. \ No newline at end of file diff --git a/doc/users/next_whats_new/scatter_no_longer_flattens.rst b/doc/users/next_whats_new/scatter_no_longer_flattens.rst deleted file mode 100644 index 6e8ee6df967e..000000000000 --- a/doc/users/next_whats_new/scatter_no_longer_flattens.rst +++ /dev/null @@ -1,6 +0,0 @@ -`Collection` offsets are no longer implicitly flattened -------------------------------------------------------- - -`Collection` (and thus `scatter` -- both 2D and 3D) no longer implicitly -flattens its offsets. As a consequence, `scatter`'s x and y arguments can no -longer be 2+-dimensional arrays. diff --git a/doc/users/next_whats_new/setp_output.rst b/doc/users/next_whats_new/setp_output.rst deleted file mode 100644 index cd4af662e6d3..000000000000 --- a/doc/users/next_whats_new/setp_output.rst +++ /dev/null @@ -1,7 +0,0 @@ -`Artist.setp` (and `pyplot.setp`) accept a `file` argument ----------------------------------------------------------- - -The argument is keyword-only. It allows an output file other than -`sys.stdout` to be specified. It works exactly like the `file` argument -to `print`. - diff --git a/doc/users/next_whats_new/streamplot_set_maximum_length.rst b/doc/users/next_whats_new/streamplot_set_maximum_length.rst deleted file mode 100644 index 434eb9ec9ecb..000000000000 --- a/doc/users/next_whats_new/streamplot_set_maximum_length.rst +++ /dev/null @@ -1,5 +0,0 @@ -Maximum streamline length and integration direction can now be specified ------------------------------------------------------------------------- - -This allows to follow the vector field for a longer time and can enhance the -visibility of the flow pattern in some use cases. diff --git a/doc/users/next_whats_new/tick_params_rotation.rst b/doc/users/next_whats_new/tick_params_rotation.rst deleted file mode 100644 index 1c90b4475896..000000000000 --- a/doc/users/next_whats_new/tick_params_rotation.rst +++ /dev/null @@ -1,10 +0,0 @@ -`Axis.set_tick_params` now responds to 'rotation' -------------------------------------------------- - -Bulk setting of tick label rotation is now possible via :func:`set_tick_params` using the `rotation` keyword. - -Example -``````` -:: - - ax.xaxis.set_tick_params(which='both', rotation=90) \ No newline at end of file diff --git a/doc/users/next_whats_new/toggle_3d_bar_shading.rst b/doc/users/next_whats_new/toggle_3d_bar_shading.rst deleted file mode 100644 index 98a77ef081ae..000000000000 --- a/doc/users/next_whats_new/toggle_3d_bar_shading.rst +++ /dev/null @@ -1,28 +0,0 @@ -Users can now toggle shading in 3D bar plots --------------------------------------------- - -A new ``shade`` parameter has been added the 3D bar plotting method. -The default behavior remains to shade the bars, but now users -have the option of setting ``shade`` to ``False``. - - -Example -``````` -:: - - import numpy as np - import matplotlib.pyplot as plt - from mpl_toolkits.mplot3d import Axes3D - - fig = plt.figure(figsize=(7,3)) - ax1 = fig.add_subplot(121, projection='3d') - x = np.arange(2) - y = np.arange(3) - x2d, y2d = np.meshgrid(x, y) - x2d, y2d = x2d.ravel(), y2d.ravel() - z = x2d + y2d - ax1.bar3d(x2d, y2d, x2d * 0, 1, 1, z, shade=True) - - ax2 = fig.add_subplot(122, projection='3d') - ax2.bar3d(x2d, y2d, x2d * 0, 1, 1, z, shade=False) - fig.canvas.draw() diff --git a/doc/users/next_whats_new/update_autofmt_xdate.rst b/doc/users/next_whats_new/update_autofmt_xdate.rst deleted file mode 100644 index e0ad100447f2..000000000000 --- a/doc/users/next_whats_new/update_autofmt_xdate.rst +++ /dev/null @@ -1,13 +0,0 @@ -New which Parameter for autofmt_xdate -------------------------------------- - -A ``which`` parameter now exists for the method :func:`autofmt_xdate`. This -allows a user to format ``major``, ``minor`` or ``both`` tick labels -selectively. If ``which`` is ``None`` (default) then the method will rotate -``major`` tick labels. - -Example -``````` -:: - - autofmt_xdate(self, bottom=0.2, rotation=30, ha='right', which='minor') diff --git a/doc/users/next_whats_new/update_subplot2grid.rst b/doc/users/next_whats_new/update_subplot2grid.rst deleted file mode 100644 index b5075e2f3f52..000000000000 --- a/doc/users/next_whats_new/update_subplot2grid.rst +++ /dev/null @@ -1,13 +0,0 @@ -New Figure Parameter for subplot2grid --------------------------------------- - -A ``fig`` parameter now exists for the method :func:`subplot2grid`. This allows -a user to specify the figure where the subplots will be created. If ``fig`` -is ``None`` (default) then the method will use the current figure retrieved by -:func:`gcf`. - -Example -``````` -:: - - subplot2grid(shape, loc, rowspan=1, colspan=1, fig=myfig) diff --git a/doc/users/next_whats_new/updated_fill_betweenx.rst b/doc/users/next_whats_new/updated_fill_betweenx.rst deleted file mode 100644 index 0c1d85a10d0f..000000000000 --- a/doc/users/next_whats_new/updated_fill_betweenx.rst +++ /dev/null @@ -1,6 +0,0 @@ -Interpolation in fill_betweenx ------------------------------- - -The ``interpolate`` parameter now exists for the method :func:`fill_betweenx`. -This allows a user to interpolate the data and fill the areas in the crossover -points, similarly to :func:`fill_between`. diff --git a/doc/users/next_whats_new/validation_of_linestyle_rcparams.rst b/doc/users/next_whats_new/validation_of_linestyle_rcparams.rst deleted file mode 100644 index d8fd823593f2..000000000000 --- a/doc/users/next_whats_new/validation_of_linestyle_rcparams.rst +++ /dev/null @@ -1,31 +0,0 @@ -Validation of line style rcParams ---------------------------------- - -Stricter validation -``````````````````` -The validation of rcParams that are related to line styles -(``lines.linestyle``, ``boxplot.*.linestyle``, ``grid.linestyle`` and -``contour.negative_linestyle``) now effectively checks that the values -are valid line styles. Strings like ``dashed`` or ``--`` are accepted, -as well as even-length sequences of on-off ink like ``[1, 1.65]``. In -this latter case, the offset value is handled internally and should *not* -be provided by the user. - -The validation is case-insensitive. - -Deprecation of the former validators for ``contour.negative_linestyle`` -``````````````````````````````````````````````````````````````````````` -The new validation scheme replaces the former one used for the -``contour.negative_linestyle`` rcParams, that was limited to ``solid`` -and ``dashed`` line styles. - -The former public validation functions ``validate_negative_linestyle`` -and ``validate_negative_linestyle_legacy`` will be deprecated in 2.1 and -may be removed in 2.3. There are no public functions to replace them. - -Examples of use -``````````````` -:: - - grid.linestyle : (1, 3) # loosely dotted grid lines - contour.negative_linestyle : dashdot # previously only solid or dashed diff --git a/doc/users/prev_whats_new/whats_new_2.0.0.rst b/doc/users/prev_whats_new/whats_new_2.0.0.rst new file mode 100644 index 000000000000..809b3ac4da25 --- /dev/null +++ b/doc/users/prev_whats_new/whats_new_2.0.0.rst @@ -0,0 +1,317 @@ +.. _whats-new-2-0-0: + +New in matplotlib 2.0 +===================== + +.. note:: + + matplotlib 2.0 supports Python 2.7, and 3.4+ + + + +Default style changes +--------------------- + +The major changes in v2.0 are related to overhauling the default styles. + +.. toctree:: + :maxdepth: 2 + + ../dflt_style_changes + + +Improved color conversion API and RGBA support +---------------------------------------------- + +The :mod:`~matplotlib.colors` gained a new color conversion API with +full support for the alpha channel. The main public functions are +:func:`~matplotlib.colors.is_color_like`, :func:`matplotlib.colors.to_rgba`, +:func:`matplotlib.colors.to_rgba_array` and :func:`~matplotlib.colors.to_hex`. +RGBA quadruplets are encoded in hex format as `#rrggbbaa`. + +A side benefit is that the Qt options editor now allows setting the alpha +channel of the artists as well. + + +New Configuration (rcParams) +---------------------------- + +New rcparams added + ++---------------------------------+--------------------------------------------------+ +| Parameter | Description | ++=================================+==================================================+ +|`date.autoformatter.year` | format string for 'year' scale dates | ++---------------------------------+--------------------------------------------------+ +|`date.autoformatter.month` | format string for 'month' scale dates | ++---------------------------------+--------------------------------------------------+ +|`date.autoformatter.day` | format string for 'day' scale dates | ++---------------------------------+--------------------------------------------------+ +|`date.autoformatter.hour` | format string for 'hour' scale times | ++---------------------------------+--------------------------------------------------+ +|`date.autoformatter.minute` | format string for 'minute' scale times | ++---------------------------------+--------------------------------------------------+ +|`date.autoformatter.second` | format string for 'second' scale times | ++---------------------------------+--------------------------------------------------+ +|`date.autoformatter.microsecond` | format string for 'microsecond' scale times | ++---------------------------------+--------------------------------------------------+ +|`scatter.marker` | default marker for scatter plot | ++---------------------------------+--------------------------------------------------+ +|`svg.hashsalt` | see note | ++---------------------------------+--------------------------------------------------+ +|`xtick.top`, `xtick.minor.top`, | Control where major and minor ticks are drawn. | +|`xtick.major.top` | The global values are `and` ed with the | +|`xtick.bottom`, | corresponding major/minor values. | +|`xtick.minor.bottom`, | | +|`xtick.major.bottom` | | +|`ytick.left`, `ytick.minor.left`,| | +|`ytick.major.left` | | +|`ytick.right`, | | +|`ytick.minor.right`, | | +|`ytick.major.right` | | ++---------------------------------+--------------------------------------------------+ +|`hist.bins` | The default number of bins to use in | +| | `~matplotlib.axes.Axes.hist`. This can be an | +| | `int`, a list of floats, or ``'auto'`` if numpy | +| | >= 1.11 is installed. | ++---------------------------------+--------------------------------------------------+ +|`lines.scale_dashes` | Whether the line dash patterns should scale with | +| | linewidth. | ++---------------------------------+--------------------------------------------------+ +|`axes.formatter.offset_threshold`| Minimum number of digits saved in tick labels | +| | that triggers using an offset. | ++---------------------------------+--------------------------------------------------+ + + + +Added ``svg.hashsalt`` key to rcParams +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If ``svg.hashsalt`` is ``None`` (which it is by default), the svg +backend uses ``uuid4`` to generate the hash salt. If it is not +``None``, it must be a string that is used as the hash salt instead of +``uuid4``. This allows for deterministic SVG output. + + +Removed the ``svg.image_noscale`` rcParam +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +As a result of the extensive changes to image handling, the +``svg.image_noscale`` rcParam has been removed. The same +functionality may be achieved by setting ``interpolation='none'`` on +individual images or globally using the ``image.interpolation`` +rcParam. + + +Qualitative colormaps +--------------------- + +ColorBrewer's "qualitative" colormaps ("Accent", "Dark2", "Paired", +"Pastel1", "Pastel2", "Set1", "Set2", "Set3") were intended for discrete +categorical data, with no implication of value, and therefore have been +converted to ``ListedColormap`` instead of ``LinearSegmentedColormap``, so +the colors will no longer be interpolated and they can be used for +choropleths, labeled image features, etc. + + + +Axis offset label now responds to `labelcolor` +---------------------------------------------- + +Axis offset labels are now colored the same as axis tick markers when `labelcolor` is altered. + +Improved offset text choice +--------------------------- +The default offset-text choice was changed to only use significant digits that +are common to all ticks (e.g. 1231..1239 -> 1230, instead of 1231), except when +they straddle a relatively large multiple of a power of ten, in which case that +multiple is chosen (e.g. 1999..2001->2000). + + +Style parameter blacklist +------------------------- + +In order to prevent unexpected consequences from using a style, style +files are no longer able to set parameters that affect things +unrelated to style. These parameters include:: + + 'interactive', 'backend', 'backend.qt4', 'webagg.port', + 'webagg.port_retries', 'webagg.open_in_browser', 'backend_fallback', + 'toolbar', 'timezone', 'datapath', 'figure.max_open_warning', + 'savefig.directory', 'tk.window_focus', 'docstring.hardcopy' + + +Change in default font +---------------------- + +The default font used by matplotlib in text has been changed to DejaVu Sans and +DejaVu Serif for the sans-serif and serif families, respectively. The DejaVu +font family is based on the previous matplotlib default --Bitstream Vera-- but +includes a much wider range of characters. + +The default mathtext font has been changed from Computer Modern to the DejaVu +family to maintain consistency with regular text. Two new options for the +``mathtext.fontset`` configuration parameter have been added: ``dejavusans`` +(default) and ``dejavuserif``. Both of these options use DejaVu glyphs whenever +possible and fall back to STIX symbols when a glyph is not found in DejaVu. To +return to the previous behavior, set the rcParam ``mathtext.fontset`` to ``cm``. + + +Faster text rendering +--------------------- + +Rendering text in the Agg backend is now less fuzzy and about 20% +faster to draw. + + +Improvements for the Qt figure options editor +--------------------------------------------- + +Various usability improvements were implemented for the Qt figure options +editor, among which: + +- Line style entries are now sorted without duplicates. +- The colormap and normalization limits can now be set for images. +- Line edits for floating values now display only as many digits as necessary + to avoid precision loss. An important bug was also fixed regarding input + validation using Qt5 and a locale where the decimal separator is ",". +- The axes selector now uses shorter, more user-friendly names for axes, and + does not crash if there are no axes. +- Line and image entries using the default labels ("_lineX", "_imageX") are now + sorted numerically even when there are more than 10 entries. + + +Improved image support +---------------------- + +Prior to version 2.0, matplotlib resampled images by first applying +the color map and then resizing the result. Since the resampling was +performed on the colored image, this introduced colors in the output +image that didn't actually exist in the color map. Now, images are +resampled first (and entirely in floating-point, if the input image is +floating-point), and then the color map is applied. + +In order to make this important change, the image handling code was +almost entirely rewritten. As a side effect, image resampling uses +less memory and fewer datatype conversions than before. + +The experimental private feature where one could "skew" an image by +setting the private member ``_image_skew_coordinate`` has been +removed. Instead, images will obey the transform of the axes on which +they are drawn. + +Non-linear scales on image plots +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:func:`imshow` now draws data at the requested points in data space after the +application of non-linear scales. + +The image on the left demonstrates the new, correct behavior. +The old behavior can be recreated using :func:`pcolormesh` as +demonstrated on the right. + + +.. plot:: + + import numpy as np + import matplotlib.pyplot as plt + + data = np.arange(30).reshape(5, 6) + x = np.linspace(0, 6, 7) + y = 10**np.linspace(0, 5, 6) + X, Y = np.meshgrid(x, y) + + fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(8, 4)) + + ax1.imshow(data, aspect="auto", extent=(0, 6, 1e0, 1e5), interpolation='nearest') + ax1.set_yscale('log') + ax1.set_title('Using ax.imshow') + + ax2.pcolormesh(x, y, np.flipud(data)) + ax2.set_yscale('log') + ax2.set_title('Using ax.pcolormesh') + ax2.autoscale('tight') + + plt.show() + + +This can be understood by analogy to plotting a histogram with linearly spaced bins +with a logarithmic x-axis. Equal sized bins will be displayed as wider for small +*x* and narrower for large *x*. + + + +Support for HiDPI (Retina) displays in the NbAgg and WebAgg backends +-------------------------------------------------------------------- + +The NbAgg and WebAgg backends will now use the full resolution of your +high-pixel-density display. + +Change in the default animation codec +------------------------------------- + +The default animation codec has been changed from ``mpeg4`` to ``h264``, +which is more efficient. It can be set via the ``animation.codec`` rcParam. + +Deprecated support for mencoder in animation +-------------------------------------------- + +The use of mencoder for writing video files with mpl is problematic; +switching to ffmpeg is strongly advised. All support for mencoder +will be removed in version 2.2. + +Boxplot Zorder Keyword Argument +------------------------------- + +The ``zorder`` parameter now exists for :func:`boxplot`. This allows the zorder +of a boxplot to be set in the plotting function call. + +:: + + boxplot(np.arange(10), zorder=10) + +Filled ``+`` and ``x`` markers +------------------------------ + +New fillable *plus* and *x* markers have been added. See +the :mod:`~matplotlib.markers` module and +:ref:`marker reference ` +examples. + +`rcount` and `ccount` for `plot_surface()` +------------------------------------------ + +As of v2.0, mplot3d's :func:`~mpl_toolkits.mplot3d.axes3d.plot_surface` now +accepts `rcount` and `ccount` arguments for controlling the sampling of the +input data for plotting. These arguments specify the maximum number of +evenly spaced samples to take from the input data. These arguments are +also the new default sampling method for the function, and is +considered a style change. + +The old `rstride` and `cstride` arguments, which specified the size of the +evenly spaced samples, become the default when 'classic' mode is invoked, +and are still available for use. There are no plans for deprecating these +arguments. + +Streamplot Zorder Keyword Argument Changes +------------------------------------------ + +The ``zorder`` parameter for :func:`streamplot` now has default +value of ``None`` instead of ``2``. If ``None`` is given as ``zorder``, +:func:`streamplot` has a default ``zorder`` of +``matplotlib.lines.Line2D.zorder``. + +.. _gc_get_hatch_color_wn: + +Extension to `matplotlib.backend_bases.GraphicsContextBase` +----------------------------------------------------------- + +To support standardizing hatch behavior across the backends we ship +the `matplotlib.backend_bases.GraphicsContextBase.get_hatch_color` +method as added to `matplotlib.backend_bases.GraphicsContextBase`. +This is only used during the render process in the backends we ship so +will not break any third-party backends. + +If you maintain a third-party backend which extends +`~matplotlib.backend_bases.GraphicsContextBase` this method is now +available to you and should be used to color hatch patterns. diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index 1c6ce3c729df..8f987066c666 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -21,322 +21,405 @@ revision, see the :ref:`github-stats`. next_whats_new/* - -New in matplotlib 2.0 +New in Matplotlib 2.1 ===================== -.. note:: +New TransformedPatchPath caching object +--------------------------------------- - matplotlib 2.0 supports Python 2.7, and 3.4+ +A newly added :class:`~matplotlib.transforms.TransformedPatchPath` provides a +means to transform a :class:`~matplotlib.patches.Patch` into a +:class:`~matplotlib.path.Path` via a :class:`~matplotlib.transforms.Transform` +while caching the resulting path. If neither the patch nor the transform have +changed, a cached copy of the path is returned. +This class differs from the older +:class:`~matplotlib.transforms.TransformedPath` in that it is able to refresh +itself based on the underlying patch while the older class uses an immutable +path. -Default style changes ---------------------- +CheckButtons widget get_status function +--------------------------------------- -The major changes in v2.0 are related to overhauling the default styles. +A :func:`get_status` function has been added the :class:`matplotlib.widgets.CheckButtons` class. This :func:`get_status` function allows user to query the status (True/False) of all of the buttons in the CheckButtons object. -.. toctree:: - :maxdepth: 2 - - dflt_style_changes - - -Improved color conversion API and RGBA support ----------------------------------------------- - -The :mod:`~matplotlib.colors` gained a new color conversion API with -full support for the alpha channel. The main public functions are -:func:`~matplotlib.colors.is_color_like`, :func:`matplotlib.colors.to_rgba`, -:func:`matplotlib.colors.to_rgba_array` and :func:`~matplotlib.colors.to_hex`. -RGBA quadruplets are encoded in hex format as `#rrggbbaa`. - -A side benefit is that the Qt options editor now allows setting the alpha -channel of the artists as well. - - -New Configuration (rcParams) ----------------------------- - -New rcparams added - -+---------------------------------+--------------------------------------------------+ -| Parameter | Description | -+=================================+==================================================+ -|`date.autoformatter.year` | format string for 'year' scale dates | -+---------------------------------+--------------------------------------------------+ -|`date.autoformatter.month` | format string for 'month' scale dates | -+---------------------------------+--------------------------------------------------+ -|`date.autoformatter.day` | format string for 'day' scale dates | -+---------------------------------+--------------------------------------------------+ -|`date.autoformatter.hour` | format string for 'hour' scale times | -+---------------------------------+--------------------------------------------------+ -|`date.autoformatter.minute` | format string for 'minute' scale times | -+---------------------------------+--------------------------------------------------+ -|`date.autoformatter.second` | format string for 'second' scale times | -+---------------------------------+--------------------------------------------------+ -|`date.autoformatter.microsecond` | format string for 'microsecond' scale times | -+---------------------------------+--------------------------------------------------+ -|`scatter.marker` | default marker for scatter plot | -+---------------------------------+--------------------------------------------------+ -|`svg.hashsalt` | see note | -+---------------------------------+--------------------------------------------------+ -|`xtick.top`, `xtick.minor.top`, | Control where major and minor ticks are drawn. | -|`xtick.major.top` | The global values are `and` ed with the | -|`xtick.bottom`, | corresponding major/minor values. | -|`xtick.minor.bottom`, | | -|`xtick.major.bottom` | | -|`ytick.left`, `ytick.minor.left`,| | -|`ytick.major.left` | | -|`ytick.right`, | | -|`ytick.minor.right`, | | -|`ytick.major.right` | | -+---------------------------------+--------------------------------------------------+ -|`hist.bins` | The default number of bins to use in | -| | `~matplotlib.axes.Axes.hist`. This can be an | -| | `int`, a list of floats, or ``'auto'`` if numpy | -| | >= 1.11 is installed. | -+---------------------------------+--------------------------------------------------+ -|`lines.scale_dashes` | Whether the line dash patterns should scale with | -| | linewidth. | -+---------------------------------+--------------------------------------------------+ -|`axes.formatter.offset_threshold`| Minimum number of digits saved in tick labels | -| | that triggers using an offset. | -+---------------------------------+--------------------------------------------------+ - - - -Added ``svg.hashsalt`` key to rcParams -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If ``svg.hashsalt`` is ``None`` (which it is by default), the svg -backend uses ``uuid4`` to generate the hash salt. If it is not -``None``, it must be a string that is used as the hash salt instead of -``uuid4``. This allows for deterministic SVG output. - - -Removed the ``svg.image_noscale`` rcParam -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -As a result of the extensive changes to image handling, the -``svg.image_noscale`` rcParam has been removed. The same -functionality may be achieved by setting ``interpolation='none'`` on -individual images or globally using the ``image.interpolation`` -rcParam. - - -Qualitative colormaps ---------------------- -ColorBrewer's "qualitative" colormaps ("Accent", "Dark2", "Paired", -"Pastel1", "Pastel2", "Set1", "Set2", "Set3") were intended for discrete -categorical data, with no implication of value, and therefore have been -converted to ``ListedColormap`` instead of ``LinearSegmentedColormap``, so -the colors will no longer be interpolated and they can be used for -choropleths, labeled image features, etc. +Abstract base class for movie writers +------------------------------------- + +The new :class:`~matplotlib.animation.AbstractMovieWriter` class defines +the API required by a class that is to be used as the `writer` in the +`save` method of the :class:`~matplotlib.animation.Animation` class. +The existing :class:`~matplotlib.animation.MovieWriter` class now derives +from the new abstract base class. +Add fill_bar argument to ``AnchoredSizeBar`` +-------------------------------------------- -Axis offset label now responds to `labelcolor` ----------------------------------------------- +The mpl_toolkits class +:class:`~mpl_toolkits.axes_grid1.anchored_artists.AnchoredSizeBar` now has an +additional ``fill_bar`` argument, which makes the size bar a solid rectangle +instead of just drawing the border of the rectangle. The default is ``None``, +and whether or not the bar will be filled by default depends on the value of +``size_vertical``. If ``size_vertical`` is nonzero, ``fill_bar`` will be set to +``True``. If ``size_vertical`` is zero then ``fill_bar`` will be set to +``False``. If you wish to override this default behavior, set ``fill_bar`` to +``True`` or ``False`` to unconditionally always or never use a filled patch +rectangle for the size bar. -Axis offset labels are now colored the same as axis tick markers when `labelcolor` is altered. -Improved offset text choice ---------------------------- -The default offset-text choice was changed to only use significant digits that -are common to all ticks (e.g. 1231..1239 -> 1230, instead of 1231), except when -they straddle a relatively large multiple of a power of ten, in which case that -multiple is chosen (e.g. 1999..2001->2000). +Annotation can use a default arrow style +---------------------------------------- + +Annotations now use the default arrow style when setting `arrowprops={}`, +rather than no arrow (the new behavior actually matches the documentation). + +Orthographic projection for mplot3d +----------------------------------- +:class:`~mpl_toolkits.mplot3d.axes3d.Axes3D` now accepts ``proj_type`` kwarg and has a method :meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.set_proj_type`. The default option is ``'persp'`` as before, and supplying ``'ortho'`` enables orthographic view. -Style parameter blacklist + +``voxels`` function for mplot3d +------------------------------- +:class:`~mpl_toolkits.mplot3d.axes3d.Axes3D` now has a ``voxels`` method, for +visualizing boolean 3d data. Uses could include plotting a sparse 3D heat map, +or visualizing a volumetric model. + + +Barbs and Quiver Support Dates +------------------------------ + +When using the :func:`quiver` and :func:`barbs` plotting methods, +it is now possible to pass dates, just like for other methods like +:func:`plot`. This also allows these functions to handle values +that need unit-conversion applied. + + +Hexbin default line color ------------------------- -In order to prevent unexpected consequences from using a style, style -files are no longer able to set parameters that affect things -unrelated to style. These parameters include:: +The default ``linecolor`` kwarg for :func:`hexbin` is now ``'face'``, and +supplying ``'none'`` now prevents lines from being drawn around the hexagons. + + +figure.legend() can be called without arguments +----------------------------------------------- - 'interactive', 'backend', 'backend.qt4', 'webagg.port', - 'webagg.port_retries', 'webagg.open_in_browser', 'backend_fallback', - 'toolbar', 'timezone', 'datapath', 'figure.max_open_warning', - 'savefig.directory', 'tk.window_focus', 'docstring.hardcopy' +Calling :func:`figure.legend` can now be done with no arguments. In this case a +legend will be created that contains all the artists on all the axes contained +within the figure. -Change in default font +New parameter `clear` for :func:`~matplotlib.pyplot.figure` +----------------------------------------------------------- + +When the pyplot's function :func:`~matplotlib.pyplot.figure` is called +with a ``num`` parameter, a new window is only created if no existing +window with the same value exists. A new bool parameter `clear` was +added for explicitly clearing its existing contents. This is particularly +useful when utilized in interactive sessions. Since +:func:`~matplotlib.pyplot.subplots` also accepts keyword arguments +from :func:`~matplotlib.pyplot.figure`, it can also be used there:: + + import matplotlib.pyplot as plt + + fig0 = plt.figure(num=1) + fig0.suptitle("A fancy plot") + print("fig0.texts: ", [t.get_text() for t in fig0.texts]) + + fig1 = plt.figure(num=1, clear=False) # do not clear contents of window + fig1.text(0.5, 0.5, "Really fancy!") + print("fig0 is fig1: ", fig0 is fig1) + print("fig1.texts: ", [t.get_text() for t in fig1.texts]) + + fig2, ax2 = plt.subplots(2, 1, num=1, clear=True) # clear contents + print("fig0 is fig2: ", fig0 is fig2) + print("fig2.texts: ", [t.get_text() for t in fig2.texts]) + + # The output: + # fig0.texts: ['A fancy plot'] + # fig0 is fig1: True + # fig1.texts: ['A fancy plot', 'Really fancy!'] + # fig0 is fig2: True + # fig2.texts: [] + +AVConv writer is back +--------------------- +Correct a bug that prevented detection of AVconv for matplotlib.animation. + + +Invalid (Non-finite) Axis Limit Error +------------------------------------- + +When using :func:`set_xlim` and :func:`set_ylim`, passing non-finite values now +results in a ValueError. The previous behavior resulted in the limits being +erroneously reset to `(-0.001, 0.001)`. + + +Metadata savefig kwarg ---------------------- -The default font used by matplotlib in text has been changed to DejaVu Sans and -DejaVu Serif for the sans-serif and serif families, respectively. The DejaVu -font family is based on the previous matplotlib default --Bitstream Vera-- but -includes a much wider range of characters. +:func:`~matplotlib.pyplot.savefig` now accepts `metadata` as a keyword argument. +It can be used to store key/value pairs in the image metadata. -The default mathtext font has been changed from Computer Modern to the DejaVu -family to maintain consistency with regular text. Two new options for the -``mathtext.fontset`` configuration parameter have been added: ``dejavusans`` -(default) and ``dejavuserif``. Both of these options use DejaVu glyphs whenever -possible and fall back to STIX symbols when a glyph is not found in DejaVu. To -return to the previous behavior, set the rcParam ``mathtext.fontset`` to ``cm``. +Supported formats and backends +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* 'png' with Agg backend +* 'pdf' with PDF backend (see + :func:`~matplotlib.backends.backend_pdf.PdfFile.writeInfoDict` for a list of + supported keywords) +* 'eps' and 'ps' with PS backend (only 'Creator' key is accepted) +Example +~~~~~~~ +:: -Faster text rendering ---------------------- + plt.savefig('test.png', metadata={'Software': 'My awesome software'}) -Rendering text in the Agg backend is now less fuzzy and about 20% -faster to draw. -Improvements for the Qt figure options editor ---------------------------------------------- +Specify minimum value to format as scalar for ``LogFormatterMathtext`` +---------------------------------------------------------------------- -Various usability improvements were implemented for the Qt figure options -editor, among which: +``LogFormatterMathtext`` now includes the option to specify a minimum value +exponent to format as a scalar (ie. 0.001 instead of 10^-3). -- Line style entries are now sorted without duplicates. -- The colormap and normalization limits can now be set for images. -- Line edits for floating values now display only as many digits as necessary - to avoid precision loss. An important bug was also fixed regarding input - validation using Qt5 and a locale where the decimal separator is ",". -- The axes selector now uses shorter, more user-friendly names for axes, and - does not crash if there are no axes. -- Line and image entries using the default labels ("_lineX", "_imageX") are now - sorted numerically even when there are more than 10 entries. +Multiple legend keys for legend entries +--------------------------------------- -Improved image support ----------------------- +A legend entry can now contain more than one legend key. The extended +``HandlerTuple`` class now accepts two parameters: ``ndivide`` divides the +legend area in the specified number of sections; ``pad`` changes the padding +between the legend keys. -Prior to version 2.0, matplotlib resampled images by first applying -the color map and then resizing the result. Since the resampling was -performed on the colored image, this introduced colors in the output -image that didn't actually exist in the color map. Now, images are -resampled first (and entirely in floating-point, if the input image is -floating-point), and then the color map is applied. +.. figure:: /gallery/text_labels_and_annotations/images/sphx_glr_legend_demo_004.png + :target: ../../gallery/text_labels_and_annotations/legend_demo.html + :align: center + :scale: 50 -In order to make this important change, the image handling code was -almost entirely rewritten. As a side effect, image resampling uses -less memory and fewer datatype conversions than before. + Multiple Legend Keys -The experimental private feature where one could "skew" an image by -setting the private member ``_image_skew_coordinate`` has been -removed. Instead, images will obey the transform of the axes on which -they are drawn. -Non-linear scales on image plots -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Path simplification updates +--------------------------- -:func:`imshow` now draws data at the requested points in data space after the -application of non-linear scales. +Line simplification controlled by the ``path.simplify`` and +``path.simplify_threshold`` parameters has been improved. You should +notice better rendering performance when plotting large amounts of +data (as long as the above parameters are set accordingly). Only the +line segment portion of paths will be simplified -- if you are also +drawing markers and experiencing problems with rendering speed, you +should consider using the ``markevery`` option to ``plot``. +See the :ref:`performance` section in the usage tutorial for more +information. + +The simplification works by iteratively merging line segments +into a single vector until the next line segment's perpendicular +distance to the vector (measured in display-coordinate space) +is greater than the ``path.simplify_threshold`` parameter. Thus, higher +values of ``path.simplify_threshold`` result in quicker rendering times. +If you are plotting just to explore data and not for publication quality, +pixel perfect plots, then a value of ``1.0`` can be safely used. If you +want to make sure your plot reflects your data *exactly*, then you should +set ``path.simplify`` to false and/or ``path.simplify_threshold`` to ``0``. +Matplotlib currently defaults to a conservative value of ``1/9``, smaller +values are unlikely to cause any visible differences in your plots. + + +Added `matplotlib.ticker.PercentFormatter` +------------------------------------------ -The image on the left demonstrates the new, correct behavior. -The old behavior can be recreated using :func:`pcolormesh` as -demonstrated on the right. +The new formatter has some nice features like being able to convert from +arbitrary data scales to percents, a customizable percent symbol and +either automatic or manual control over the decimal points. -.. plot:: +New quiverkey angle kwarg +------------------------- - import numpy as np - import matplotlib.pyplot as plt +Plotting a :func:`quiverkey` now admits the ``angle`` kwarg, +which sets the angle at which to draw the key arrow. - data = np.arange(30).reshape(5, 6) - x = np.linspace(0, 6, 7) - y = 10**np.linspace(0, 5, 6) - X, Y = np.meshgrid(x, y) - fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(8, 4)) +Reproducible PS, PDF and SVG output +----------------------------------- - ax1.imshow(data, aspect="auto", extent=(0, 6, 1e0, 1e5), interpolation='nearest') - ax1.set_yscale('log') - ax1.set_title('Using ax.imshow') +The ``SOURCE_DATE_EPOCH`` environment variable can now be used to set +the timestamp value in the PS and PDF outputs. See +https://reproducible-builds.org/specs/source-date-epoch/ - ax2.pcolormesh(x, y, np.flipud(data)) - ax2.set_yscale('log') - ax2.set_title('Using ax.pcolormesh') - ax2.autoscale('tight') +Alternatively, calling ``savefig`` with ``metadata={'creationDate': None}`` +will omit the timestamp altogether. - plt.show() +The reproducibility of the output from the PS and PDF backends has so +far been tested using various plot elements but only default values of +options such as ``{ps,pdf}.fonttype`` that can affect the output at a +low level, and not with the mathtext or usetex features. When +matplotlib calls external tools (such as PS distillers or LaTeX) their +versions need to be kept constant for reproducibility, and they may +add sources of nondeterminism outside the control of matplotlib. +For SVG output, the ``svg.hashsalt`` rc parameter has been added in an +earlier release. This parameter changes some random identifiers in the +SVG file to be deterministic. The downside of this setting is that if +more than one file is generated using deterministic identifiers +and they end up as parts of one larger document, the identifiers can +collide and cause the different parts to affect each other. -This can be understood by analogy to plotting a histogram with linearly spaced bins -with a logarithmic x-axis. Equal sized bins will be displayed as wider for small -*x* and narrower for large *x*. +These features are now enabled in the tests for the PDF and SVG +backends, so most test output files (but not all of them) are now +deterministic. +Colormap reversed method +------------------------ -Support for HiDPI (Retina) displays in the NbAgg and WebAgg backends --------------------------------------------------------------------- +The methods :meth:`~matplotlib.colors.LinearSegmentedColormap.reversed` and +:meth:`~matplotlib.colors.ListedColormap.reversed` return a reversed +instance of the Colormap. This implements a way for any Colormap to be +reversed. -The NbAgg and WebAgg backends will now use the full resolution of your -high-pixel-density display. -Change in the default animation codec -------------------------------------- +`Collection` offsets are no longer implicitly flattened +------------------------------------------------------- + +`Collection` (and thus `scatter` -- both 2D and 3D) no longer implicitly +flattens its offsets. As a consequence, `scatter`'s x and y arguments can no +longer be 2+-dimensional arrays. -The default animation codec has been changed from ``mpeg4`` to ``h264``, -which is more efficient. It can be set via the ``animation.codec`` rcParam. -Deprecated support for mencoder in animation +`Artist.setp` (and `pyplot.setp`) accept a `file` argument +---------------------------------------------------------- + +The argument is keyword-only. It allows an output file other than +`sys.stdout` to be specified. It works exactly like the `file` argument +to `print`. + + + +Maximum streamline length and integration direction can now be specified +------------------------------------------------------------------------ + +This allows to follow the vector field for a longer time and can enhance the +visibility of the flow pattern in some use cases. + + +`Axis.set_tick_params` now responds to 'rotation' +------------------------------------------------- + +Bulk setting of tick label rotation is now possible via :func:`set_tick_params` using the `rotation` keyword. + +Example +~~~~~~~ +:: + + ax.xaxis.set_tick_params(which='both', rotation=90) + +Users can now toggle shading in 3D bar plots -------------------------------------------- -The use of mencoder for writing video files with mpl is problematic; -switching to ffmpeg is strongly advised. All support for mencoder -will be removed in version 2.2. +A new ``shade`` parameter has been added the 3D bar plotting method. +The default behavior remains to shade the bars, but now users +have the option of setting ``shade`` to ``False``. -Boxplot Zorder Keyword Argument -------------------------------- -The ``zorder`` parameter now exists for :func:`boxplot`. This allows the zorder -of a boxplot to be set in the plotting function call. +Example +~~~~~~~ +:: + + import numpy as np + import matplotlib.pyplot as plt + from mpl_toolkits.mplot3d import Axes3D + + fig = plt.figure(figsize=(7,3)) + ax1 = fig.add_subplot(121, projection='3d') + x = np.arange(2) + y = np.arange(3) + x2d, y2d = np.meshgrid(x, y) + x2d, y2d = x2d.ravel(), y2d.ravel() + z = x2d + y2d + ax1.bar3d(x2d, y2d, x2d * 0, 1, 1, z, shade=True) + + ax2 = fig.add_subplot(122, projection='3d') + ax2.bar3d(x2d, y2d, x2d * 0, 1, 1, z, shade=False) + fig.canvas.draw() + +New which Parameter for autofmt_xdate +------------------------------------- + +A ``which`` parameter now exists for the method :func:`autofmt_xdate`. This +allows a user to format ``major``, ``minor`` or ``both`` tick labels +selectively. If ``which`` is ``None`` (default) then the method will rotate +``major`` tick labels. + +Example +~~~~~~~ :: - boxplot(np.arange(10), zorder=10) + autofmt_xdate(self, bottom=0.2, rotation=30, ha='right', which='minor') + + +New Figure Parameter for subplot2grid +------------------------------------- + +A ``fig`` parameter now exists for the method :func:`subplot2grid`. This allows +a user to specify the figure where the subplots will be created. If ``fig`` +is ``None`` (default) then the method will use the current figure retrieved by +:func:`gcf`. + +Example +~~~~~~~ +:: -Filled ``+`` and ``x`` markers + subplot2grid(shape, loc, rowspan=1, colspan=1, fig=myfig) + + +Interpolation in fill_betweenx ------------------------------ -New fillable *plus* and *x* markers have been added. See -the :mod:`~matplotlib.markers` module and -:ref:`marker reference ` -examples. +The ``interpolate`` parameter now exists for the method :func:`fill_betweenx`. +This allows a user to interpolate the data and fill the areas in the crossover +points, similarly to :func:`fill_between`. -`rcount` and `ccount` for `plot_surface()` ------------------------------------------- -As of v2.0, mplot3d's :func:`~mpl_toolkits.mplot3d.axes3d.plot_surface` now -accepts `rcount` and `ccount` arguments for controlling the sampling of the -input data for plotting. These arguments specify the maximum number of -evenly spaced samples to take from the input data. These arguments are -also the new default sampling method for the function, and is -considered a style change. +Validation of line style rcParams +--------------------------------- -The old `rstride` and `cstride` arguments, which specified the size of the -evenly spaced samples, become the default when 'classic' mode is invoked, -and are still available for use. There are no plans for deprecating these -arguments. +Stricter validation +~~~~~~~~~~~~~~~~~~~ +The validation of rcParams that are related to line styles +(``lines.linestyle``, ``boxplot.*.linestyle``, ``grid.linestyle`` and +``contour.negative_linestyle``) now effectively checks that the values +are valid line styles. Strings like ``dashed`` or ``--`` are accepted, +as well as even-length sequences of on-off ink like ``[1, 1.65]``. In +this latter case, the offset value is handled internally and should *not* +be provided by the user. -Streamplot Zorder Keyword Argument Changes ------------------------------------------- +The validation is case-insensitive. -The ``zorder`` parameter for :func:`streamplot` now has default -value of ``None`` instead of ``2``. If ``None`` is given as ``zorder``, -:func:`streamplot` has a default ``zorder`` of -``matplotlib.lines.Line2D.zorder``. +Deprecation of the former validators for ``contour.negative_linestyle`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The new validation scheme replaces the former one used for the +``contour.negative_linestyle`` rcParams, that was limited to ``solid`` +and ``dashed`` line styles. -.. _gc_get_hatch_color_wn: +The former public validation functions ``validate_negative_linestyle`` +and ``validate_negative_linestyle_legacy`` will be deprecated in 2.1 and +may be removed in 2.3. There are no public functions to replace them. -Extension to `matplotlib.backend_bases.GraphicsContextBase` ------------------------------------------------------------ +Examples of use +~~~~~~~~~~~~~~~ +:: + + grid.linestyle : (1, 3) # loosely dotted grid lines + contour.negative_linestyle : dashdot # previously only solid or dashed -To support standardizing hatch behavior across the backends we ship -the `matplotlib.backend_bases.GraphicsContextBase.get_hatch_color` -method as added to `matplotlib.backend_bases.GraphicsContextBase`. -This is only used during the render process in the backends we ship so -will not break any third-party backends. -If you maintain a third-party backend which extends -`~matplotlib.backend_bases.GraphicsContextBase` this method is now -available to you and should be used to color hatch patterns. Previous Whats New ================== @@ -344,6 +427,7 @@ Previous Whats New .. toctree:: :glob: :maxdepth: 1 + :reversed: - prev_whats_new/whats_new_* prev_whats_new/changelog + prev_whats_new/whats_new_* diff --git a/doc/users/whats_new/axes3d_voxels.rst b/doc/users/whats_new/axes3d_voxels.rst deleted file mode 100644 index 2f22d77b81bf..000000000000 --- a/doc/users/whats_new/axes3d_voxels.rst +++ /dev/null @@ -1,5 +0,0 @@ -``voxels`` function for mplot3d -------------------------------- -:class:`~mpl_toolkits.mplot3d.axes3d.Axes3D` now has a ``voxels`` method, for -visualizing boolean 3d data. Uses could include plotting a sparse 3D heat map, -or visualizing a volumetric model.