Skip to content

Commit 4bf6696

Browse files
authored
Merge branch 'matplotlib:main' into shuffleFix
2 parents 601d92a + 7de767e commit 4bf6696

35 files changed

+267
-269
lines changed

doc/users/faq/howto_faq.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ multiple ways to fix this:
187187
- tight layout (:doc:`/tutorials/intermediate/tight_layout_guide`)
188188

189189
- Calculate good values from the size of the plot elements yourself
190-
(:doc:`/gallery/pyplots/auto_subplots_adjust`)
190+
(:doc:`/gallery/subplots_axes_and_figures/auto_subplots_adjust`)
191191

192192
.. _howto-align-label:
193193

@@ -203,8 +203,8 @@ behavior by specifying the coordinates of the label. The example
203203
below shows the default behavior in the left subplots, and the manual
204204
setting in the right subplots.
205205

206-
.. figure:: ../../gallery/pyplots/images/sphx_glr_align_ylabels_001.png
207-
:target: ../../gallery/pyplots/align_ylabels.html
206+
.. figure:: ../../gallery/text_labels_and_annotations/images/sphx_glr_align_ylabels_001.png
207+
:target: ../../gallery/text_labels_and_annotations/align_ylabels.html
208208
:align: center
209209
:scale: 50
210210

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
=======================
55
66
Adding lines to a figure without any axes.
7+
8+
.. redirect-from:: /gallery/pyplots/fig_x
79
"""
810

911
import matplotlib.pyplot as plt

examples/pyplots/boxplot_demo_pyplot.py

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

examples/pyplots/fig_axes_labels_simple.py

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

examples/pyplots/pyplot_formatstr.py

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

examples/pyplots/pyplot_simple.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
66
A very simple pyplot where a list of numbers are plotted against their
77
index. Creates a straight line due to the rate of change being 1 for
8-
both the X and Y axis.
8+
both the X and Y axis. Use a format string (here, 'o-r') to set the
9+
markers (circles), linestyle (solid line) and color (red).
10+
11+
.. redirect-from:: /gallery/pyplots/fig_axes_labels_simple
12+
.. redirect-from:: /gallery/pyplots/pyplot_formatstr
913
"""
1014
import matplotlib.pyplot as plt
11-
plt.plot([1, 2, 3, 4])
15+
16+
plt.plot([1, 2, 3, 4], 'o-r')
1217
plt.ylabel('some numbers')
1318
plt.show()
1419

examples/pyplots/text_layout.py

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

examples/statistics/boxplot_demo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
The following examples show off how to visualize boxplots with
99
Matplotlib. There are many options to control their appearance and
1010
the statistics that they use to summarize the data.
11+
12+
.. redirect-from:: /gallery/pyplots/boxplot_demo_pyplot
1113
"""
1214

1315
import matplotlib.pyplot as plt

examples/style_sheets/style_sheets_reference.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import numpy as np
1313
import matplotlib.pyplot as plt
1414
import matplotlib.colors as mcolors
15+
from matplotlib.patches import Rectangle
1516

1617
# Fixing random state for reproducibility
1718
np.random.seed(19680801)
@@ -65,8 +66,11 @@ def plot_colored_circles(ax, prng, nb_samples=15):
6566
for sty_dict, j in zip(plt.rcParams['axes.prop_cycle'], range(nb_samples)):
6667
ax.add_patch(plt.Circle(prng.normal(scale=3, size=2),
6768
radius=1.0, color=sty_dict['color']))
68-
# Force the limits to be the same across the styles (because different
69-
# styles may have different numbers of available colors).
69+
ax.grid(visible=True)
70+
71+
# Add title for enabling grid
72+
plt.title('ax.grid(True)', family='monospace', fontsize='small')
73+
7074
ax.set_xlim([-4, 8])
7175
ax.set_ylim([-5, 6])
7276
ax.set_aspect('equal', adjustable='box') # to plot circles as circles
@@ -91,6 +95,7 @@ def plot_histograms(ax, prng, nb_samples=10000):
9195
values = prng.beta(a, b, size=nb_samples)
9296
ax.hist(values, histtype="stepfilled", bins=30,
9397
alpha=0.8, density=True)
98+
9499
# Add a small annotation.
95100
ax.annotate('Annotation', xy=(0.25, 4.25),
96101
xytext=(0.9, 0.9), textcoords=ax.transAxes,
@@ -110,7 +115,7 @@ def plot_figure(style_label=""):
110115
prng = np.random.RandomState(96917002)
111116

112117
fig, axs = plt.subplots(ncols=6, nrows=1, num=style_label,
113-
figsize=(14.8, 2.7), constrained_layout=True)
118+
figsize=(14.8, 2.8), constrained_layout=True)
114119

115120
# make a suptitle, in the same style for all subfigures,
116121
# except those with dark backgrounds, which get a lighter color:
@@ -126,10 +131,15 @@ def plot_figure(style_label=""):
126131
plot_scatter(axs[0], prng)
127132
plot_image_and_patch(axs[1], prng)
128133
plot_bar_graphs(axs[2], prng)
129-
plot_colored_circles(axs[3], prng)
130-
plot_colored_lines(axs[4])
131-
plot_histograms(axs[5], prng)
134+
plot_colored_lines(axs[3])
135+
plot_histograms(axs[4], prng)
136+
plot_colored_circles(axs[5], prng)
137+
138+
# add divider
139+
rec = Rectangle((1 + 0.025, -2), 0.05, 16,
140+
clip_on=False, color='gray')
132141

142+
axs[4].add_artist(rec)
133143

134144
if __name__ == "__main__":
135145

examples/pyplots/auto_subplots_adjust.py renamed to examples/subplots_axes_and_figures/auto_subplots_adjust.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
This function is executed after the figure has been drawn. It can now check
3737
if the subplot leaves enough room for the text. If not, the subplot parameters
3838
are updated and second draw is triggered.
39+
40+
.. redirect-from:: /gallery/pyplots/auto_subplots_adjust
3941
"""
4042

4143
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)