:1"
]
diff --git a/doc/project/citing.rst b/doc/project/citing.rst
index 2cd317906bb5..8b4c323229ca 100644
--- a/doc/project/citing.rst
+++ b/doc/project/citing.rst
@@ -32,6 +32,12 @@ By version
.. START OF AUTOGENERATED
+v3.10.3
+ .. image:: ../_static/zenodo_cache/15375714.svg
+ :target: https://doi.org/10.5281/zenodo.15375714
+v3.10.1
+ .. image:: ../_static/zenodo_cache/14940554.svg
+ :target: https://doi.org/10.5281/zenodo.14940554
v3.10.0
.. image:: ../_static/zenodo_cache/14464227.svg
:target: https://doi.org/10.5281/zenodo.14464227
diff --git a/doc/users/faq.rst b/doc/users/faq.rst
index 592fff551099..87a1af03d96e 100644
--- a/doc/users/faq.rst
+++ b/doc/users/faq.rst
@@ -281,8 +281,23 @@ locators as desired because the two axes are independent.
Generate images without having a window appear
----------------------------------------------
-Simply do not call `~matplotlib.pyplot.show`, and directly save the figure to
-the desired format::
+The recommended approach since matplotlib 3.1 is to explicitly create a Figure
+instance::
+
+ from matplotlib.figure import Figure
+ fig = Figure()
+ ax = fig.subplots()
+ ax.plot([1, 2, 3])
+ fig.savefig('myfig.png')
+
+This prevents any interaction with GUI frameworks and the window manager.
+
+It's alternatively still possible to use the pyplot interface. Instead of
+calling `matplotlib.pyplot.show`, call `matplotlib.pyplot.savefig`.
+
+Additionally, you must ensure to close the figure after saving it. Not
+closing the figure is a memory leak, because pyplot keeps references
+to all not-yet-shown figures::
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])
diff --git a/galleries/examples/pie_and_polar_charts/polar_demo.py b/galleries/examples/pie_and_polar_charts/polar_demo.py
index e4967079d19d..909fea094be5 100644
--- a/galleries/examples/pie_and_polar_charts/polar_demo.py
+++ b/galleries/examples/pie_and_polar_charts/polar_demo.py
@@ -4,6 +4,11 @@
==========
Demo of a line plot on a polar axis.
+
+The second plot shows the same data, but with the radial axis starting at r=1
+and the angular axis starting at 0 degrees and ending at 225 degrees. Setting
+the origin of the radial axis to 0 allows the radial ticks to be placed at the
+same location as the first plot.
"""
import matplotlib.pyplot as plt
import numpy as np
@@ -11,14 +16,29 @@
r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
-fig, ax = plt.subplots(subplot_kw={'projection': 'polar'})
+fig, axs = plt.subplots(2, 1, figsize=(5, 8), subplot_kw={'projection': 'polar'},
+ layout='constrained')
+ax = axs[0]
ax.plot(theta, r)
ax.set_rmax(2)
-ax.set_rticks([0.5, 1, 1.5, 2]) # Less radial ticks
+ax.set_rticks([0.5, 1, 1.5, 2]) # Fewer radial ticks
ax.set_rlabel_position(-22.5) # Move radial labels away from plotted line
ax.grid(True)
ax.set_title("A line plot on a polar axis", va='bottom')
+
+ax = axs[1]
+ax.plot(theta, r)
+ax.set_rmax(2)
+ax.set_rmin(1) # Change the radial axis to only go from 1 to 2
+ax.set_rorigin(0) # Set the origin of the radial axis to 0
+ax.set_thetamin(0)
+ax.set_thetamax(225)
+ax.set_rticks([1, 1.5, 2]) # Fewer radial ticks
+ax.set_rlabel_position(-22.5) # Move radial labels away from plotted line
+
+ax.grid(True)
+ax.set_title("Same plot, but with reduced axis limits", va='bottom')
plt.show()
# %%
@@ -32,6 +52,8 @@
# - `matplotlib.projections.polar`
# - `matplotlib.projections.polar.PolarAxes`
# - `matplotlib.projections.polar.PolarAxes.set_rticks`
+# - `matplotlib.projections.polar.PolarAxes.set_rmin`
+# - `matplotlib.projections.polar.PolarAxes.set_rorigin`
# - `matplotlib.projections.polar.PolarAxes.set_rmax`
# - `matplotlib.projections.polar.PolarAxes.set_rlabel_position`
#
diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py
index 7085a986414e..9e20ea3da9b7 100644
--- a/lib/matplotlib/_mathtext.py
+++ b/lib/matplotlib/_mathtext.py
@@ -2521,10 +2521,10 @@ def subsuper(self, s: str, loc: int, toks: ParseResults) -> T.Any:
if len(new_children):
# remove last kern
if (isinstance(new_children[-1], Kern) and
- hasattr(new_children[-2], '_metrics')):
+ isinstance(new_children[-2], Char)):
new_children = new_children[:-1]
last_char = new_children[-1]
- if hasattr(last_char, '_metrics'):
+ if isinstance(last_char, Char):
last_char.width = last_char._metrics.advance
# create new Hlist without kerning
nucleus = Hlist(new_children, do_kern=False)
@@ -2600,7 +2600,7 @@ def subsuper(self, s: str, loc: int, toks: ParseResults) -> T.Any:
# Do we need to add a space after the nucleus?
# To find out, check the flag set by operatorname
- spaced_nucleus = [nucleus, x]
+ spaced_nucleus: list[Node] = [nucleus, x]
if self._in_subscript_or_superscript:
spaced_nucleus += [self._make_space(self._space_widths[r'\,'])]
self._in_subscript_or_superscript = False
diff --git a/tools/cache_zenodo_svg.py b/tools/cache_zenodo_svg.py
index 3be7d6ca21e4..229e90efeb34 100644
--- a/tools/cache_zenodo_svg.py
+++ b/tools/cache_zenodo_svg.py
@@ -63,6 +63,8 @@ def _get_xdg_cache_dir():
if __name__ == "__main__":
data = {
+ "v3.10.3": "15375714",
+ "v3.10.1": "14940554",
"v3.10.0": "14464227",
"v3.9.4": "14436121",
"v3.9.3": "14249941",
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy