From 1e601f71a198c6b6e8abfed7d2c0faa1d3db667c Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 15 May 2020 19:27:53 -0400 Subject: [PATCH 1/3] DOC: add example image to axline --- doc/users/next_whats_new/2017-12-08-axline.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/users/next_whats_new/2017-12-08-axline.rst b/doc/users/next_whats_new/2017-12-08-axline.rst index f4ba4e0b3fa9..3a7232827a42 100644 --- a/doc/users/next_whats_new/2017-12-08-axline.rst +++ b/doc/users/next_whats_new/2017-12-08-axline.rst @@ -3,3 +3,15 @@ New `~.axes.Axes.axline` method A new `~.axes.Axes.axline` method has been added to draw infinitely long lines that pass through two points. + + + +.. plot:: + :include-source: True + + fig, ax = plt.subplots() + + ax.axline((.1, .1), slope=5, color='C0', label='by slope') + ax.axline((.1, .2), (.8, .7), color='C3', label='by points') + + ax.legend() From e65b5223b78e27a19b3b0734bcdd1396a0bce377 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 15 May 2020 19:49:50 -0400 Subject: [PATCH 2/3] DOC: standardize rst markup --- doc/users/next_whats_new/2018-09-19-AL.rst | 4 +--- doc/users/next_whats_new/2019-06-01-AL.rst | 2 +- doc/users/next_whats_new/2019-06-25-AL.rst | 2 +- doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst | 1 - .../2019-10-18_rcParams-for-raise-window-behavior.rst | 2 -- doc/users/next_whats_new/2019-12-20-set_xy_position | 1 + doc/users/next_whats_new/2020-01-24-lateshare.rst | 1 + doc/users/next_whats_new/2020-01-25-clabel_zorder.rst | 1 + doc/users/next_whats_new/2020-02-03-fontpath.rst | 2 +- doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst | 5 +++-- .../next_whats_new/2020-03-05_markerstyle-for-lines.rst | 2 +- doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst | 3 ++- doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst | 2 +- doc/users/next_whats_new/2020-04-13-AL.rst | 3 ++- doc/users/next_whats_new/2020-04-14-title-yparam.rst | 3 ++- doc/users/next_whats_new/2020-04-22-suptitle-tl.rst | 2 +- doc/users/next_whats_new/imshow_m_n_1.rst | 5 +++-- 17 files changed, 22 insertions(+), 19 deletions(-) diff --git a/doc/users/next_whats_new/2018-09-19-AL.rst b/doc/users/next_whats_new/2018-09-19-AL.rst index 77240958aa90..f9212d0cc17f 100644 --- a/doc/users/next_whats_new/2018-09-19-AL.rst +++ b/doc/users/next_whats_new/2018-09-19-AL.rst @@ -1,7 +1,5 @@ -:orphan: - `matplotlib.rc_context` is now a `contextlib.contextmanager` -```````````````````````````````````````````````````````````` +------------------------------------------------------------ `matplotlib.rc_context` can now be used as a decorator (technically, it is now implemented as a `contextlib.contextmanager`), e.g. :: diff --git a/doc/users/next_whats_new/2019-06-01-AL.rst b/doc/users/next_whats_new/2019-06-01-AL.rst index fc3940bfb969..37919b2893d3 100644 --- a/doc/users/next_whats_new/2019-06-01-AL.rst +++ b/doc/users/next_whats_new/2019-06-01-AL.rst @@ -1,5 +1,5 @@ GridSpec.subplots() -``````````````````` +------------------- The `.GridSpec` class gained a `~.GridSpecBase.subplots` method, so that one can write :: diff --git a/doc/users/next_whats_new/2019-06-25-AL.rst b/doc/users/next_whats_new/2019-06-25-AL.rst index 1b26539c0bc4..29b80ac0fa23 100644 --- a/doc/users/next_whats_new/2019-06-25-AL.rst +++ b/doc/users/next_whats_new/2019-06-25-AL.rst @@ -1,2 +1,2 @@ 3D axes now support minor ticks -``````````````````````````````` +------------------------------- diff --git a/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst b/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst index ca7650fbd496..41295423aaac 100644 --- a/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst +++ b/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst @@ -1,4 +1,3 @@ -:orphan: Setting axes box aspect ----------------------- diff --git a/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst b/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst index bc8c18cdfeae..da94a67eeff6 100644 --- a/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst +++ b/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst @@ -1,8 +1,6 @@ -:orphan: rcParams for controlling default "raise window" behavior -------------------------------------------------------- The new config option :rc:`figure.raise_window` allows to disable raising the plot window when calling `~.pyplot.show` or `~.pyplot.pause`. ``MacOSX`` backend is currently not supported. - diff --git a/doc/users/next_whats_new/2019-12-20-set_xy_position b/doc/users/next_whats_new/2019-12-20-set_xy_position index 5e125673516b..dcf9d2faa1c2 100644 --- a/doc/users/next_whats_new/2019-12-20-set_xy_position +++ b/doc/users/next_whats_new/2019-12-20-set_xy_position @@ -1,5 +1,6 @@ Align labels to axes edges -------------------------- + `~.axes.Axes.set_xlabel`, `~.axes.Axes.set_ylabel` and `ColorbarBase.set_label` support a parameter ``loc`` for simplified positioning. Supported values are 'left', 'center', or 'right'. The default is controlled via diff --git a/doc/users/next_whats_new/2020-01-24-lateshare.rst b/doc/users/next_whats_new/2020-01-24-lateshare.rst index fdb17c85a01a..25fc1aded1c1 100644 --- a/doc/users/next_whats_new/2020-01-24-lateshare.rst +++ b/doc/users/next_whats_new/2020-01-24-lateshare.rst @@ -1,5 +1,6 @@ `.Axes.sharex`, `.Axes.sharey` ------------------------------ + These new methods allow sharing axes *immediately* after creating them. For example, they can be used to selectively link some axes created all together using `~.Figure.subplots`. diff --git a/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst b/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst index c5518a44023c..f07212569b80 100644 --- a/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst +++ b/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst @@ -1,5 +1,6 @@ Set zorder of contour labels ---------------------------- + `~.axes.Axes.clabel` now accepts a ``zorder`` kwarg making it easier to set the ``zorder`` of contour labels. If not specified, the default ``zorder`` of clabels used to always be 3 diff --git a/doc/users/next_whats_new/2020-02-03-fontpath.rst b/doc/users/next_whats_new/2020-02-03-fontpath.rst index d2d16aea50c8..463182e09253 100644 --- a/doc/users/next_whats_new/2020-02-03-fontpath.rst +++ b/doc/users/next_whats_new/2020-02-03-fontpath.rst @@ -1,5 +1,5 @@ Simple syntax to select fonts by absolute path -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +---------------------------------------------- Fonts can now be selected by passing an absolute `pathlib.Path` to the *font* kwarg of `.Text`. diff --git a/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst b/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst index a297867c6f0a..476241f025ec 100644 --- a/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst +++ b/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst @@ -1,5 +1,6 @@ Add generalized "mathtext.fallback" rcParam ------------------------------------------------------------------------- +------------------------------------------- + New "mathtext.fallback" rcParam. Takes "cm", "stix", "stixsans" or "none" to turn fallback off. "mathtext.fallback_to_cm" is -deprecated, but if used, will override new fallback. \ No newline at end of file +deprecated, but if used, will override new fallback. diff --git a/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst b/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst index 81dbec49c7fc..89a270d138e6 100644 --- a/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst +++ b/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst @@ -1,7 +1,7 @@ Lines now accept ``MarkerStyle`` instances as input --------------------------------------------------- + Similar to `~.Axes.scatter`, `~.Axes.plot` and `~.lines.Line2D` now accept `~.markers.MarkerStyle` instances as input for the *marker* parameter:: plt.plot(..., marker=matplotlib.markers.MarkerStyle("D")) - diff --git a/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst b/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst index d6c526513d0c..d788af983b5a 100644 --- a/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst +++ b/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst @@ -1,5 +1,6 @@ Allow tick formatters to be set with str or function inputs ------------------------------------------------------------------------- +----------------------------------------------------------- + `~.Axis.set_major_formatter` and `~.Axis.set_minor_formatter` now accept `str` or function inputs in addition to `~.ticker.Formatter` instances. For a `str` a `~.ticker.StrMethodFormatter` is automatically diff --git a/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst b/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst index d340a3111d5a..c1d63d7a47d2 100644 --- a/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst +++ b/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst @@ -1,5 +1,5 @@ Cursor text now uses a number of significant digits matching pointing precision -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------------------------------------------------------------- Previously, the x/y position displayed by the cursor text would usually include far more significant digits than the mouse pointing precision (typically one diff --git a/doc/users/next_whats_new/2020-04-13-AL.rst b/doc/users/next_whats_new/2020-04-13-AL.rst index 890ceda6bf85..c983acd48767 100644 --- a/doc/users/next_whats_new/2020-04-13-AL.rst +++ b/doc/users/next_whats_new/2020-04-13-AL.rst @@ -1,5 +1,6 @@ `.backend_bases.key_press_handler` and `.backend_bases.button_press_handler` simplifications -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-------------------------------------------------------------------------------------------- + These event handlers can now be directly connected to a canvas with ``canvas.mpl_connect("key_press_event", key_press_handler)`` and ``canvas.mpl_connect("button_press_event", button_press_handler)``, rather than diff --git a/doc/users/next_whats_new/2020-04-14-title-yparam.rst b/doc/users/next_whats_new/2020-04-14-title-yparam.rst index 53e98f1fe52b..b2e30540b72f 100644 --- a/doc/users/next_whats_new/2020-04-14-title-yparam.rst +++ b/doc/users/next_whats_new/2020-04-14-title-yparam.rst @@ -1,8 +1,9 @@ `~.axes.Axes.set_title` gains a y keyword argument to control auto positioning ------------------------------------------------------------------------------ + `~.axes.Axes.set_title` tries to auto-position the title to avoid any decorators on the top x-axis. This is not always desirable so now *y* is an explicit keyword argument of `~.axes.Axes.set_title`. It defaults to *None* which means to use auto-positioning. If a value is supplied (i.e. the pre-3.0 default was ``y=1.0``) then auto-positioning is -turned off. This can also be set with the new rcParameter :rc:`axes.titley`. +turned off. This can also be set with the new rcParameter :rc:`axes.titley`. diff --git a/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst b/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst index aee6a2c312cb..b7202fef0aae 100644 --- a/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst +++ b/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst @@ -1,2 +1,2 @@ tight_layout now supports suptitle -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +---------------------------------- diff --git a/doc/users/next_whats_new/imshow_m_n_1.rst b/doc/users/next_whats_new/imshow_m_n_1.rst index 5cdc4d92a8f4..429876154c48 100644 --- a/doc/users/next_whats_new/imshow_m_n_1.rst +++ b/doc/users/next_whats_new/imshow_m_n_1.rst @@ -1,5 +1,6 @@ Imshow now coerces 3D arrays with depth 1 to 2D ------------------------------------------------ -Starting from this version arrays of size MxNx1 will be coerced into MxN -for displaying. This means commands like ``plt.imshow(np.random.rand(3, 3, 1))`` + +Starting from this version arrays of size MxNx1 will be coerced into MxN +for displaying. This means commands like ``plt.imshow(np.random.rand(3, 3, 1))`` will no longer return an error message that the image shape is invalid. From 0167a623ec47f19757e733be682cce19d39f1096 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 15 May 2020 19:55:30 -0400 Subject: [PATCH 3/3] DOC: consolidate all whats_new entries But don't edit yet. --- .../next_whats_new/2017-12-08-axline.rst | 17 - .../next_whats_new/2017-12-29-3dhome.rst | 2 - doc/users/next_whats_new/2018-09-19-AL.rst | 9 - .../2019-03-25-mplot3d-projection.rst | 16 - doc/users/next_whats_new/2019-06-01-AL.rst | 11 - doc/users/next_whats_new/2019-06-25-AL.rst | 2 - .../2019-07-31_axes-box-aspect.rst | 13 - ...-18_rcParams-for-raise-window-behavior.rst | 6 - .../2019-10-27-savefig-backend.rst | 6 - .../2019-11-13-offset-text-position.rst | 4 - .../2019-12-09-legend-labelcolor.rst | 16 - .../next_whats_new/2019-12-20-set_xy_position | 8 - .../2020-01-18-pcolorshadingoptions.rst | 25 -- .../next_whats_new/2020-01-24-lateshare.rst | 9 - .../2020-01-25-clabel_zorder.rst | 10 - .../next_whats_new/2020-02-03-fontpath.rst | 5 - .../2020-02-24-mathtext-fallback.rst | 6 - .../2020-03-05_markerstyle-for-lines.rst | 7 - .../2020-03-06-auto-tick-formatters.rst | 8 - .../2020-03-15-cursor-sigdigits.rst | 6 - .../next_whats_new/2020-03-16-qtzoom.rst | 4 - .../2020-03-24-svg-hatch-alpha.rst | 6 - .../2020-03-31-path-size-methods.rst | 27 -- .../2020-04-09-datetime-epoch-change.rst | 22 -- doc/users/next_whats_new/2020-04-13-AL.rst | 8 - .../2020-04-14-title-yparam.rst | 9 - .../next_whats_new/2020-04-22-suptitle-tl.rst | 2 - ...0-05-04-add-rcparams-contour-linewidth.rst | 9 - doc/users/next_whats_new/imshow_m_n_1.rst | 6 - doc/users/prev_whats_new/whats_new_3.3.0.rst | 349 ++++++++++++++++++ doc/users/whats_new.rst | 2 +- 31 files changed, 350 insertions(+), 280 deletions(-) delete mode 100644 doc/users/next_whats_new/2017-12-08-axline.rst delete mode 100644 doc/users/next_whats_new/2017-12-29-3dhome.rst delete mode 100644 doc/users/next_whats_new/2018-09-19-AL.rst delete mode 100644 doc/users/next_whats_new/2019-03-25-mplot3d-projection.rst delete mode 100644 doc/users/next_whats_new/2019-06-01-AL.rst delete mode 100644 doc/users/next_whats_new/2019-06-25-AL.rst delete mode 100644 doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst delete mode 100644 doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst delete mode 100644 doc/users/next_whats_new/2019-10-27-savefig-backend.rst delete mode 100644 doc/users/next_whats_new/2019-11-13-offset-text-position.rst delete mode 100644 doc/users/next_whats_new/2019-12-09-legend-labelcolor.rst delete mode 100644 doc/users/next_whats_new/2019-12-20-set_xy_position delete mode 100644 doc/users/next_whats_new/2020-01-18-pcolorshadingoptions.rst delete mode 100644 doc/users/next_whats_new/2020-01-24-lateshare.rst delete mode 100644 doc/users/next_whats_new/2020-01-25-clabel_zorder.rst delete mode 100644 doc/users/next_whats_new/2020-02-03-fontpath.rst delete mode 100644 doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst delete mode 100644 doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst delete mode 100644 doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst delete mode 100644 doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst delete mode 100644 doc/users/next_whats_new/2020-03-16-qtzoom.rst delete mode 100644 doc/users/next_whats_new/2020-03-24-svg-hatch-alpha.rst delete mode 100644 doc/users/next_whats_new/2020-03-31-path-size-methods.rst delete mode 100644 doc/users/next_whats_new/2020-04-09-datetime-epoch-change.rst delete mode 100644 doc/users/next_whats_new/2020-04-13-AL.rst delete mode 100644 doc/users/next_whats_new/2020-04-14-title-yparam.rst delete mode 100644 doc/users/next_whats_new/2020-04-22-suptitle-tl.rst delete mode 100644 doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidth.rst delete mode 100644 doc/users/next_whats_new/imshow_m_n_1.rst create mode 100644 doc/users/prev_whats_new/whats_new_3.3.0.rst diff --git a/doc/users/next_whats_new/2017-12-08-axline.rst b/doc/users/next_whats_new/2017-12-08-axline.rst deleted file mode 100644 index 3a7232827a42..000000000000 --- a/doc/users/next_whats_new/2017-12-08-axline.rst +++ /dev/null @@ -1,17 +0,0 @@ -New `~.axes.Axes.axline` method -------------------------------- - -A new `~.axes.Axes.axline` method has been added to draw infinitely long lines -that pass through two points. - - - -.. plot:: - :include-source: True - - fig, ax = plt.subplots() - - ax.axline((.1, .1), slope=5, color='C0', label='by slope') - ax.axline((.1, .2), (.8, .7), color='C3', label='by points') - - ax.legend() diff --git a/doc/users/next_whats_new/2017-12-29-3dhome.rst b/doc/users/next_whats_new/2017-12-29-3dhome.rst deleted file mode 100644 index ae7b80a60978..000000000000 --- a/doc/users/next_whats_new/2017-12-29-3dhome.rst +++ /dev/null @@ -1,2 +0,0 @@ -Home/Forward/Backward buttons now work with 3D axes ---------------------------------------------------- diff --git a/doc/users/next_whats_new/2018-09-19-AL.rst b/doc/users/next_whats_new/2018-09-19-AL.rst deleted file mode 100644 index f9212d0cc17f..000000000000 --- a/doc/users/next_whats_new/2018-09-19-AL.rst +++ /dev/null @@ -1,9 +0,0 @@ -`matplotlib.rc_context` is now a `contextlib.contextmanager` ------------------------------------------------------------- - -`matplotlib.rc_context` can now be used as a decorator (technically, it is now -implemented as a `contextlib.contextmanager`), e.g. :: - - @rc_context({"lines.linewidth": 2}) - def some_function(...): - ... diff --git a/doc/users/next_whats_new/2019-03-25-mplot3d-projection.rst b/doc/users/next_whats_new/2019-03-25-mplot3d-projection.rst deleted file mode 100644 index fdc16761c713..000000000000 --- a/doc/users/next_whats_new/2019-03-25-mplot3d-projection.rst +++ /dev/null @@ -1,16 +0,0 @@ -``Axes3D`` no longer distorts the 3d plot to match the 2d aspect ratio ----------------------------------------------------------------------- - -Plots made with :class:`~mpl_toolkits.mplot3d.axes3d.Axes3D` were previously -stretched to fit a square bounding box. As this stretching was done after -the projection from 3D to 2D, it resulted in distorted images if non-square -bounding boxes were used. As of 3.3, this no longer occurs. - -Currently, modes of setting the aspect (via -`~mpl_toolkits.mplot3d.axes3d.Axes3D.set_aspect`) in data space are -not supported for Axes3D but may be in the future. If you want to -simulate having equal aspect in data space, set the ratio of your data -limits to match the value of `~.get_box_aspect`. To control these -ratios use the `~mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect` -method which accepts the ratios as a 3-tuple of X:Y:Z. The default -aspect ratio is 4:4:3. diff --git a/doc/users/next_whats_new/2019-06-01-AL.rst b/doc/users/next_whats_new/2019-06-01-AL.rst deleted file mode 100644 index 37919b2893d3..000000000000 --- a/doc/users/next_whats_new/2019-06-01-AL.rst +++ /dev/null @@ -1,11 +0,0 @@ -GridSpec.subplots() -------------------- - -The `.GridSpec` class gained a `~.GridSpecBase.subplots` method, so that one -can write :: - - fig.add_gridspec(2, 2, height_ratios=[3, 1]).subplots() - -as an alternative to :: - - fig.subplots(2, 2, gridspec_kw={"height_ratios": [3, 1]}) diff --git a/doc/users/next_whats_new/2019-06-25-AL.rst b/doc/users/next_whats_new/2019-06-25-AL.rst deleted file mode 100644 index 29b80ac0fa23..000000000000 --- a/doc/users/next_whats_new/2019-06-25-AL.rst +++ /dev/null @@ -1,2 +0,0 @@ -3D axes now support minor ticks -------------------------------- diff --git a/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst b/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst deleted file mode 100644 index 41295423aaac..000000000000 --- a/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst +++ /dev/null @@ -1,13 +0,0 @@ - -Setting axes box aspect ------------------------ - -It is now possible to set the aspect of an axes box directly via -`~.Axes.set_box_aspect`. The box aspect is the ratio between axes height -and axes width in physical units, independent of the data limits. -This is useful to e.g. produce a square plot, independent of the data it -contains, or to have a usual plot with the same axes dimensions next to -an image plot with fixed (data-)aspect. - -For use cases check out the :doc:`Axes box aspect -` example. diff --git a/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst b/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst deleted file mode 100644 index da94a67eeff6..000000000000 --- a/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst +++ /dev/null @@ -1,6 +0,0 @@ - -rcParams for controlling default "raise window" behavior --------------------------------------------------------- -The new config option :rc:`figure.raise_window` allows to disable -raising the plot window when calling `~.pyplot.show` or `~.pyplot.pause`. -``MacOSX`` backend is currently not supported. diff --git a/doc/users/next_whats_new/2019-10-27-savefig-backend.rst b/doc/users/next_whats_new/2019-10-27-savefig-backend.rst deleted file mode 100644 index 602278fed1d5..000000000000 --- a/doc/users/next_whats_new/2019-10-27-savefig-backend.rst +++ /dev/null @@ -1,6 +0,0 @@ -``savefig()`` gained a ``backend`` keyword argument ---------------------------------------------------- - -The ``backend`` keyword argument to ``savefig`` can now be used to pick the -rendering backend without having to globally set the backend; e.g. one can save -pdfs using the pgf backend with ``savefig("file.pdf", backend="pgf")``. diff --git a/doc/users/next_whats_new/2019-11-13-offset-text-position.rst b/doc/users/next_whats_new/2019-11-13-offset-text-position.rst deleted file mode 100644 index ac9e58058034..000000000000 --- a/doc/users/next_whats_new/2019-11-13-offset-text-position.rst +++ /dev/null @@ -1,4 +0,0 @@ -Offset text is now set to the top when using axis.tick_top() ------------------------------------------------------------- - -Solves the issue that the power indicator (e.g. 1e4) stayed on the bottom, even if the ticks were on the top. diff --git a/doc/users/next_whats_new/2019-12-09-legend-labelcolor.rst b/doc/users/next_whats_new/2019-12-09-legend-labelcolor.rst deleted file mode 100644 index bf22a22f09f9..000000000000 --- a/doc/users/next_whats_new/2019-12-09-legend-labelcolor.rst +++ /dev/null @@ -1,16 +0,0 @@ -Text color for legend labels ----------------------------- - -The text color of legend labels can now be set by passing a parameter -``labelcolor`` to `~.axes.Axes.legend`. The ``labelcolor`` keyword can be: - -* A single color (either a string or RGBA tuple), which adjusts the text color - of all the labels. -* A list or tuple, allowing the text color of each label to be set - individually. -* ``linecolor``, which sets the text color of each label to match the - corresponding line color. -* ``markerfacecolor``, which sets the text color of each label to match the - corresponding marker face color. -* ``markeredgecolor``, which sets the text color of each label to match the - corresponding marker edge color. diff --git a/doc/users/next_whats_new/2019-12-20-set_xy_position b/doc/users/next_whats_new/2019-12-20-set_xy_position deleted file mode 100644 index dcf9d2faa1c2..000000000000 --- a/doc/users/next_whats_new/2019-12-20-set_xy_position +++ /dev/null @@ -1,8 +0,0 @@ -Align labels to axes edges --------------------------- - -`~.axes.Axes.set_xlabel`, `~.axes.Axes.set_ylabel` and `ColorbarBase.set_label` -support a parameter ``loc`` for simplified positioning. Supported values are -'left', 'center', or 'right'. The default is controlled via -:rc:`xaxis.labelposition` and :rc:`yaxis.labelposition`; the Colorbar label -takes the rcParam based on its orientation. diff --git a/doc/users/next_whats_new/2020-01-18-pcolorshadingoptions.rst b/doc/users/next_whats_new/2020-01-18-pcolorshadingoptions.rst deleted file mode 100644 index a61d5f4f4c6a..000000000000 --- a/doc/users/next_whats_new/2020-01-18-pcolorshadingoptions.rst +++ /dev/null @@ -1,25 +0,0 @@ -Pcolor and Pcolormesh now accept shading='nearest' and 'auto' -------------------------------------------------------------- - -Previously `.axes.Axes.pcolor` and `.axes.Axes.pcolormesh` handled -the situation where *x* and *y* have the same (respective) size as *C* by -dropping the last row and column of *C*, and *x* and *y* are regarded as the -edges of the remaining rows and columns in *C*. However, many users want -*x* and *y* centered on the rows and columns of *C*. - -To accommodate this, ``shading='nearest'`` and ``shading='auto'`` are -new allowed strings for the ``shading`` kwarg. ``'nearest'`` will center the -color on *x* and *y* if *x* and *y* have the same dimensions as *C* -(otherwise an error will be thrown). ``shading='auto'`` will choose 'flat' -or 'nearest' based on the size of *X*, *Y*, *C*. - -If ``shading='flat'`` then *X*, and *Y* should have dimensions one larger -than *C*. If *X* and *Y* have the same dimensions as *C*, then the previous -behavior is used and the last row and column of *C* are dropped, and a -DeprecationWarning is emitted. - -Users can also specify this by the new :rc:`pcolor.shading` in their -``.matplotlibrc`` or via `.rcParams`. - -See :doc:`pcolormesh ` -for examples. diff --git a/doc/users/next_whats_new/2020-01-24-lateshare.rst b/doc/users/next_whats_new/2020-01-24-lateshare.rst deleted file mode 100644 index 25fc1aded1c1..000000000000 --- a/doc/users/next_whats_new/2020-01-24-lateshare.rst +++ /dev/null @@ -1,9 +0,0 @@ -`.Axes.sharex`, `.Axes.sharey` ------------------------------- - -These new methods allow sharing axes *immediately* after creating them. For -example, they can be used to selectively link some axes created all together -using `~.Figure.subplots`. - -Note that they may *not* be used to share axes after any operation (e.g., -drawing) has occurred on them. diff --git a/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst b/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst deleted file mode 100644 index f07212569b80..000000000000 --- a/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst +++ /dev/null @@ -1,10 +0,0 @@ -Set zorder of contour labels ----------------------------- - -`~.axes.Axes.clabel` now accepts a ``zorder`` kwarg -making it easier to set the ``zorder`` of contour labels. -If not specified, the default ``zorder`` of clabels used to always be 3 -(i.e. the default ``zorder`` of `~.text.Text`) irrespective of the ``zorder`` -passed to `~.axes.Axes.contour`/`~.axes.Axes.contourf`. -The new default ``zorder`` for clabels has been changed to (2 + ``zorder`` -passed to `~.axes.Axes.contour`/`~.axes.Axes.contourf`). diff --git a/doc/users/next_whats_new/2020-02-03-fontpath.rst b/doc/users/next_whats_new/2020-02-03-fontpath.rst deleted file mode 100644 index 463182e09253..000000000000 --- a/doc/users/next_whats_new/2020-02-03-fontpath.rst +++ /dev/null @@ -1,5 +0,0 @@ -Simple syntax to select fonts by absolute path ----------------------------------------------- - -Fonts can now be selected by passing an absolute `pathlib.Path` to the *font* -kwarg of `.Text`. diff --git a/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst b/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst deleted file mode 100644 index 476241f025ec..000000000000 --- a/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst +++ /dev/null @@ -1,6 +0,0 @@ -Add generalized "mathtext.fallback" rcParam -------------------------------------------- - -New "mathtext.fallback" rcParam. Takes "cm", "stix", "stixsans" -or "none" to turn fallback off. "mathtext.fallback_to_cm" is -deprecated, but if used, will override new fallback. diff --git a/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst b/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst deleted file mode 100644 index 89a270d138e6..000000000000 --- a/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst +++ /dev/null @@ -1,7 +0,0 @@ -Lines now accept ``MarkerStyle`` instances as input ---------------------------------------------------- - -Similar to `~.Axes.scatter`, `~.Axes.plot` and `~.lines.Line2D` now accept -`~.markers.MarkerStyle` instances as input for the *marker* parameter:: - - plt.plot(..., marker=matplotlib.markers.MarkerStyle("D")) diff --git a/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst b/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst deleted file mode 100644 index d788af983b5a..000000000000 --- a/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst +++ /dev/null @@ -1,8 +0,0 @@ -Allow tick formatters to be set with str or function inputs ------------------------------------------------------------ - -`~.Axis.set_major_formatter` and `~.Axis.set_minor_formatter` -now accept `str` or function inputs in addition to `~.ticker.Formatter` -instances. For a `str` a `~.ticker.StrMethodFormatter` is automatically -generated and used. For a function a `~.ticker.FuncFormatter` is automatically -generated and used. diff --git a/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst b/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst deleted file mode 100644 index c1d63d7a47d2..000000000000 --- a/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst +++ /dev/null @@ -1,6 +0,0 @@ -Cursor text now uses a number of significant digits matching pointing precision -------------------------------------------------------------------------------- - -Previously, the x/y position displayed by the cursor text would usually include -far more significant digits than the mouse pointing precision (typically one -pixel). This is now fixed for linear scales. diff --git a/doc/users/next_whats_new/2020-03-16-qtzoom.rst b/doc/users/next_whats_new/2020-03-16-qtzoom.rst deleted file mode 100644 index e3c2ece521fb..000000000000 --- a/doc/users/next_whats_new/2020-03-16-qtzoom.rst +++ /dev/null @@ -1,4 +0,0 @@ -Qt zoom rectangle now black and white -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This makes it visible even over a dark background. diff --git a/doc/users/next_whats_new/2020-03-24-svg-hatch-alpha.rst b/doc/users/next_whats_new/2020-03-24-svg-hatch-alpha.rst deleted file mode 100644 index 06e53cf5db1c..000000000000 --- a/doc/users/next_whats_new/2020-03-24-svg-hatch-alpha.rst +++ /dev/null @@ -1,6 +0,0 @@ -The SVG backend can now render hatches with transparency --------------------------------------------------------- - -The SVG backend now respects the hatch stroke alpha. Useful applications are, -among others, semi-transparent hatches as a subtle way to differentiate columns -in bar plots. diff --git a/doc/users/next_whats_new/2020-03-31-path-size-methods.rst b/doc/users/next_whats_new/2020-03-31-path-size-methods.rst deleted file mode 100644 index d2347fb3b9e5..000000000000 --- a/doc/users/next_whats_new/2020-03-31-path-size-methods.rst +++ /dev/null @@ -1,27 +0,0 @@ - -Functions to compute a Path's size ----------------------------------- - -Various functions were added to `~.bezier.BezierSegment` and `~.path.Path` to -allow computation of the shape/size of a `~.path.Path` and its composite Bezier -curves. - -In addition to the fixes below, `~.bezier.BezierSegment` has gained more -documentation and usability improvements, including properties that contain its -dimension, degree, control_points, and more. - -Better interface for Path segment iteration -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -`~.path.Path.iter_bezier` iterates through the `~.bezier.BezierSegment`'s that -make up the Path. This is much more useful typically than the existing -`~.path.Path.iter_segments` function, which returns the absolute minimum amount -of information possible to reconstruct the Path. - -Fixed bug that computed a Path's Bbox incorrectly -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Historically, `~.path.Path.get_extents` has always simply returned the Bbox of -a curve's control points, instead of the Bbox of the curve itself. While this is -a correct upper bound for the path's extents, it can differ dramatically from -the Path's actual extents for non-linear Bezier curves. diff --git a/doc/users/next_whats_new/2020-04-09-datetime-epoch-change.rst b/doc/users/next_whats_new/2020-04-09-datetime-epoch-change.rst deleted file mode 100644 index 11b1a244bd43..000000000000 --- a/doc/users/next_whats_new/2020-04-09-datetime-epoch-change.rst +++ /dev/null @@ -1,22 +0,0 @@ -Dates now use a modern epoch ----------------------------- - -Matplotlib converts dates to days since an epoch using `.dates.date2num` (via -`matplotlib.units`). Previously, an epoch of ``0000-12-31T00:00:00`` was used -so that ``0001-01-01`` was converted to 1.0. An epoch so distant in the -past meant that a modern date was not able to preserve microseconds because -2000 years times the 2^(-52) resolution of a 64-bit float gives 14 -microseconds. - -Here we change the default epoch to the more reasonable UNIX default of -``1970-01-01T00:00:00`` which for a modern date has 0.35 microsecond -resolution. (Finer resolution is not possible because we rely on -`datetime.datetime` for the date locators). Access to the epoch is provided -by `~.dates.get_epoch`, and there is a new :rc:`date.epoch` rcParam. The user -may also call `~.dates.set_epoch`, but it must be set *before* any date -conversion or plotting is used. - -If you have data stored as ordinal floats in the old epoch, a simple -conversion (using the new epoch) is:: - - new_ordinal = old_ordinal + mdates.date2num(np.datetime64('0000-12-31')) diff --git a/doc/users/next_whats_new/2020-04-13-AL.rst b/doc/users/next_whats_new/2020-04-13-AL.rst deleted file mode 100644 index c983acd48767..000000000000 --- a/doc/users/next_whats_new/2020-04-13-AL.rst +++ /dev/null @@ -1,8 +0,0 @@ -`.backend_bases.key_press_handler` and `.backend_bases.button_press_handler` simplifications --------------------------------------------------------------------------------------------- - -These event handlers can now be directly connected to a canvas with -``canvas.mpl_connect("key_press_event", key_press_handler)`` and -``canvas.mpl_connect("button_press_event", button_press_handler)``, rather than -having to write wrapper functions that fill in the (now optional) *canvas* and -*toolbar* parameters. diff --git a/doc/users/next_whats_new/2020-04-14-title-yparam.rst b/doc/users/next_whats_new/2020-04-14-title-yparam.rst deleted file mode 100644 index b2e30540b72f..000000000000 --- a/doc/users/next_whats_new/2020-04-14-title-yparam.rst +++ /dev/null @@ -1,9 +0,0 @@ -`~.axes.Axes.set_title` gains a y keyword argument to control auto positioning ------------------------------------------------------------------------------- - -`~.axes.Axes.set_title` tries to auto-position the title to avoid any -decorators on the top x-axis. This is not always desirable so now -*y* is an explicit keyword argument of `~.axes.Axes.set_title`. It -defaults to *None* which means to use auto-positioning. If a value is -supplied (i.e. the pre-3.0 default was ``y=1.0``) then auto-positioning is -turned off. This can also be set with the new rcParameter :rc:`axes.titley`. diff --git a/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst b/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst deleted file mode 100644 index b7202fef0aae..000000000000 --- a/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst +++ /dev/null @@ -1,2 +0,0 @@ -tight_layout now supports suptitle ----------------------------------- diff --git a/doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidth.rst b/doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidth.rst deleted file mode 100644 index fd77f92fda14..000000000000 --- a/doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidth.rst +++ /dev/null @@ -1,9 +0,0 @@ -Add :rc:`contour.linewidth` to rcParams ---------------------------------------- - -The new config option :rc:`contour.linewidth` allows to control the default -linewidth of contours as a float. When set to ``None``, the linewidths fall -back to :rc:`lines.linewidth`. The config value is overidden as usual -by the ``linewidths`` argument passed to `~.axes.Axes.contour` when -it is not set to ``None``. - diff --git a/doc/users/next_whats_new/imshow_m_n_1.rst b/doc/users/next_whats_new/imshow_m_n_1.rst deleted file mode 100644 index 429876154c48..000000000000 --- a/doc/users/next_whats_new/imshow_m_n_1.rst +++ /dev/null @@ -1,6 +0,0 @@ -Imshow now coerces 3D arrays with depth 1 to 2D ------------------------------------------------- - -Starting from this version arrays of size MxNx1 will be coerced into MxN -for displaying. This means commands like ``plt.imshow(np.random.rand(3, 3, 1))`` -will no longer return an error message that the image shape is invalid. diff --git a/doc/users/prev_whats_new/whats_new_3.3.0.rst b/doc/users/prev_whats_new/whats_new_3.3.0.rst new file mode 100644 index 000000000000..af3a33a57c84 --- /dev/null +++ b/doc/users/prev_whats_new/whats_new_3.3.0.rst @@ -0,0 +1,349 @@ + +What's new in Matplotlib 3.3.0 +============================== + +For a list of all of the issues and pull requests since the last +revision, see the :ref:`github-stats`. + +.. contents:: Table of Contents + :depth: 4 + +.. toctree:: + :maxdepth: 4 + + +New `~.axes.Axes.axline` method +------------------------------- + +A new `~.axes.Axes.axline` method has been added to draw infinitely long lines +that pass through two points. + + + +.. plot:: + :include-source: True + + fig, ax = plt.subplots() + + ax.axline((.1, .1), slope=5, color='C0', label='by slope') + ax.axline((.1, .2), (.8, .7), color='C3', label='by points') + + ax.legend() + + +Home/Forward/Backward buttons now work with 3D axes +--------------------------------------------------- + + +`matplotlib.rc_context` is now a `contextlib.contextmanager` +------------------------------------------------------------ + +`matplotlib.rc_context` can now be used as a decorator (technically, it is now +implemented as a `contextlib.contextmanager`), e.g. :: + + @rc_context({"lines.linewidth": 2}) + def some_function(...): + ... + + +``Axes3D`` no longer distorts the 3d plot to match the 2d aspect ratio +---------------------------------------------------------------------- + +Plots made with :class:`~mpl_toolkits.mplot3d.axes3d.Axes3D` were previously +stretched to fit a square bounding box. As this stretching was done after +the projection from 3D to 2D, it resulted in distorted images if non-square +bounding boxes were used. As of 3.3, this no longer occurs. + +Currently, modes of setting the aspect (via +`~mpl_toolkits.mplot3d.axes3d.Axes3D.set_aspect`) in data space are +not supported for Axes3D but may be in the future. If you want to +simulate having equal aspect in data space, set the ratio of your data +limits to match the value of `~.get_box_aspect`. To control these +ratios use the `~mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect` +method which accepts the ratios as a 3-tuple of X:Y:Z. The default +aspect ratio is 4:4:3. + + +GridSpec.subplots() +------------------- + +The `.GridSpec` class gained a `~.GridSpecBase.subplots` method, so that one +can write :: + + fig.add_gridspec(2, 2, height_ratios=[3, 1]).subplots() + +as an alternative to :: + + fig.subplots(2, 2, gridspec_kw={"height_ratios": [3, 1]}) + + +3D axes now support minor ticks +------------------------------- + + + +Setting axes box aspect +----------------------- + +It is now possible to set the aspect of an axes box directly via +`~.Axes.set_box_aspect`. The box aspect is the ratio between axes height +and axes width in physical units, independent of the data limits. +This is useful to e.g. produce a square plot, independent of the data it +contains, or to have a usual plot with the same axes dimensions next to +an image plot with fixed (data-)aspect. + +For use cases check out the :doc:`Axes box aspect +` example. + + + +rcParams for controlling default "raise window" behavior +-------------------------------------------------------- +The new config option :rc:`figure.raise_window` allows to disable +raising the plot window when calling `~.pyplot.show` or `~.pyplot.pause`. +``MacOSX`` backend is currently not supported. + + +``savefig()`` gained a ``backend`` keyword argument +--------------------------------------------------- + +The ``backend`` keyword argument to ``savefig`` can now be used to pick the +rendering backend without having to globally set the backend; e.g. one can save +pdfs using the pgf backend with ``savefig("file.pdf", backend="pgf")``. + + +Offset text is now set to the top when using axis.tick_top() +------------------------------------------------------------ + +Solves the issue that the power indicator (e.g. 1e4) stayed on the bottom, even if the ticks were on the top. + + +Text color for legend labels +---------------------------- + +The text color of legend labels can now be set by passing a parameter +``labelcolor`` to `~.axes.Axes.legend`. The ``labelcolor`` keyword can be: + +* A single color (either a string or RGBA tuple), which adjusts the text color + of all the labels. +* A list or tuple, allowing the text color of each label to be set + individually. +* ``linecolor``, which sets the text color of each label to match the + corresponding line color. +* ``markerfacecolor``, which sets the text color of each label to match the + corresponding marker face color. +* ``markeredgecolor``, which sets the text color of each label to match the + corresponding marker edge color. + + +Pcolor and Pcolormesh now accept shading='nearest' and 'auto' +------------------------------------------------------------- + +Previously `.axes.Axes.pcolor` and `.axes.Axes.pcolormesh` handled +the situation where *x* and *y* have the same (respective) size as *C* by +dropping the last row and column of *C*, and *x* and *y* are regarded as the +edges of the remaining rows and columns in *C*. However, many users want +*x* and *y* centered on the rows and columns of *C*. + +To accommodate this, ``shading='nearest'`` and ``shading='auto'`` are +new allowed strings for the ``shading`` kwarg. ``'nearest'`` will center the +color on *x* and *y* if *x* and *y* have the same dimensions as *C* +(otherwise an error will be thrown). ``shading='auto'`` will choose 'flat' +or 'nearest' based on the size of *X*, *Y*, *C*. + +If ``shading='flat'`` then *X*, and *Y* should have dimensions one larger +than *C*. If *X* and *Y* have the same dimensions as *C*, then the previous +behavior is used and the last row and column of *C* are dropped, and a +DeprecationWarning is emitted. + +Users can also specify this by the new :rc:`pcolor.shading` in their +``.matplotlibrc`` or via `.rcParams`. + +See :doc:`pcolormesh ` +for examples. + + +`.Axes.sharex`, `.Axes.sharey` +------------------------------ + +These new methods allow sharing axes *immediately* after creating them. For +example, they can be used to selectively link some axes created all together +using `~.Figure.subplots`. + +Note that they may *not* be used to share axes after any operation (e.g., +drawing) has occurred on them. + + +Set zorder of contour labels +---------------------------- + +`~.axes.Axes.clabel` now accepts a ``zorder`` kwarg +making it easier to set the ``zorder`` of contour labels. +If not specified, the default ``zorder`` of clabels used to always be 3 +(i.e. the default ``zorder`` of `~.text.Text`) irrespective of the ``zorder`` +passed to `~.axes.Axes.contour`/`~.axes.Axes.contourf`. +The new default ``zorder`` for clabels has been changed to (2 + ``zorder`` +passed to `~.axes.Axes.contour`/`~.axes.Axes.contourf`). + + +Simple syntax to select fonts by absolute path +---------------------------------------------- + +Fonts can now be selected by passing an absolute `pathlib.Path` to the *font* +kwarg of `.Text`. + + +Add generalized "mathtext.fallback" rcParam +------------------------------------------- + +New "mathtext.fallback" rcParam. Takes "cm", "stix", "stixsans" +or "none" to turn fallback off. "mathtext.fallback_to_cm" is +deprecated, but if used, will override new fallback. + + +Lines now accept ``MarkerStyle`` instances as input +--------------------------------------------------- + +Similar to `~.Axes.scatter`, `~.Axes.plot` and `~.lines.Line2D` now accept +`~.markers.MarkerStyle` instances as input for the *marker* parameter:: + + plt.plot(..., marker=matplotlib.markers.MarkerStyle("D")) + + +Allow tick formatters to be set with str or function inputs +----------------------------------------------------------- + +`~.Axis.set_major_formatter` and `~.Axis.set_minor_formatter` +now accept `str` or function inputs in addition to `~.ticker.Formatter` +instances. For a `str` a `~.ticker.StrMethodFormatter` is automatically +generated and used. For a function a `~.ticker.FuncFormatter` is automatically +generated and used. + + +Cursor text now uses a number of significant digits matching pointing precision +------------------------------------------------------------------------------- + +Previously, the x/y position displayed by the cursor text would usually include +far more significant digits than the mouse pointing precision (typically one +pixel). This is now fixed for linear scales. + + +Qt zoom rectangle now black and white +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This makes it visible even over a dark background. + + +The SVG backend can now render hatches with transparency +-------------------------------------------------------- + +The SVG backend now respects the hatch stroke alpha. Useful applications are, +among others, semi-transparent hatches as a subtle way to differentiate columns +in bar plots. + + + +Functions to compute a Path's size +---------------------------------- + +Various functions were added to `~.bezier.BezierSegment` and `~.path.Path` to +allow computation of the shape/size of a `~.path.Path` and its composite Bezier +curves. + +In addition to the fixes below, `~.bezier.BezierSegment` has gained more +documentation and usability improvements, including properties that contain its +dimension, degree, control_points, and more. + +Better interface for Path segment iteration +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`~.path.Path.iter_bezier` iterates through the `~.bezier.BezierSegment`'s that +make up the Path. This is much more useful typically than the existing +`~.path.Path.iter_segments` function, which returns the absolute minimum amount +of information possible to reconstruct the Path. + +Fixed bug that computed a Path's Bbox incorrectly +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Historically, `~.path.Path.get_extents` has always simply returned the Bbox of +a curve's control points, instead of the Bbox of the curve itself. While this is +a correct upper bound for the path's extents, it can differ dramatically from +the Path's actual extents for non-linear Bezier curves. + + +Dates now use a modern epoch +---------------------------- + +Matplotlib converts dates to days since an epoch using `.dates.date2num` (via +`matplotlib.units`). Previously, an epoch of ``0000-12-31T00:00:00`` was used +so that ``0001-01-01`` was converted to 1.0. An epoch so distant in the +past meant that a modern date was not able to preserve microseconds because +2000 years times the 2^(-52) resolution of a 64-bit float gives 14 +microseconds. + +Here we change the default epoch to the more reasonable UNIX default of +``1970-01-01T00:00:00`` which for a modern date has 0.35 microsecond +resolution. (Finer resolution is not possible because we rely on +`datetime.datetime` for the date locators). Access to the epoch is provided +by `~.dates.get_epoch`, and there is a new :rc:`date.epoch` rcParam. The user +may also call `~.dates.set_epoch`, but it must be set *before* any date +conversion or plotting is used. + +If you have data stored as ordinal floats in the old epoch, a simple +conversion (using the new epoch) is:: + + new_ordinal = old_ordinal + mdates.date2num(np.datetime64('0000-12-31')) + + +`.backend_bases.key_press_handler` and `.backend_bases.button_press_handler` simplifications +-------------------------------------------------------------------------------------------- + +These event handlers can now be directly connected to a canvas with +``canvas.mpl_connect("key_press_event", key_press_handler)`` and +``canvas.mpl_connect("button_press_event", button_press_handler)``, rather than +having to write wrapper functions that fill in the (now optional) *canvas* and +*toolbar* parameters. + + +`~.axes.Axes.set_title` gains a y keyword argument to control auto positioning +------------------------------------------------------------------------------ + +`~.axes.Axes.set_title` tries to auto-position the title to avoid any +decorators on the top x-axis. This is not always desirable so now +*y* is an explicit keyword argument of `~.axes.Axes.set_title`. It +defaults to *None* which means to use auto-positioning. If a value is +supplied (i.e. the pre-3.0 default was ``y=1.0``) then auto-positioning is +turned off. This can also be set with the new rcParameter :rc:`axes.titley`. + + +tight_layout now supports suptitle +---------------------------------- + + +Add :rc:`contour.linewidth` to rcParams +--------------------------------------- + +The new config option :rc:`contour.linewidth` allows to control the default +linewidth of contours as a float. When set to ``None``, the linewidths fall +back to :rc:`lines.linewidth`. The config value is overidden as usual +by the ``linewidths`` argument passed to `~.axes.Axes.contour` when +it is not set to ``None``. + + + + +Imshow now coerces 3D arrays with depth 1 to 2D +------------------------------------------------ + +Starting from this version arrays of size MxNx1 will be coerced into MxN +for displaying. This means commands like ``plt.imshow(np.random.rand(3, 3, 1))`` +will no longer return an error message that the image shape is invalid. + +Align labels to axes edges +-------------------------- + +`~.axes.Axes.set_xlabel`, `~.axes.Axes.set_ylabel` and `.ColorbarBase.set_label` +support a parameter ``loc`` for simplified positioning. Supported values are +'left', 'center', or 'right'. The default is controlled via +:rc:`xaxis.labelposition` and :rc:`yaxis.labelposition`; the Colorbar label +takes the rcParam based on its orientation. diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index 58bb464e21d8..d0703277aa02 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -25,4 +25,4 @@ What's New next_whats_new/* -.. include:: prev_whats_new/whats_new_3.2.0.rst +.. include:: prev_whats_new/whats_new_3.3.0.rst