Skip to content

Commit d92ece7

Browse files
rcomermeeseeksmachine
authored andcommitted
Backport PR matplotlib#31705: DOC: Remove "Multiple lines using pyplot"
1 parent d73ce8c commit d92ece7

2 files changed

Lines changed: 14 additions & 27 deletions

File tree

galleries/examples/pyplots/pyplot_three.py

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

galleries/examples/pyplots/pyplot_two_subplots.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@
33
Two subplots using pyplot
44
=========================
55
6-
Create a figure with two subplots using `.pyplot.subplot`.
6+
A typical pyplot usage pattern is to create subplots incrementally through
7+
`~.pyplot.subplot`.
8+
9+
The three-digit number passed to `~.pyplot.subplot` specifies the position of
10+
the subplot in the grid of subplots. ``211`` means "in a grid of 2 rows and 1 column,
11+
create this subplot in the 1st position". ``212`` likewise means "in a grid of 2
12+
rows and 1 column, create this subplot in the 2nd position".
13+
14+
After calling ``subplot()`` all following pyplot commands will modify that subplot
15+
until a new subplot is created.
16+
17+
.. redirect-from:: /gallery/pyplots/pyplot_three
718
"""
819

920
import matplotlib.pyplot as plt
@@ -21,9 +32,11 @@ def f(t):
2132
plt.subplot(211)
2233
plt.plot(t1, f(t1), color='tab:blue', marker='o')
2334
plt.plot(t2, f(t2), color='black')
35+
plt.title("Subplot 1")
2436

2537
plt.subplot(212)
2638
plt.plot(t2, np.cos(2*np.pi*t2), color='tab:orange', linestyle='--')
39+
plt.title("Subplot 2")
2740
plt.show()
2841

2942
# %%

0 commit comments

Comments
 (0)