`_
for further details.
diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst
index 46cbc5022063..4131fccde0ba 100644
--- a/doc/users/whats_new.rst
+++ b/doc/users/whats_new.rst
@@ -25,4 +25,5 @@ What's new?
next_whats_new/*
+.. Be sure to update the version in `exclude_patterns` in conf.py.
.. include:: prev_whats_new/whats_new_3.3.0.rst
diff --git a/examples/axisartist/axis_direction_demo_step01.py b/examples/axisartist/axis_direction_demo_step01.py
index df5d8e57017c..daf4508baa45 100644
--- a/examples/axisartist/axis_direction_demo_step01.py
+++ b/examples/axisartist/axis_direction_demo_step01.py
@@ -25,7 +25,7 @@ def setup_axes(fig, rect):
fig = plt.figure(figsize=(3, 2.5))
fig.subplots_adjust(top=0.8)
-ax1 = setup_axes(fig, "111")
+ax1 = setup_axes(fig, 111)
ax1.axis["x"].set_axis_direction("left")
diff --git a/examples/axisartist/axis_direction_demo_step02.py b/examples/axisartist/axis_direction_demo_step02.py
index de6a21df4283..bc8a8e652b03 100644
--- a/examples/axisartist/axis_direction_demo_step02.py
+++ b/examples/axisartist/axis_direction_demo_step02.py
@@ -28,13 +28,13 @@ def setup_axes(fig, rect):
fig = plt.figure(figsize=(6, 2.5))
fig.subplots_adjust(bottom=0.2, top=0.8)
-ax1 = setup_axes(fig, "121")
+ax1 = setup_axes(fig, 121)
ax1.axis["x"].set_ticklabel_direction("+")
ax1.annotate("ticklabel direction=$+$", (0.5, 0), xycoords="axes fraction",
xytext=(0, -10), textcoords="offset points",
va="top", ha="center")
-ax2 = setup_axes(fig, "122")
+ax2 = setup_axes(fig, 122)
ax2.axis["x"].set_ticklabel_direction("-")
ax2.annotate("ticklabel direction=$-$", (0.5, 0), xycoords="axes fraction",
xytext=(0, -10), textcoords="offset points",
diff --git a/examples/axisartist/axis_direction_demo_step03.py b/examples/axisartist/axis_direction_demo_step03.py
index 6b6d6a287462..b02962af8ebf 100644
--- a/examples/axisartist/axis_direction_demo_step03.py
+++ b/examples/axisartist/axis_direction_demo_step03.py
@@ -28,7 +28,7 @@ def setup_axes(fig, rect):
fig = plt.figure(figsize=(6, 2.5))
fig.subplots_adjust(bottom=0.2, top=0.8)
-ax1 = setup_axes(fig, "121")
+ax1 = setup_axes(fig, 121)
ax1.axis["x"].label.set_text("Label")
ax1.axis["x"].toggle(ticklabels=False)
ax1.axis["x"].set_axislabel_direction("+")
@@ -36,7 +36,7 @@ def setup_axes(fig, rect):
xytext=(0, -10), textcoords="offset points",
va="top", ha="center")
-ax2 = setup_axes(fig, "122")
+ax2 = setup_axes(fig, 122)
ax2.axis["x"].label.set_text("Label")
ax2.axis["x"].toggle(ticklabels=False)
ax2.axis["x"].set_axislabel_direction("-")
diff --git a/examples/axisartist/axis_direction_demo_step04.py b/examples/axisartist/axis_direction_demo_step04.py
index 25ea10c0cff8..5769f2934e76 100644
--- a/examples/axisartist/axis_direction_demo_step04.py
+++ b/examples/axisartist/axis_direction_demo_step04.py
@@ -29,7 +29,7 @@ def setup_axes(fig, rect):
fig = plt.figure(figsize=(6, 2.5))
fig.subplots_adjust(bottom=0.2, top=0.8)
-ax1 = setup_axes(fig, "121")
+ax1 = setup_axes(fig, 121)
ax1.axis["x1"].label.set_text("rotation=0")
ax1.axis["x1"].toggle(ticklabels=False)
@@ -41,7 +41,7 @@ def setup_axes(fig, rect):
xytext=(0, -10), textcoords="offset points",
va="top", ha="center")
-ax2 = setup_axes(fig, "122")
+ax2 = setup_axes(fig, 122)
ax2.axis["x1"].set_axislabel_direction("-")
ax2.axis["x2"].set_axislabel_direction("-")
diff --git a/examples/axisartist/simple_axis_direction01.py b/examples/axisartist/simple_axis_direction01.py
index 79d074b2d860..2240ceece7e0 100644
--- a/examples/axisartist/simple_axis_direction01.py
+++ b/examples/axisartist/simple_axis_direction01.py
@@ -8,7 +8,7 @@
import mpl_toolkits.axisartist as axisartist
fig = plt.figure(figsize=(4, 2.5))
-ax1 = fig.add_subplot(axisartist.Subplot(fig, "111"))
+ax1 = fig.add_subplot(axisartist.Subplot(fig, 111))
fig.subplots_adjust(right=0.8)
ax1.axis["left"].major_ticklabels.set_axis_direction("top")
diff --git a/examples/axisartist/simple_axis_direction03.py b/examples/axisartist/simple_axis_direction03.py
index 5185d144ab1f..e9b758b15817 100644
--- a/examples/axisartist/simple_axis_direction03.py
+++ b/examples/axisartist/simple_axis_direction03.py
@@ -22,13 +22,13 @@ def setup_axes(fig, rect):
fig = plt.figure(figsize=(5, 2))
fig.subplots_adjust(wspace=0.4, bottom=0.3)
-ax1 = setup_axes(fig, "121")
+ax1 = setup_axes(fig, 121)
ax1.set_xlabel("X-label")
ax1.set_ylabel("Y-label")
ax1.axis[:].invert_ticklabel_direction()
-ax2 = setup_axes(fig, "122")
+ax2 = setup_axes(fig, 122)
ax2.set_xlabel("X-label")
ax2.set_ylabel("Y-label")
diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py
index 68cbc74f93ec..cca6f5d267a5 100644
--- a/lib/matplotlib/axes/_axes.py
+++ b/lib/matplotlib/axes/_axes.py
@@ -4597,7 +4597,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
`~matplotlib.collections.PolyCollection`
A `.PolyCollection` defining the hexagonal bins.
- - `.PolyCollection.get_offset` contains a Mx2 array containing
+ - `.PolyCollection.get_offsets` contains a Mx2 array containing
the x, y positions of the M hexagon centers.
- `.PolyCollection.get_array` contains the values of the M
hexagons.
diff --git a/lib/matplotlib/cbook/__init__.py b/lib/matplotlib/cbook/__init__.py
index 7fcae5db0b66..836de0c4a408 100644
--- a/lib/matplotlib/cbook/__init__.py
+++ b/lib/matplotlib/cbook/__init__.py
@@ -1367,7 +1367,10 @@ def _reshape_2D(X, name):
result = []
is_1d = True
for xi in X:
- if isinstance(xi, collections.abc.Iterable):
+ # check if this is iterable, except for strings which we
+ # treat as singletons.
+ if (isinstance(xi, collections.abc.Iterable) and
+ not isinstance(xi, str)):
is_1d = False
xi = np.asanyarray(xi)
nd = np.ndim(xi)
diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py
index 1080a1946622..6f8e152af58c 100644
--- a/lib/matplotlib/figure.py
+++ b/lib/matplotlib/figure.py
@@ -2618,7 +2618,7 @@ def tight_layout(self, renderer=None, pad=1.08, h_pad=None, w_pad=None,
def align_xlabels(self, axs=None):
"""
- Align the ylabels of subplots in the same subplot column if label
+ Align the xlabels of subplots in the same subplot column if label
alignment is being done automatically (i.e. the label position is
not manually set).
diff --git a/lib/matplotlib/tests/test_category.py b/lib/matplotlib/tests/test_category.py
index 1fcdc3eca59d..686ea940e17d 100644
--- a/lib/matplotlib/tests/test_category.py
+++ b/lib/matplotlib/tests/test_category.py
@@ -269,3 +269,10 @@ def test_mixed_type_update_exception(self, ax, plotter, xdata):
with pytest.raises(TypeError):
plotter(ax, [0, 3], [1, 3])
plotter(ax, xdata, [1, 2])
+
+
+def test_hist():
+ fig, ax = plt.subplots()
+ n, bins, patches = ax.hist(['a', 'b', 'a', 'c', 'ff'])
+ assert n.shape == (10,)
+ np.testing.assert_allclose(n, [2., 0., 0., 1., 0., 0., 1., 0., 0., 1.])
diff --git a/lib/matplotlib/tests/test_cbook.py b/lib/matplotlib/tests/test_cbook.py
index b86f02822d3c..9c00f892e687 100644
--- a/lib/matplotlib/tests/test_cbook.py
+++ b/lib/matplotlib/tests/test_cbook.py
@@ -545,6 +545,12 @@ def __getitem__(self, item):
assert len(xnew) == 1
assert isinstance(xnew[0], ArraySubclass)
+ # check list of strings:
+ x = ['a', 'b', 'c', 'c', 'dd', 'e', 'f', 'ff', 'f']
+ xnew = cbook._reshape_2D(x, 'x')
+ assert len(xnew[0]) == len(x)
+ assert isinstance(xnew[0], np.ndarray)
+
def test_contiguous_regions():
a, b, c = 3, 4, 5
diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py
index 96b374144da4..32eabb509b55 100644
--- a/lib/mpl_toolkits/mplot3d/art3d.py
+++ b/lib/mpl_toolkits/mplot3d/art3d.py
@@ -578,7 +578,7 @@ def __init__(self, verts, *args, zsort='average', **kwargs):
Parameters
----------
verts : list of array-like Nx3
- Each element describes a polygon as a sequnce of ``N_i`` points
+ Each element describes a polygon as a sequence of ``N_i`` points
``(x, y, z)``.
zsort : {'average', 'min', 'max'}, default: 'average'
The calculation method for the z-order.
diff --git a/tools/cache_zenodo_svg.py b/tools/cache_zenodo_svg.py
index 6c8760b2635b..49ef96a8c20c 100644
--- a/tools/cache_zenodo_svg.py
+++ b/tools/cache_zenodo_svg.py
@@ -62,6 +62,8 @@ def _get_xdg_cache_dir():
if __name__ == "__main__":
data = {
+ "v3.3.0": "3948793",
+ "v3.2.2": "3898017",
"v3.2.1": "3714460",
"v3.2.0": "3695547",
"v3.1.3": "3633844",
diff --git a/tutorials/intermediate/constrainedlayout_guide.py b/tutorials/intermediate/constrainedlayout_guide.py
index 1975153db181..2722f71957ac 100644
--- a/tutorials/intermediate/constrainedlayout_guide.py
+++ b/tutorials/intermediate/constrainedlayout_guide.py
@@ -229,12 +229,13 @@ def example_plot(ax, fontsize=12, hide_labels=False):
leg.set_in_layout(True)
# we don't want the layout to change at this point.
fig.set_constrained_layout(False)
-fig.savefig('CL01.png', bbox_inches='tight', dpi=100)
+fig.savefig('../../doc/_static/constrained_layout_1b.png',
+ bbox_inches='tight', dpi=100)
#############################################
# The saved file looks like:
#
-# .. image:: /_static/constrained_layout/CL01.png
+# .. image:: /_static/constrained_layout_1b.png
# :align: center
#
# A better way to get around this awkwardness is to simply
@@ -245,12 +246,13 @@ def example_plot(ax, fontsize=12, hide_labels=False):
labels = [l.get_label() for l in lines]
leg = fig.legend(lines, labels, loc='center left',
bbox_to_anchor=(0.8, 0.5), bbox_transform=axs[1].transAxes)
-fig.savefig('CL02.png', bbox_inches='tight', dpi=100)
+fig.savefig('../../doc/_static/constrained_layout_2b.png',
+ bbox_inches='tight', dpi=100)
#############################################
# The saved file looks like:
#
-# .. image:: /_static/constrained_layout/CL02.png
+# .. image:: /_static/constrained_layout_2b.png
# :align: center
#
diff --git a/tutorials/intermediate/tight_layout_guide.py b/tutorials/intermediate/tight_layout_guide.py
index b1b047a3e7d3..03c8ebc417a3 100644
--- a/tutorials/intermediate/tight_layout_guide.py
+++ b/tutorials/intermediate/tight_layout_guide.py
@@ -152,18 +152,17 @@ def example_plot(ax, fontsize=12):
# Caveats
# =======
#
-# * :func:`~matplotlib.pyplot.tight_layout` only considers ticklabels, axis
-# labels, and titles. Thus, other artists may be clipped and also may
-# overlap.
+# * `~matplotlib.pyplot.tight_layout` considers all artists on the axes by
+# default. To remove an artist from the layout calculation you can call
+# `.Artist.set_in_layout`.
#
-# * It assumes that the extra space needed for ticklabels, axis labels,
-# and titles is independent of original location of axes. This is
-# often true, but there are rare cases where it is not.
+# * ``tight_layout`` assumes that the extra space needed for artists is
+# independent of the original location of axes. This is often true, but there
+# are rare cases where it is not.
#
-# * pad=0 clips some of the texts by a few pixels. This may be a bug or
-# a limitation of the current algorithm and it is not clear why it
-# happens. Meanwhile, use of pad at least larger than 0.3 is
-# recommended.
+# * ``pad=0`` can clip some texts by a few pixels. This may be a bug or
+# a limitation of the current algorithm and it is not clear why it
+# happens. Meanwhile, use of pad larger than 0.3 is recommended.
#
# Use with GridSpec
# =================
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