Skip to content

What's new for 3.2.0 #15176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions doc/users/next_whats_new/2019-02-27-AL.rst

This file was deleted.

4 changes: 0 additions & 4 deletions doc/users/next_whats_new/2019-04-05-AL.rst

This file was deleted.

12 changes: 0 additions & 12 deletions doc/users/next_whats_new/2019-04-17-AL.rst

This file was deleted.

4 changes: 0 additions & 4 deletions doc/users/next_whats_new/2019-05-31-AL.rst

This file was deleted.

5 changes: 0 additions & 5 deletions doc/users/next_whats_new/2019-06-05-pdf-gouraud-alpha.rst

This file was deleted.

33 changes: 0 additions & 33 deletions doc/users/next_whats_new/2019-08-14-ES.rst

This file was deleted.

5 changes: 0 additions & 5 deletions doc/users/next_whats_new/bar3d_lightsource.rst

This file was deleted.

10 changes: 0 additions & 10 deletions doc/users/next_whats_new/errorbar_offsets.rst

This file was deleted.

13 changes: 0 additions & 13 deletions doc/users/next_whats_new/logit_scale_stuff.rst

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions doc/users/next_whats_new/shorthand_hex_colors.rst

This file was deleted.

123 changes: 123 additions & 0 deletions doc/users/prev_whats_new/whats_new_3.2.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@

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` 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`
------------------------
`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).

`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-shading alpha channel in 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 lightsource shading
-------------------------
bar3d now supports lighting from different angles when the *shade* parameter is
True, which can be configured using the ``lightsource`` parameter.

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]`.

`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 adapts to the scale.

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.

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``.
2 changes: 1 addition & 1 deletion doc/users/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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