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

Skip to content

Commit 5a15e2a

Browse files
committed
DOC: fill in remaining whats new entries
1 parent 3a58899 commit 5a15e2a

File tree

1 file changed

+111
-65
lines changed

1 file changed

+111
-65
lines changed

doc/users/whats_new.rst

Lines changed: 111 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,53 @@ revision, see the :ref:`github-stats`.
2424
New in Matplotlib 2.1
2525
=====================
2626

27+
Documentation
28+
+++++++++++++
29+
30+
The examples have been migrated to use sphinx gallery. This allows
31+
better mixing of prose and code in the examples, provides links to
32+
download the examples as both a python script and a Jupyter notebook,
33+
and improves the thumbnail galleries. The examples have been
34+
re-organized into :ref:`tutorials` and a :ref:`gallery`.
35+
36+
Many docstrings and examples have been clarified and improved.
37+
38+
2739
New features
2840
++++++++++++
2941

3042
String categorical values
3143
-------------------------
3244

33-
TODO
45+
All plotting functions now support string categorical values as input.
46+
For example:
47+
48+
.. plot::
49+
:include-source:
50+
:align: center
51+
52+
data = {'apples':10, 'oranges':15, 'lemons':5, 'limes':20}
53+
fig, ax = plt.subplots()
54+
ax.bar(data.keys(), data.values(), color='lightgray')
55+
56+
57+
Interactive JS widgets for animation
58+
------------------------------------
59+
60+
Jake Vanderplas' JSAnimation package has been merged into matplotlib. This
61+
adds to matplotlib the `~matplotlib.animation.HTMLWriter` class for
62+
generating a javascript HTML animation, suitable for the IPython notebook.
63+
This can be activated by default by setting the ``animation.html`` rc
64+
parameter to ``jshtml``. One can also call the
65+
`~matplotlib.animation.Animation.to_jshtml` method to manually convert an
66+
animation. This can be displayed using IPython's ``HTML`` display class::
67+
68+
from IPython.display import HTML
69+
HTML(animation.to_jshtml())
70+
71+
The `~matplotlib.animation.HTMLWriter` class can also be used to generate
72+
an HTML file by asking for the ``html`` writer.
73+
3474

3575
Enhancements to polar plot
3676
--------------------------
@@ -77,22 +117,14 @@ be useful to rotate tick *labels* to match the boundary. Calling
77117
labels will be parallel to the circular grid line, and angular tick labels will
78118
be perpendicular to the grid line (i.e., parallel to the outer boundary.)
79119

80-
Interactive JS widgets for animation
81-
------------------------------------
82120

83-
Jake Vanderplas' JSAnimation package has been merged into matplotlib. This
84-
adds to matplotlib the `~matplotlib.animation.HTMLWriter` class for
85-
generating a javascript HTML animation, suitable for the IPython notebook.
86-
This can be activated by default by setting the ``animation.html`` rc
87-
parameter to ``jshtml``. One can also call the
88-
`~matplotlib.animation.Animation.to_jshtml` method to manually convert an
89-
animation. This can be displayed using IPython's ``HTML`` display class::
121+
``Figure`` class now has ``subplots`` method
122+
--------------------------------------------
90123

91-
from IPython.display import HTML
92-
HTML(animation.to_jshtml())
124+
The :class:`~matplotlib.figure.Figure` class now has a
125+
:meth:`~matplotlib.figure.Figure.subplots` method which behaves the same as
126+
:func:`.pyplot.subplots` but on an existing figure.
93127

94-
The `~matplotlib.animation.HTMLWriter` class can also be used to generate
95-
an HTML file by asking for the ``html`` writer.
96128

97129
Metadata savefig keyword argument
98130
---------------------------------
@@ -115,6 +147,58 @@ Example
115147
plt.savefig('test.png', metadata={'Software': 'My awesome software'})
116148

117149

150+
Busy Cursor
151+
-----------
152+
153+
The interactive GUI backends will now change the cursor to busy when
154+
Matplotlib is rendering the canvas.
155+
156+
PolygonSelector
157+
---------------
158+
159+
A :class:`~matplotlib.widgets.PolygonSelector` class has been added to
160+
:mod:`matplotlib.widgets`. See
161+
:ref:`sphx_glr_gallery_widgets_polygon_selector_demo.py` for details.
162+
163+
164+
Added `matplotlib.ticker.PercentFormatter`
165+
------------------------------------------
166+
167+
The new `~matplotlib.ticker.PercentFormatter` formatter has some nice
168+
features like being able to convert from arbitrary data scales to
169+
percents, a customizable percent symbol and either automatic or manual
170+
control over the decimal points.
171+
172+
173+
Reproducible PS, PDF and SVG output
174+
-----------------------------------
175+
176+
The ``SOURCE_DATE_EPOCH`` environment variable can now be used to set
177+
the timestamp value in the PS and PDF outputs. See
178+
https://reproducible-builds.org/specs/source-date-epoch/
179+
180+
Alternatively, calling ``savefig`` with ``metadata={'creationDate': None}``
181+
will omit the timestamp altogether.
182+
183+
The reproducibility of the output from the PS and PDF backends has so
184+
far been tested using various plot elements but only default values of
185+
options such as ``{ps,pdf}.fonttype`` that can affect the output at a
186+
low level, and not with the mathtext or usetex features. When
187+
matplotlib calls external tools (such as PS distillers or LaTeX) their
188+
versions need to be kept constant for reproducibility, and they may
189+
add sources of nondeterminism outside the control of matplotlib.
190+
191+
For SVG output, the ``svg.hashsalt`` rc parameter has been added in an
192+
earlier release. This parameter changes some random identifiers in the
193+
SVG file to be deterministic. The downside of this setting is that if
194+
more than one file is generated using deterministic identifiers
195+
and they end up as parts of one larger document, the identifiers can
196+
collide and cause the different parts to affect each other.
197+
198+
These features are now enabled in the tests for the PDF and SVG
199+
backends, so most test output files (but not all of them) are now
200+
deterministic.
201+
118202
Orthographic projection for mplot3d
119203
-----------------------------------
120204
:class:`~mpl_toolkits.mplot3d.axes3d.Axes3D` now accepts ``proj_type`` keyword
@@ -163,51 +247,6 @@ volumetric model.
163247
Voxel Demo
164248

165249

166-
Added `matplotlib.ticker.PercentFormatter`
167-
------------------------------------------
168-
169-
The new `~matplotlib.ticker.PercentFormatter` formatter has some nice
170-
features like being able to convert from arbitrary data scales to
171-
percents, a customizable percent symbol and either automatic or manual
172-
control over the decimal points.
173-
174-
175-
Reproducible PS, PDF and SVG output
176-
-----------------------------------
177-
178-
The ``SOURCE_DATE_EPOCH`` environment variable can now be used to set
179-
the timestamp value in the PS and PDF outputs. See
180-
https://reproducible-builds.org/specs/source-date-epoch/
181-
182-
Alternatively, calling ``savefig`` with ``metadata={'creationDate': None}``
183-
will omit the timestamp altogether.
184-
185-
The reproducibility of the output from the PS and PDF backends has so
186-
far been tested using various plot elements but only default values of
187-
options such as ``{ps,pdf}.fonttype`` that can affect the output at a
188-
low level, and not with the mathtext or usetex features. When
189-
matplotlib calls external tools (such as PS distillers or LaTeX) their
190-
versions need to be kept constant for reproducibility, and they may
191-
add sources of nondeterminism outside the control of matplotlib.
192-
193-
For SVG output, the ``svg.hashsalt`` rc parameter has been added in an
194-
earlier release. This parameter changes some random identifiers in the
195-
SVG file to be deterministic. The downside of this setting is that if
196-
more than one file is generated using deterministic identifiers
197-
and they end up as parts of one larger document, the identifiers can
198-
collide and cause the different parts to affect each other.
199-
200-
These features are now enabled in the tests for the PDF and SVG
201-
backends, so most test output files (but not all of them) are now
202-
deterministic.
203-
204-
205-
``Figure`` class now has ``subplots`` method
206-
--------------------------------------------
207-
208-
TODO WRITE THIS
209-
210-
211250
Improvements
212251
++++++++++++
213252

@@ -485,15 +524,17 @@ Extend ``MATPLOTLIBRC`` behavior
485524
The environmental variable can now specify the full file path or path
486525
to find :file:`matplotlibrc` in.
487526

488-
Improvements to Qt plot options
489-
-------------------------------
490527

491-
TODO write
528+
``density`` kwarg to hist
529+
-------------------------
530+
531+
The :meth:`~matplotlib.axes.Axes.hist` method now prefers ``density``
532+
to ``normed`` to control if the histogram should be normalized,
533+
following a change upstream to numpy. This will reduce confusion as
534+
the behavior has always been that the integral of the histogram is 1
535+
(rather than sum or maximum value).
492536

493-
Added style sheets
494-
------------------
495537

496-
TODO write
497538

498539
Internals
499540
+++++++++
@@ -587,6 +628,11 @@ set ``path.simplify`` to false and/or ``path.simplify_threshold`` to ``0``.
587628
Matplotlib currently defaults to a conservative value of ``1/9``, smaller
588629
values are unlikely to cause any visible differences in your plots.
589630

631+
Implement intersects_bbox in c++
632+
--------------------------------
633+
634+
:meth:`~matplotlib.path.Path.intersects_bbox` has been implemented in
635+
c++ which improves the performance of automatically placing the legend.
590636

591637

592638
Previous Whats New

0 commit comments

Comments
 (0)