From e340b454c167c8dd792b5d0baf0aff7d6996bb59 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Tue, 3 Sep 2019 18:07:47 +0100 Subject: [PATCH 1/3] What's new for 3.2.0 --- doc/users/next_whats_new/2019-02-27-AL.rst | 5 - doc/users/next_whats_new/2019-04-05-AL.rst | 4 - doc/users/next_whats_new/2019-04-17-AL.rst | 12 -- doc/users/next_whats_new/2019-05-31-AL.rst | 4 - .../2019-06-05-pdf-gouraud-alpha.rst | 5 - doc/users/next_whats_new/2019-08-14-ES.rst | 33 ----- .../next_whats_new/bar3d_lightsource.rst | 5 - doc/users/next_whats_new/errorbar_offsets.rst | 10 -- .../next_whats_new/logit_scale_stuff.rst | 13 -- .../rcparam-axes-title-location-color.rst | 9 -- .../next_whats_new/shorthand_hex_colors.rst | 6 - doc/users/prev_whats_new/whats_new_3.2.0.rst | 117 ++++++++++++++++++ doc/users/whats_new.rst | 2 +- 13 files changed, 118 insertions(+), 107 deletions(-) delete mode 100644 doc/users/next_whats_new/2019-02-27-AL.rst delete mode 100644 doc/users/next_whats_new/2019-04-05-AL.rst delete mode 100644 doc/users/next_whats_new/2019-04-17-AL.rst delete mode 100644 doc/users/next_whats_new/2019-05-31-AL.rst delete mode 100644 doc/users/next_whats_new/2019-06-05-pdf-gouraud-alpha.rst delete mode 100644 doc/users/next_whats_new/2019-08-14-ES.rst delete mode 100644 doc/users/next_whats_new/bar3d_lightsource.rst delete mode 100644 doc/users/next_whats_new/errorbar_offsets.rst delete mode 100644 doc/users/next_whats_new/logit_scale_stuff.rst delete mode 100644 doc/users/next_whats_new/rcparam-axes-title-location-color.rst delete mode 100644 doc/users/next_whats_new/shorthand_hex_colors.rst create mode 100644 doc/users/prev_whats_new/whats_new_3.2.0.rst diff --git a/doc/users/next_whats_new/2019-02-27-AL.rst b/doc/users/next_whats_new/2019-02-27-AL.rst deleted file mode 100644 index f6d1779f150a..000000000000 --- a/doc/users/next_whats_new/2019-02-27-AL.rst +++ /dev/null @@ -1,5 +0,0 @@ -Unit converters now handle instances of subclasses -`````````````````````````````````````````````````` - -Unit converters now also handle instances of subclasses of the class they have -been registered for. diff --git a/doc/users/next_whats_new/2019-04-05-AL.rst b/doc/users/next_whats_new/2019-04-05-AL.rst deleted file mode 100644 index 8016b8cfa3bf..000000000000 --- a/doc/users/next_whats_new/2019-04-05-AL.rst +++ /dev/null @@ -1,4 +0,0 @@ -`~pyplot.imsave` gained support for the ``metadata`` and ``pil_kwargs`` parameters -`````````````````````````````````````````````````````````````````````````````````` - -These parameters behave similarly as for the `Figure.savefig()` method. diff --git a/doc/users/next_whats_new/2019-04-17-AL.rst b/doc/users/next_whats_new/2019-04-17-AL.rst deleted file mode 100644 index ada0fcf49da3..000000000000 --- a/doc/users/next_whats_new/2019-04-17-AL.rst +++ /dev/null @@ -1,12 +0,0 @@ -`cbook.normalize_kwargs` can be used to normalize artist property names -``````````````````````````````````````````````````````````````````````` - -`cbook.normalize_kwargs` now presents a convenient interface to normalize -artist properties (e.g., from "lw" to "linewidth"): - ->>> cbook.normalize_kwargs({"lw": 1}, Line2D) -{"linewidth": 1} - -The first argument is the mapping to be normalized, and the second argument can -be an artist class or an artist instance (it can also be a mapping in a -specific format; see the function's docstring for details). diff --git a/doc/users/next_whats_new/2019-05-31-AL.rst b/doc/users/next_whats_new/2019-05-31-AL.rst deleted file mode 100644 index 320675f9f586..000000000000 --- a/doc/users/next_whats_new/2019-05-31-AL.rst +++ /dev/null @@ -1,4 +0,0 @@ -The *fname* argument to `FontProperties` can now be an `os.PathLike`\s -`````````````````````````````````````````````````````````````````````` - -e.g. ``FontProperties(fname=pathlib.Path("/path/to/font.ttf"))``. diff --git a/doc/users/next_whats_new/2019-06-05-pdf-gouraud-alpha.rst b/doc/users/next_whats_new/2019-06-05-pdf-gouraud-alpha.rst deleted file mode 100644 index 6c336c810998..000000000000 --- a/doc/users/next_whats_new/2019-06-05-pdf-gouraud-alpha.rst +++ /dev/null @@ -1,5 +0,0 @@ -Gouraud-shaded mesh alpha channels in the pdf backend ------------------------------------------------------ - -The pdf backend now supports an alpha channel in Gouraud-shaded -triangle meshes. diff --git a/doc/users/next_whats_new/2019-08-14-ES.rst b/doc/users/next_whats_new/2019-08-14-ES.rst deleted file mode 100644 index b29221bc91cf..000000000000 --- a/doc/users/next_whats_new/2019-08-14-ES.rst +++ /dev/null @@ -1,33 +0,0 @@ -Kerning adjustments now use correct values ------------------------------------------- - -Due to an error in how kerning adjustments were applied, previous versions of -Matplotlib would under-correct kerning. This version will now correctly apply -kerning (for fonts supported by FreeType). To restore the old behavior (e.g., -for test images), you may set :rc:`text.kerning_factor` to 6 (instead of 0). -Other values have undefined behavior. - -.. plot:: - - import matplotlib.pyplot as plt - - # Use old kerning values: - plt.rcParams['text.kerning_factor'] = 6 - fig, ax = plt.subplots() - ax.text(0.0, 0.05, 'BRAVO\nAWKWARD\nVAT\nW.Test', fontsize=56) - ax.set_title('Before (text.kerning_factor = 6)') - -Note how the spacing between characters is uniform between their bounding boxes -(above). With corrected kerning (below), slanted characters (e.g., AV or VA) -will be spaced closer together, as well as various other character pairs, -depending on font support (e.g., T and e, or the period after the W). - -.. plot:: - - import matplotlib.pyplot as plt - - # Use new kerning values: - plt.rcParams['text.kerning_factor'] = 0 - fig, ax = plt.subplots() - ax.text(0.0, 0.05, 'BRAVO\nAWKWARD\nVAT\nW.Test', fontsize=56) - ax.set_title('After (text.kerning_factor = 0)') diff --git a/doc/users/next_whats_new/bar3d_lightsource.rst b/doc/users/next_whats_new/bar3d_lightsource.rst deleted file mode 100644 index 906699adcfbe..000000000000 --- a/doc/users/next_whats_new/bar3d_lightsource.rst +++ /dev/null @@ -1,5 +0,0 @@ -bar3d gained support for the ``lightsource`` parameter ------------------------------------------------------- - -bar3d now supports lighting from different angles when the *shade* parameter is -True. diff --git a/doc/users/next_whats_new/errorbar_offsets.rst b/doc/users/next_whats_new/errorbar_offsets.rst deleted file mode 100644 index b2ca9f7a23c5..000000000000 --- a/doc/users/next_whats_new/errorbar_offsets.rst +++ /dev/null @@ -1,10 +0,0 @@ -Errorbar plots can shift which points have error bars ------------------------------------------------------ - -Previously, `plt.errorbar()` accepted a kwarg `errorevery` such that the -command `plt.errorbar(x, y, yerr, errorevery=6)` would add error bars to -datapoints `x[::6], y[::6]`. - -`errorbar()` now also accepts a tuple for `errorevery` such that -`plt.errorbar(x, y, yerr, errorevery=(start, N))` adds error bars to points -`x[start::N], y[start::N]`. diff --git a/doc/users/next_whats_new/logit_scale_stuff.rst b/doc/users/next_whats_new/logit_scale_stuff.rst deleted file mode 100644 index aeb44a2e4c15..000000000000 --- a/doc/users/next_whats_new/logit_scale_stuff.rst +++ /dev/null @@ -1,13 +0,0 @@ -Improvements in Logit scale ticker and formatter ------------------------------------------------- - -Introduced in version 1.5, the logit scale didn't have an appropriate ticker and -formatter. Previously, the location of ticks was not zoom dependent, too many labels -were displayed causing overlapping which broke readability, and label formatting -did not adapt to precision. - -Starting from this version, the logit locator has nearly the same behavior as the -locator for the log scale or the linear -scale, depending on used zoom. The number of ticks is controlled. Some minor -labels are displayed adaptively as sublabels in log scale. Formatting is adapted -for probabilities and the precision is adapts to the scale. diff --git a/doc/users/next_whats_new/rcparam-axes-title-location-color.rst b/doc/users/next_whats_new/rcparam-axes-title-location-color.rst deleted file mode 100644 index 710f1265e7ff..000000000000 --- a/doc/users/next_whats_new/rcparam-axes-title-location-color.rst +++ /dev/null @@ -1,9 +0,0 @@ -rcParams for default axes title location and color --------------------------------------------------- - -Two new rcParams have been added: ``axes.titlelocation`` denotes the default axes title -alignment, and ``axes.titlecolor`` the default axes title color. - -Valid values for ``axes.titlelocation`` are: left, center, and right. -Valid values for ``axes.titlecolor`` are: auto or a color. Setting it to auto -will fall back to previous behaviour, which is using the color in ``text.color``. diff --git a/doc/users/next_whats_new/shorthand_hex_colors.rst b/doc/users/next_whats_new/shorthand_hex_colors.rst deleted file mode 100644 index a4b0c14c2055..000000000000 --- a/doc/users/next_whats_new/shorthand_hex_colors.rst +++ /dev/null @@ -1,6 +0,0 @@ -3-digit and 4-digit hex colors ------------------------------- - -Colors can now be specified using 3-digit or 4-digit hex colors, shorthand for -the colors obtained by duplicating each character, e.g. ``#123`` is equivalent to -``#112233`` and ``#123a`` is equivalent to ``#112233aa``. \ No newline at end of file diff --git a/doc/users/prev_whats_new/whats_new_3.2.0.rst b/doc/users/prev_whats_new/whats_new_3.2.0.rst new file mode 100644 index 000000000000..ec2f00809d57 --- /dev/null +++ b/doc/users/prev_whats_new/whats_new_3.2.0.rst @@ -0,0 +1,117 @@ +Unit converters now handle instances of subclasses +`````````````````````````````````````````````````` +Unit converters now also handle instances of subclasses of the class they have +been registered for. + +`~pyplot.imsave` gained support for the ``metadata`` and ``pil_kwargs`` parameters +`````````````````````````````````````````````````````````````````````````````````` +These parameters behave similarly as for the `Figure.savefig()` method. + + +`cbook.normalize_kwargs` can be used to normalize artist property names +``````````````````````````````````````````````````````````````````````` +`cbook.normalize_kwargs` now presents a convenient interface to normalize +artist properties (e.g., from "lw" to "linewidth"): + +>>> cbook.normalize_kwargs({"lw": 1}, Line2D) +{"linewidth": 1} + +The first argument is the mapping to be normalized, and the second argument can +be an artist class or an artist instance (it can also be a mapping in a +specific format; see the function's docstring for details). + +The *fname* argument to `FontProperties` can now be an `os.PathLike`\s +`````````````````````````````````````````````````````````````````````` +e.g. ``FontProperties(fname=pathlib.Path("/path/to/font.ttf"))``. + +Gouraud-shaded mesh alpha channels in the pdf backend +----------------------------------------------------- +The pdf backend now supports an alpha channel in Gouraud-shaded +triangle meshes. + +Kerning adjustments now use correct values +------------------------------------------ +Due to an error in how kerning adjustments were applied, previous versions of +Matplotlib would under-correct kerning. This version will now correctly apply +kerning (for fonts supported by FreeType). To restore the old behavior (e.g., +for test images), you may set :rc:`text.kerning_factor` to 6 (instead of 0). +Other values have undefined behavior. + +.. plot:: + + import matplotlib.pyplot as plt + + # Use old kerning values: + plt.rcParams['text.kerning_factor'] = 6 + fig, ax = plt.subplots() + ax.text(0.0, 0.05, 'BRAVO\nAWKWARD\nVAT\nW.Test', fontsize=56) + ax.set_title('Before (text.kerning_factor = 6)') + +Note how the spacing between characters is uniform between their bounding boxes +(above). With corrected kerning (below), slanted characters (e.g., AV or VA) +will be spaced closer together, as well as various other character pairs, +depending on font support (e.g., T and e, or the period after the W). + +.. plot:: + + import matplotlib.pyplot as plt + + # Use new kerning values: + plt.rcParams['text.kerning_factor'] = 0 + fig, ax = plt.subplots() + ax.text(0.0, 0.05, 'BRAVO\nAWKWARD\nVAT\nW.Test', fontsize=56) + ax.set_title('After (text.kerning_factor = 0)') + + +bar3d gained support for the ``lightsource`` parameter +------------------------------------------------------ +bar3d now supports lighting from different angles when the *shade* parameter is +True. + +Errorbar plots can shift which points have error bars +----------------------------------------------------- +Previously, `plt.errorbar()` accepted a kwarg `errorevery` such that the +command `plt.errorbar(x, y, yerr, errorevery=6)` would add error bars to +datapoints `x[::6], y[::6]`. + +`errorbar()` now also accepts a tuple for `errorevery` such that +`plt.errorbar(x, y, yerr, errorevery=(start, N))` adds error bars to points +`x[start::N], y[start::N]`. + +Errorbar plots can shift which points have error bars +----------------------------------------------------- +Previously, `plt.errorbar()` accepted a kwarg `errorevery` such that the +command `plt.errorbar(x, y, yerr, errorevery=6)` would add error bars to +datapoints `x[::6], y[::6]`. + +`errorbar()` now also accepts a tuple for `errorevery` such that +`plt.errorbar(x, y, yerr, errorevery=(start, N))` adds error bars to points +`x[start::N], y[start::N]`. + +Improvements in Logit scale ticker and formatter +------------------------------------------------ +Introduced in version 1.5, the logit scale didn't have an appropriate ticker and +formatter. Previously, the location of ticks was not zoom dependent, too many labels +were displayed causing overlapping which broke readability, and label formatting +did not adapt to precision. + +Starting from this version, the logit locator has nearly the same behavior as the +locator for the log scale or the linear +scale, depending on used zoom. The number of ticks is controlled. Some minor +labels are displayed adaptively as sublabels in log scale. Formatting is adapted +for probabilities and the precision is adapts to the scale. + +rcParams for default axes title location and color +-------------------------------------------------- +Two new rcParams have been added: ``axes.titlelocation`` denotes the default axes title +alignment, and ``axes.titlecolor`` the default axes title color. + +Valid values for ``axes.titlelocation`` are: left, center, and right. +Valid values for ``axes.titlecolor`` are: auto or a color. Setting it to auto +will fall back to previous behaviour, which is using the color in ``text.color``. + +3-digit and 4-digit hex colors +------------------------------ +Colors can now be specified using 3-digit or 4-digit hex colors, shorthand for +the colors obtained by duplicating each character, e.g. ``#123`` is equivalent to +``#112233`` and ``#123a`` is equivalent to ``#112233aa``. diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index fd437ad3d9ed..f5f4497a7ea0 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -25,4 +25,4 @@ Whats New next_whats_new/* -.. include:: prev_whats_new/whats_new_3.1.0.rst +.. include:: prev_whats_new/whats_new_3.2.0.rst From 48be741501122bddefc44fcfd2aec42b7235bda0 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Tue, 3 Sep 2019 18:13:44 +0100 Subject: [PATCH 2/3] Title copy-edit --- doc/users/prev_whats_new/whats_new_3.2.0.rst | 62 +++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/doc/users/prev_whats_new/whats_new_3.2.0.rst b/doc/users/prev_whats_new/whats_new_3.2.0.rst index ec2f00809d57..b1cd30030a46 100644 --- a/doc/users/prev_whats_new/whats_new_3.2.0.rst +++ b/doc/users/prev_whats_new/whats_new_3.2.0.rst @@ -1,15 +1,30 @@ -Unit converters now handle instances of subclasses -`````````````````````````````````````````````````` + +What's new in Matplotlib 3.2 +============================ + +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 + + +Unit converters and subclasses +------------------------------ Unit converters now also handle instances of subclasses of the class they have been registered for. -`~pyplot.imsave` gained support for the ``metadata`` and ``pil_kwargs`` parameters -`````````````````````````````````````````````````````````````````````````````````` -These parameters behave similarly as for the `Figure.savefig()` method. +`~pyplot.imsave` metadata and PIL options +----------------------------------------- +`~pyplot.imsave` has gained support for the ``metadata`` and ``pil_kwargs`` +parameters. These parameters behave similarly as for the `Figure.savefig()` +method. - -`cbook.normalize_kwargs` can be used to normalize artist property names -``````````````````````````````````````````````````````````````````````` +`cbook.normalize_kwargs` +------------------------ `cbook.normalize_kwargs` now presents a convenient interface to normalize artist properties (e.g., from "lw" to "linewidth"): @@ -20,12 +35,13 @@ The first argument is the mapping to be normalized, and the second argument can be an artist class or an artist instance (it can also be a mapping in a specific format; see the function's docstring for details). +`FontProperties` and `os.PathLike` +---------------------------------- The *fname* argument to `FontProperties` can now be an `os.PathLike`\s -`````````````````````````````````````````````````````````````````````` e.g. ``FontProperties(fname=pathlib.Path("/path/to/font.ttf"))``. -Gouraud-shaded mesh alpha channels in the pdf backend ------------------------------------------------------ +Gouraud-shading alpha channel in PDF backend +-------------------------------------------- The pdf backend now supports an alpha channel in Gouraud-shaded triangle meshes. @@ -63,23 +79,13 @@ depending on font support (e.g., T and e, or the period after the W). ax.set_title('After (text.kerning_factor = 0)') -bar3d gained support for the ``lightsource`` parameter ------------------------------------------------------- +bar3d lightsource shading +------------------------- bar3d now supports lighting from different angles when the *shade* parameter is -True. +True, which can be configured using the ``lightsource`` parameter. -Errorbar plots can shift which points have error bars ------------------------------------------------------ -Previously, `plt.errorbar()` accepted a kwarg `errorevery` such that the -command `plt.errorbar(x, y, yerr, errorevery=6)` would add error bars to -datapoints `x[::6], y[::6]`. - -`errorbar()` now also accepts a tuple for `errorevery` such that -`plt.errorbar(x, y, yerr, errorevery=(start, N))` adds error bars to points -`x[start::N], y[start::N]`. - -Errorbar plots can shift which points have error bars ------------------------------------------------------ +Shifting errorbars +------------------ Previously, `plt.errorbar()` accepted a kwarg `errorevery` such that the command `plt.errorbar(x, y, yerr, errorevery=6)` would add error bars to datapoints `x[::6], y[::6]`. @@ -101,8 +107,8 @@ scale, depending on used zoom. The number of ticks is controlled. Some minor labels are displayed adaptively as sublabels in log scale. Formatting is adapted for probabilities and the precision is adapts to the scale. -rcParams for default axes title location and color --------------------------------------------------- +rcParams for axes title location and color +------------------------------------------ Two new rcParams have been added: ``axes.titlelocation`` denotes the default axes title alignment, and ``axes.titlecolor`` the default axes title color. From 735e7fe96fa086d8af2db86c216857c256e71cb0 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Wed, 4 Sep 2019 09:00:04 +0200 Subject: [PATCH 3/3] DOC small typo is adapts -> adapts in whats_new_3.2.0.rst --- doc/users/prev_whats_new/whats_new_3.2.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/prev_whats_new/whats_new_3.2.0.rst b/doc/users/prev_whats_new/whats_new_3.2.0.rst index b1cd30030a46..4542a44d556c 100644 --- a/doc/users/prev_whats_new/whats_new_3.2.0.rst +++ b/doc/users/prev_whats_new/whats_new_3.2.0.rst @@ -105,7 +105,7 @@ Starting from this version, the logit locator has nearly the same behavior as th locator for the log scale or the linear scale, depending on used zoom. The number of ticks is controlled. Some minor labels are displayed adaptively as sublabels in log scale. Formatting is adapted -for probabilities and the precision is adapts to the scale. +for probabilities and the precision adapts to the scale. rcParams for axes title location and color ------------------------------------------