Skip to content

Commit 9704c63

Browse files
committed
DOC: Remove "Multiple lines using pyplot"
We should not promote the specific `plot(x, y, fmt, x2, y2, fmt)` anymore. This is a Matlabism and hard to read and reason about. Separate `plot()` calls are the better option. They don't need a dedicated pyplot example. Therefore, a redirect to the pyplot subplot example is sufficient, which as a side-topic has two plot calls in one subplot.
1 parent 7499f38 commit 9704c63

2 files changed

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

918
import matplotlib.pyplot as plt
@@ -21,9 +30,11 @@ def f(t):
2130
plt.subplot(211)
2231
plt.plot(t1, f(t1), color='tab:blue', marker='o')
2332
plt.plot(t2, f(t2), color='black')
33+
plt.title("Supblot 1")
2434

2535
plt.subplot(212)
2636
plt.plot(t2, np.cos(2*np.pi*t2), color='tab:orange', linestyle='--')
37+
plt.title("Subplot 2")
2738
plt.show()
2839

2940
# %%

0 commit comments

Comments
 (0)