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

Skip to content

Commit ed456e4

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

68 files changed

Lines changed: 1242 additions & 736 deletions

Some content is hidden

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

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

0 commit comments

Comments
 (0)