Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e340b45

Browse files
committed
What's new for 3.2.0
1 parent e67c2fb commit e340b45

13 files changed

+118
-107
lines changed

doc/users/next_whats_new/2019-02-27-AL.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

doc/users/next_whats_new/2019-04-05-AL.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

doc/users/next_whats_new/2019-04-17-AL.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

doc/users/next_whats_new/2019-05-31-AL.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

doc/users/next_whats_new/2019-06-05-pdf-gouraud-alpha.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

doc/users/next_whats_new/2019-08-14-ES.rst

Lines changed: 0 additions & 33 deletions
This file was deleted.

doc/users/next_whats_new/bar3d_lightsource.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

doc/users/next_whats_new/errorbar_offsets.rst

Lines changed: 0 additions & 10 deletions
This file was deleted.

doc/users/next_whats_new/logit_scale_stuff.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

doc/users/next_whats_new/rcparam-axes-title-location-color.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

doc/users/next_whats_new/shorthand_hex_colors.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
Unit converters now handle instances of subclasses
2+
``````````````````````````````````````````````````
3+
Unit converters now also handle instances of subclasses of the class they have
4+
been registered for.
5+
6+
`~pyplot.imsave` gained support for the ``metadata`` and ``pil_kwargs`` parameters
7+
``````````````````````````````````````````````````````````````````````````````````
8+
These parameters behave similarly as for the `Figure.savefig()` method.
9+
10+
11+
`cbook.normalize_kwargs` can be used to normalize artist property names
12+
```````````````````````````````````````````````````````````````````````
13+
`cbook.normalize_kwargs` now presents a convenient interface to normalize
14+
artist properties (e.g., from "lw" to "linewidth"):
15+
16+
>>> cbook.normalize_kwargs({"lw": 1}, Line2D)
17+
{"linewidth": 1}
18+
19+
The first argument is the mapping to be normalized, and the second argument can
20+
be an artist class or an artist instance (it can also be a mapping in a
21+
specific format; see the function's docstring for details).
22+
23+
The *fname* argument to `FontProperties` can now be an `os.PathLike`\s
24+
``````````````````````````````````````````````````````````````````````
25+
e.g. ``FontProperties(fname=pathlib.Path("/path/to/font.ttf"))``.
26+
27+
Gouraud-shaded mesh alpha channels in the pdf backend
28+
-----------------------------------------------------
29+
The pdf backend now supports an alpha channel in Gouraud-shaded
30+
triangle meshes.
31+
32+
Kerning adjustments now use correct values
33+
------------------------------------------
34+
Due to an error in how kerning adjustments were applied, previous versions of
35+
Matplotlib would under-correct kerning. This version will now correctly apply
36+
kerning (for fonts supported by FreeType). To restore the old behavior (e.g.,
37+
for test images), you may set :rc:`text.kerning_factor` to 6 (instead of 0).
38+
Other values have undefined behavior.
39+
40+
.. plot::
41+
42+
import matplotlib.pyplot as plt
43+
44+
# Use old kerning values:
45+
plt.rcParams['text.kerning_factor'] = 6
46+
fig, ax = plt.subplots()
47+
ax.text(0.0, 0.05, 'BRAVO\nAWKWARD\nVAT\nW.Test', fontsize=56)
48+
ax.set_title('Before (text.kerning_factor = 6)')
49+
50+
Note how the spacing between characters is uniform between their bounding boxes
51+
(above). With corrected kerning (below), slanted characters (e.g., AV or VA)
52+
will be spaced closer together, as well as various other character pairs,
53+
depending on font support (e.g., T and e, or the period after the W).
54+
55+
.. plot::
56+
57+
import matplotlib.pyplot as plt
58+
59+
# Use new kerning values:
60+
plt.rcParams['text.kerning_factor'] = 0
61+
fig, ax = plt.subplots()
62+
ax.text(0.0, 0.05, 'BRAVO\nAWKWARD\nVAT\nW.Test', fontsize=56)
63+
ax.set_title('After (text.kerning_factor = 0)')
64+
65+
66+
bar3d gained support for the ``lightsource`` parameter
67+
------------------------------------------------------
68+
bar3d now supports lighting from different angles when the *shade* parameter is
69+
True.
70+
71+
Errorbar plots can shift which points have error bars
72+
-----------------------------------------------------
73+
Previously, `plt.errorbar()` accepted a kwarg `errorevery` such that the
74+
command `plt.errorbar(x, y, yerr, errorevery=6)` would add error bars to
75+
datapoints `x[::6], y[::6]`.
76+
77+
`errorbar()` now also accepts a tuple for `errorevery` such that
78+
`plt.errorbar(x, y, yerr, errorevery=(start, N))` adds error bars to points
79+
`x[start::N], y[start::N]`.
80+
81+
Errorbar plots can shift which points have error bars
82+
-----------------------------------------------------
83+
Previously, `plt.errorbar()` accepted a kwarg `errorevery` such that the
84+
command `plt.errorbar(x, y, yerr, errorevery=6)` would add error bars to
85+
datapoints `x[::6], y[::6]`.
86+
87+
`errorbar()` now also accepts a tuple for `errorevery` such that
88+
`plt.errorbar(x, y, yerr, errorevery=(start, N))` adds error bars to points
89+
`x[start::N], y[start::N]`.
90+
91+
Improvements in Logit scale ticker and formatter
92+
------------------------------------------------
93+
Introduced in version 1.5, the logit scale didn't have an appropriate ticker and
94+
formatter. Previously, the location of ticks was not zoom dependent, too many labels
95+
were displayed causing overlapping which broke readability, and label formatting
96+
did not adapt to precision.
97+
98+
Starting from this version, the logit locator has nearly the same behavior as the
99+
locator for the log scale or the linear
100+
scale, depending on used zoom. The number of ticks is controlled. Some minor
101+
labels are displayed adaptively as sublabels in log scale. Formatting is adapted
102+
for probabilities and the precision is adapts to the scale.
103+
104+
rcParams for default axes title location and color
105+
--------------------------------------------------
106+
Two new rcParams have been added: ``axes.titlelocation`` denotes the default axes title
107+
alignment, and ``axes.titlecolor`` the default axes title color.
108+
109+
Valid values for ``axes.titlelocation`` are: left, center, and right.
110+
Valid values for ``axes.titlecolor`` are: auto or a color. Setting it to auto
111+
will fall back to previous behaviour, which is using the color in ``text.color``.
112+
113+
3-digit and 4-digit hex colors
114+
------------------------------
115+
Colors can now be specified using 3-digit or 4-digit hex colors, shorthand for
116+
the colors obtained by duplicating each character, e.g. ``#123`` is equivalent to
117+
``#112233`` and ``#123a`` is equivalent to ``#112233aa``.

doc/users/whats_new.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ Whats New
2525

2626
next_whats_new/*
2727

28-
.. include:: prev_whats_new/whats_new_3.1.0.rst
28+
.. include:: prev_whats_new/whats_new_3.2.0.rst

0 commit comments

Comments
 (0)