Skip to content

Commit 0427513

Browse files
authored
Merge branch 'matplotlib:main' into shuffleFix
2 parents d77b191 + 4896ec1 commit 0427513

File tree

29 files changed

+806
-286
lines changed

29 files changed

+806
-286
lines changed

.github/workflows/cibuildsdist.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,9 @@ jobs:
6262

6363
- name: Check version number is not 0
6464
run: python ./ci/check_version_number.py
65+
66+
- name: Install twine
67+
run: pip install twine
68+
69+
- name: Check README rendering for PyPI
70+
run: twine check dist/*

README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
[![PyPi](https://badge.fury.io/py/matplotlib.svg)](https://badge.fury.io/py/matplotlib)
2+
[![Downloads](https://pepy.tech/badge/matplotlib/month)](https://pepy.tech/project/matplotlib)
3+
[![NUMFocus](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org)
4+
5+
[![DiscourseBadge](https://img.shields.io/badge/help_forum-discourse-blue.svg)](https://discourse.matplotlib.org)
6+
[![Gitter](https://badges.gitter.im/matplotlib/matplotlib.svg)](https://gitter.im/matplotlib/matplotlib)
7+
[![GitHubIssues](https://img.shields.io/badge/issue_tracking-github-blue.svg)](https://github.com/matplotlib/matplotlib/issues)
8+
[![GitTutorial](https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?)](https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project)
9+
10+
[![GitHubActions](https://github.com/matplotlib/matplotlib/workflows/Tests/badge.svg)](https://github.com/matplotlib/matplotlib/actions?query=workflow%3ATests)
11+
[![AzurePipelines](https://dev.azure.com/matplotlib/matplotlib/_apis/build/status/matplotlib.matplotlib?branchName=main)](https://dev.azure.com/matplotlib/matplotlib/_build/latest?definitionId=1&branchName=main)
12+
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/matplotlib/matplotlib?branch=main&svg=true)](https://ci.appveyor.com/project/matplotlib/matplotlib)
13+
[![Codecov](https://codecov.io/github/matplotlib/matplotlib/badge.svg?branch=main&service=github)](https://codecov.io/github/matplotlib/matplotlib?branch=main)
14+
[![LGTM](https://img.shields.io/lgtm/grade/python/github/matplotlib/matplotlib.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/matplotlib/matplotlib)
15+
16+
![image](https://matplotlib.org/_static/logo2.svg)
17+
18+
Matplotlib is a comprehensive library for creating static, animated, and
19+
interactive visualizations in Python.
20+
21+
Check out our [home page](https://matplotlib.org/) for more information.
22+
23+
![image](https://matplotlib.org/_static/readme_preview.png)
24+
25+
Matplotlib produces publication-quality figures in a variety of hardcopy
26+
formats and interactive environments across platforms. Matplotlib can be
27+
used in Python scripts, Python/IPython shells, web application servers,
28+
and various graphical user interface toolkits.
29+
30+
## Install
31+
32+
See the [install
33+
documentation](https://matplotlib.org/stable/users/installing/index.html),
34+
which is generated from `/doc/users/installing/index.rst`
35+
36+
## Contribute
37+
38+
You've discovered a bug or something else you want to change -
39+
excellent!
40+
41+
You've worked out a way to fix it -- even better!
42+
43+
You want to tell us about it -- best of all!
44+
45+
Start at the [contributing
46+
guide](https://matplotlib.org/devdocs/devel/contributing.html)!
47+
48+
## Contact
49+
50+
[Discourse](https://discourse.matplotlib.org/) is the discussion forum
51+
for general questions and discussions and our recommended starting
52+
point.
53+
54+
Our active mailing lists (which are mirrored on Discourse) are:
55+
56+
- [Users](https://mail.python.org/mailman/listinfo/matplotlib-users)
57+
mailing list: <[email protected]>
58+
- [Announcement](https://mail.python.org/mailman/listinfo/matplotlib-announce)
59+
mailing list: <[email protected]>
60+
- [Development](https://mail.python.org/mailman/listinfo/matplotlib-devel)
61+
mailing list: <[email protected]>
62+
63+
[Gitter](https://gitter.im/matplotlib/matplotlib) is for coordinating
64+
development and asking questions directly related to contributing to
65+
matplotlib.
66+
67+
## Citing Matplotlib
68+
69+
If Matplotlib contributes to a project that leads to publication, please
70+
acknowledge this by citing Matplotlib.
71+
72+
[A ready-made citation
73+
entry](https://matplotlib.org/stable/users/project/citing.html) is
74+
available.
75+
76+
### Research notice
77+
78+
Please note that this repository is participating in a study into
79+
sustainability of open source projects. Data will be gathered about this
80+
repository for approximately the next 12 months, starting from June
81+
2021.
82+
83+
Data collected will include number of contributors, number of PRs, time
84+
taken to close/merge these PRs, and issues closed.
85+
86+
For more information, please visit [the informational
87+
page](https://sustainable-open-science-and-software.github.io/) or
88+
download the [participant information
89+
sheet](https://sustainable-open-science-and-software.github.io/assets/PIS_sustainable_software.pdf).

README.rst

Lines changed: 0 additions & 117 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``axes3d.vvec``, ``axes3d.eye``, ``axes3d.sx``, and ``axes3d.sy``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... are deprecated without replacement.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Colorbars for orphaned mappables are deprecated, but no longer raise
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Before 3.6.0, Colorbars for mappables that do not have a parent axes would
5+
steal space from the current Axes. 3.6.0 raised an error on this, but without
6+
a deprecation cycle. For 3.6.1 this is reverted, the current axes is used,
7+
but a deprecation warning is shown instead. In this undetermined case users
8+
and libraries should explicitly specify what axes they want space to be stolen
9+
from: ``fig.colorbar(mappable, ax=plt.gca())``.

doc/api/prev_api_changes/api_changes_3.6.0/deprecations.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ In Matplotlib 3.6 we have marked those top level functions as pending
5252
deprecation with the intention of deprecation in Matplotlib 3.7. The following
5353
functions have been marked for pending deprecation:
5454

55-
- ``matplotlib.cm.get_cmap``; use ``matplotlib.colormaps[name]`` instead
55+
- ``matplotlib.cm.get_cmap``; use ``matplotlib.colormaps[name]`` instead if you
56+
have a `str`.
57+
58+
**Added 3.6.1** Use `matplotlib.cm.ColormapRegistry.get_cmap` if you
59+
have a string, `None` or a `matplotlib.colors.Colormap` object that you want
60+
to convert to a `matplotlib.colors.Colormap` instance.
5661
- ``matplotlib.cm.register_cmap``; use `matplotlib.colormaps.register
5762
<.ColormapRegistry.register>` instead
5863
- ``matplotlib.cm.unregister_cmap``; use `matplotlib.colormaps.unregister
@@ -305,7 +310,7 @@ Backend-specific deprecations
305310
private functions if you rely on it.
306311
- ``backend_svg.generate_transform`` and ``backend_svg.generate_css``
307312
- ``backend_tk.NavigationToolbar2Tk.lastrect`` and
308-
``backend_tk.RubberbandTk.lastrect``
313+
``backend_tk.RubberbandTk.lastrect``
309314
- ``backend_tk.NavigationToolbar2Tk.window``; use ``toolbar.master`` instead.
310315
- ``backend_tools.ToolBase.destroy``; To run code upon tool removal, connect to
311316
the ``tool_removed_event`` event.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
3D plot pan and zoom buttons
2+
----------------------------
3+
4+
The pan and zoom buttons in the toolbar of 3D plots are now enabled.
5+
Unselect both to rotate the plot. When the zoom button is pressed,
6+
zoom in by using the left mouse button to draw a bounding box, and
7+
out by using the right mouse button to draw the box. When zooming a
8+
3D plot, the current view aspect ratios are kept fixed.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Fixed errorbars in polar plots
2+
------------------------------
3+
Caps and error lines are now drawn with respect to polar coordinates,
4+
when plotting errorbars on polar plots.
5+
6+
.. figure:: /gallery/pie_and_polar_charts/images/sphx_glr_polar_error_caps_001.png
7+
:target: ../../gallery/pie_and_polar_charts/polar_error_caps.html
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
"""
2+
=================================
3+
Error bar rendering on polar axis
4+
=================================
5+
6+
Demo of error bar plot in polar coordinates.
7+
Theta error bars are curved lines ended with caps oriented towards the
8+
center.
9+
Radius error bars are straight lines oriented towards center with
10+
perpendicular caps.
11+
"""
12+
import numpy as np
13+
import matplotlib.pyplot as plt
14+
15+
theta = np.arange(0, 2 * np.pi, np.pi / 4)
16+
r = theta / np.pi / 2 + 0.5
17+
18+
fig = plt.figure(figsize=(10, 10))
19+
ax = fig.add_subplot(projection='polar')
20+
ax.errorbar(theta, r, xerr=0.25, yerr=0.1, capsize=7, fmt="o", c="seagreen")
21+
ax.set_title("Pretty polar error bars")
22+
plt.show()
23+
24+
#############################################################################
25+
# Please acknowledge that large theta error bars will be overlapping.
26+
# This may reduce readability of the output plot. See example figure below:
27+
28+
fig = plt.figure(figsize=(10, 10))
29+
ax = fig.add_subplot(projection='polar')
30+
ax.errorbar(theta, r, xerr=5.25, yerr=0.1, capsize=7, fmt="o", c="darkred")
31+
ax.set_title("Overlapping theta error bars")
32+
plt.show()
33+
34+
#############################################################################
35+
# On the other hand, large radius error bars will never overlap, they just
36+
# lead to unwanted scale in the data, reducing the displayed range.
37+
38+
fig = plt.figure(figsize=(10, 10))
39+
ax = fig.add_subplot(projection='polar')
40+
ax.errorbar(theta, r, xerr=0.25, yerr=10.1, capsize=7, fmt="o", c="orangered")
41+
ax.set_title("Large radius error bars")
42+
plt.show()
43+
44+
45+
#############################################################################
46+
#
47+
# .. admonition:: References
48+
#
49+
# The use of the following functions, methods, classes and modules is shown
50+
# in this example:
51+
#
52+
# - `matplotlib.axes.Axes.errorbar` / `matplotlib.pyplot.errorbar`
53+
# - `matplotlib.projections.polar`

lib/matplotlib/_mathtext.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,14 @@ class UnicodeFonts(TruetypeFonts):
475475
symbol can not be found in the font.
476476
"""
477477

478+
# Some glyphs are not present in the `cmr10` font, and must be brought in
479+
# from `cmsy10`. Map the Unicode indices of those glyphs to the indices at
480+
# which they are found in `cmsy10`.
481+
_cmr10_substitutions = {
482+
0x00D7: 0x00A3, # Multiplication sign.
483+
0x2212: 0x00A1, # Minus sign.
484+
}
485+
478486
def __init__(self, *args, **kwargs):
479487
# This must come first so the backend's owner is set correctly
480488
fallback_rc = mpl.rcParams['mathtext.fallback']
@@ -541,11 +549,11 @@ def _get_glyph(self, fontname, font_class, sym):
541549
found_symbol = False
542550
font = self._get_font(new_fontname)
543551
if font is not None:
544-
if font.family_name == "cmr10" and uniindex == 0x2212:
545-
# minus sign exists in cmsy10 (not cmr10)
552+
if (uniindex in self._cmr10_substitutions
553+
and font.family_name == "cmr10"):
546554
font = get_font(
547555
cbook._get_data_path("fonts/ttf/cmsy10.ttf"))
548-
uniindex = 0xa1
556+
uniindex = self._cmr10_substitutions[uniindex]
549557
glyphindex = font.get_char_index(uniindex)
550558
if glyphindex != 0:
551559
found_symbol = True

0 commit comments

Comments
 (0)