8000 Merge branch 'master' into fix10788 · matplotlib/matplotlib@ed456e4 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed456e4

Browse files
committed
Merge branch 'master' into fix10788
2 parents 124cc71 + b27afa3 commit ed456e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1242
-736
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ apt-run: &apt-install
2626
texlive-xetex \
2727
graphviz \
2828
libgeos-dev \
29+
fonts-crosextra-carlito \
2930
otf-freefont
3031
3132
fonts-run: &fonts-install

.flake8

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ per-file-ignores =
5959
lib/mpl_toolkits/axes_grid1/colorbar.py: E225, E501
6060
lib/mpl_toolkits/axisartist/angle_helper.py: E221
6161
lib/mpl_toolkits/axisartist/clip_path.py: E225
62-
lib/mpl_toolkits/axisartist/floating_axes.py: E225, E402, E501
6362
lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py: E225, E501
6463

6564
doc/conf.py: E402, E501

INSTALL.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,15 @@ Optionally, you can also install a number of packages to enable better user
147147
interface toolkits. See :ref:`what-is-a-backend` for more details on the
148148
optional Matplotlib backends and the capabilities they provide.
149149

150-
* :term:`tk` (>= 8.3, != 8.6.0 or 8.6.1): for the Tk-based backends;
150+
* `Tk <https://docs.python.org/3/library/tk.html>`_ (>= 8.3, != 8.6.0 or
151+
8.6.1): for the Tk-based backends;
151152
* `PyQt4 <https://pypi.org/project/PyQt4>`_ (>= 4.6) or
152153
`PySide <https://pypi.org/project/PySide>`_ (>= 1.0.3): for the Qt4-based
153154
backends;
154155
* `PyQt5 <https://pypi.org/project/PyQt5>`_: for the Qt5-based backends;
155156
* `PyGObject <https://pypi.org/project/PyGObject/>`_: for the GTK3-based
156157
backends;
157-
* :term:`wxpython` (>= 4): for the WX-based backends;
158+
* `wxPython <https://www.wxpython.org/>`_ (>= 4): for the WX-based backends;
158159
* `cairocffi <https://cairocffi.readthedocs.io/en/latest/>`_ (>= 0.8) or
159160
`pycairo <https://pypi.org/project/pycairo>`_: for the cairo-based
160161
backends;
87.3 KB
Loading

doc/_templates/layout.html

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h3>{{ _('Navigation') }}</h3>
4040
<li><a href="{{ pathto('index') }}">home</a>|&nbsp;</li>
4141
<li><a href="{{ pathto('gallery/index') }}">examples</a>|&nbsp;</li>
4242
<li><a href="{{ pathto('tutorials/index') }}">tutorials</a>|&nbsp;</li>
43-
<li><a href="{{ pathto('api/api_overview') }}">API</a>|&nbsp;</li>
43+
<li><a href="{{ pathto('api/index') }}">API</a>|&nbsp;</li>
4444
<li><a href="{{ pathto('contents') }}">contents</a> &raquo;</li>
4545

4646
{%- for parent in parents %}
@@ -76,27 +76,10 @@ <h3>{{ _('Navigation') }}</h3>
7676
{%- endmacro %}
7777

7878
{%- macro script() %}
79-
{% if sphinx_version >= "1.8.0" %}
80-
<script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
81-
{%- for scriptfile in script_files %}
82-
{{ js_tag(scriptfile) }}
83-
{%- endfor %}
84-
{% else %}
85-
<script type="text/javascript">
86-
var DOCUMENTATION_OPTIONS = {
87-
URL_ROOT:'{{ url_root }}',
88-
VERSION:'{{ release|e }}',
89-
LANGUAGE:'{{ language }}',
90-
COLLAPSE_INDEX:false,
91-
FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}',
92-
HAS_SOURCE: {{ has_source|lower }},
93-
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
94-
};
95-
</script>
96-
{%- for scriptfile in script_files %}
97-
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
98-
{%- endfor %}
99-
{% endif %}
79+
<script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
80+
{%- for scriptfile in script_files %}
81+
{{ js_tag(scriptfile) }}
82+
{%- endfor %}
10083
{%- endmacro %}
10184

10285
{%- macro css() %}

doc/api/api_overview.rst

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

doc/api/index.rst

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,74 @@
1+
API Overview
2+
============
3+
4+
.. toctree::
5+
:hidden:
6+
7+
api_changes
8+
9+
.. contents:: :local:
10+
11+
See also the :doc:`api_changes`.
12+
13+
Usage patterns
14+
--------------
15+
16+
Below we describe several common approaches to plotting with Matplotlib.
17+
18+
The pyplot API
19+
^^^^^^^^^^^^^^
20+
21+
`matplotlib.pyplot` is a collection of command style functions that make
22+
Matplotlib work like MATLAB. Each pyplot function makes some change to a
23+
figure: e.g., creates a figure, creates a plotting area in a figure, plots
24+
some lines in a plotting area, decorates the plot with labels, etc.
25+
26+
`.pyplot` is mainly intended for interactive plots and simple cases of
27+
programmatic plot generation.
28+
29+
Further reading:
30+
31+
- The `matplotlib.pyplot` function reference
32+
- :doc:`/tutorials/introductory/pyplot`
33+
- :ref:`Pyplot examples <pyplots_examples>`
34+
135
.. _api-index:
236

3-
####################
4-
The Matplotlib API
5-
####################
37+
The object-oriented API
38+
^^^^^^^^^^^^^^^^^^^^^^^
639

7-
.. toctree::
8-
:maxdepth: 1
40+
At its core, Matplotlib is object-oriented. We recommend directly working
41+
with the objects, if you need more control and customization of your plots.
42+
43+
In many cases you will create a `.Figure` and one or more
44+
`~matplotlib.axes.Axes` using `.pyplot.subplots` and from then on only work
45+
on these objects. However, it's also possible to create `.Figure`\ s
46+
explicitly (e.g. when including them in GUI applications).
947

10-
api_overview.rst
11-
api_changes.rst
48+
Further reading:
1249

50+
- `matplotlib.axes.Axes` and `matplotlib.figure.Figure` for an overview of
51+
plotting functions.
52+
- Most of the :ref:`examples <examples-index>` use the object-oriented approach
53+
(except for the pyplot section)
54+
55+
The pylab API (disapproved)
56+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
57+
58+
.. warning::
59+
Since heavily importing into the global namespace may result in unexpected
60+
behavior, the use of pylab is strongly discouraged. Use `matplotlib.pyplot`
61+
instead.
62+
63+
`pylab` is a module that includes `matplotlib.pyplot`, `numpy`
64+
and some additional functions within a single namespace. Its original purpose
65+
was to mimic a MATLAB-like way of working by importing all functions into the
66+
global namespace. This is considered bad style nowadays.
1367

1468
Modules
15-
=======
69+
-------
70+
71+
Matplotlib consists of the following submodules:
1672

1773
.. toctree::
1874
:maxdepth: 1
@@ -74,7 +130,10 @@ Modules
74130
widgets_api.rst
75131

76132
Toolkits
77-
========
133+
--------
134+
135+
:ref:`toolkits-index` are collections of application-specific functions that extend
136+
Matplotlib. The following toolkits are included:
78137

79138
.. toctree::
80139
:maxdepth: 1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Autoscaling changes
2+
```````````````````
3+
4+
Matplotlib used to recompute autoscaled limits after every plotting
5+
(``plot()``, ``bar()``, etc.) call. It now only does so when actually
6+
rendering the canvas, or when the user queries the Axes limits. This is a
7+
major performance improvement for plots with a large number of artists.
8+
9+
In particular, this means that artists added manually with `Axes.add_line`,
10+
`Axes.add_patch`, etc. will be taken into account by the autoscale, even
11+
without an explicit call to `Axes.autoscale_view`.
12+
13+
In some cases, this can result in different limits being reported. If this is
14+
an issue, consider triggering a draw with `fig.canvas.draw`.
15+
16+
LogLocator.nonsingular now maintains the orders of its arguments
17+
````````````````````````````````````````````````````````````````
18+
19+
It no longer reorders them in increasing order. The new behavior is consistent
20+
with MaxNLocator.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Change in the application of ``Artist.sticky_edges``
2+
````````````````````````````````````````````````````
3+
4+
Previously, the ``sticky_edges`` attribute of artists was a list of values such
5+
that if an axis limit coincides with a sticky edge, it would not be expanded by
6+
the axes margins (this is the mechanism that e.g. prevents margins from being
7+
added around images).
8+
9+
``sticky_edges`` now have an additional effect on margins application: even if
10+
an axis limit did not coincide with a sticky edge, it cannot *cross* a sticky
11+
edge through margin application -- instead, the margins will only expand the
12+
axis limit until it bumps against the sticky edge.
13+
14+
This change improves the margins of axes displaying a `~Axes.streamplot`:
15+
16+
- if the streamplot goes all the way to the edges of the vector field, then the
17+
axis limits are set to match exactly the vector field limits (whereas they
18+
would be sometimes be off by a small floating point error previously).
19+
- if the streamplot does not reach the edges of the vector field (e.g., due to
20+
the use of ``start_points`` and ``maxlength``), then margins expansion will
21+
not cross the the vector field limits anymore.
22+
23+
This change is also used internally to ensure that polar plots don't display
24+
negative *r* values unless the user really passes in a negative value.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
4+
``FigureCanvasMac.invalidate`` is deprecated in favor of its synonym,
5+
``FigureCanvasMac.draw_idle``.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Deprecations
2+
````````````
3+
4+
The ``dryrun`` parameter to the various ``FigureCanvasFoo.print_foo`` methods is deprecated.

doc/glossary/index.rst

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -14,58 +14,15 @@ Glossary
1414
Cairo
1515
The `Cairo graphics <https://cairographics.org>`_ engine
1616

17-
18-
dateutil
19-
The `dateutil <https://dateutil.readthedocs.io>`_ library
20-
provides extensions to the standard datetime module
21-
22-
EPS
23-
Encapsulated Postscript (`EPS
24-
<https://en.wikipedia.org/wiki/Encapsulated_PostScript>`_)
25< F438 span class="diff-text-marker">-
2617
FreeType
2718
`FreeType <https://www.freetype.org/>`_ is a font rasterization
2819
library used by matplotlib which supports TrueType, Type 1, and
2920
OpenType fonts.
3021

31-
GDK
32-
The Gimp Drawing Kit for GTK+
33-
3422
GTK
3523
The GIMP Toolkit (`GTK <https://www.gtk.org/>`_) graphical user interface
3624
library
3725

38-
JPG
39-
The Joint Photographic Experts Group (`JPEG
40-
<https://en.wikipedia.org/wiki/Jpeg>`_) compression method and
41-
file format for photographic images
42-
43-
numpy
44-
`numpy <http://www.numpy.org/>`_ is the standard numerical
45-
array library for python, the successor to Numeric and numarray.
46-
numpy provides fast operations for homogeneous data sets and
47-
common mathematical operations like correlations, standard
48-
deviation, fourier transforms, and convolutions.
49-
50-
PDF
51-
Adobe's Portable Document Format (`PDF
52-
<https://en.wikipedia.org/wiki/Portable_Document_Format>`_)
53-
54-
PNG
55-
Portable Network Graphics (`PNG
56-
<https://en.wikipedia.org/wiki/Portable_Network_Graphics>`_), a raster
57-
graphics format that employs lossless data compression which is more
58-
suitable for line art than the lossy jpg format. Unlike the gif format,
59-
png is not encumbered by requirements for a patent license.
60-
61-
PS
62-
Postscript (`PS <https://en.wikipedia.org/wiki/PostScript>`_) is a
63-
vector graphics ASCII text language widely used in printers and
64-
publishing. Postscript was developed by adobe systems and is
65-
starting to show its age: for example is does not have an alpha
66-
channel. PDF was designed in part as a next-generation document
67-
format to replace postscript
68-
6926
PyGObject
7027
`PyGObject <http://www.pygtk.org/>`_ provides Python wrappers for the
7128
:term:`GTK` widgets library
@@ -77,11 +34,6 @@ Glossary
7734
and windows; many linux distributions package this as
7835
'python-qt5' or 'python-qt4'.
7936

80-
python
81-
`python <https://www.python.org>`_ is an object oriented interpreted
82-
language widely used for scripting, application development, web
83-
application servers, scientific computing and more.
84-
8537
Qt
8638
`Qt <https://www.qt.io/>`__ is a cross-platform
8739
application framework for desktop and embedded development.
@@ -96,42 +48,12 @@ Glossary
9648
version of Qt cross-platform application
9749
framework for desktop and embedded development.
9850

99-
raster graphics
100-
`Raster graphics
101-
<https://en.wikipedia.org/wiki/Raster_graphics>`_, or bitmaps,
102-
represent an image as an array of pixels which is resolution
103-
dependent. Raster graphics are generally most practical for
104-
photo-realistic images, but do not scale easily without loss of
105-
quality.
106-
107-
SVG
108-
The Scalable Vector Graphics format (`SVG
109-
<https://en.wikipedia.org/wiki/Svg>`_). An XML based vector
110-
graphics format supported by many web browsers.
111-
112-
TIFF
113-
Tagged Image File Format (`TIFF
114-
<https://en.wikipedia.org/wiki/Tagged_Image_File_Format>`_) is a
115-
file format for storing images, including photographs and line
116-
art.
117-
11851
Tk
11952
`Tk <http://www.tcl.tk/>`_ is a graphical user interface for Tcl
12053
and many other dynamic languages. It can produce rich, native
12154
applications that run unchanged across Windows, Mac OS X, Linux
12255
and more.
12356

124-
vector graphics
125-
`vector graphics
126-
<https://en.wikipedia.org/wiki/Vector_graphics>`_ use geometrical
127-
primitives based upon mathematical equations to represent images
128-
in computer graphics. Primitives can include points, lines,
129-
curves, and shapes or polygons. Vector graphics are scalable,
130-
which means that they can be resized without suffering from
131-
issues related to inherent resolution like are seen in raster
132-
graphics. Vector graphics are generally most practical for
133-
typesetting and graphic design applications.
134-
13557
wxpython
13658
`wxpython <https://www.wxpython.org/>`_ provides python wrappers
13759
for the :term:`wxWidgets` library for use with the WX and WXAgg

0 commit comments

Comments
 (0)
0