Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions galleries/examples/pyplots/pyplot_three.py

This file was deleted.

15 changes: 14 additions & 1 deletion galleries/examples/pyplots/pyplot_two_subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
Two subplots using pyplot
=========================

Create a figure with two subplots using `.pyplot.subplot`.
A typical pyplot usage pattern is to create subplots incrementally through
`~.pyplot.subplot`.

The three-digit number passed to `~.pyplot.subplot` specifies the position of
the subplot in the grid of subplots. ``211`` means "in a grid of 2 rows and 1 column,
create this subplot in the 1st position". ``212`` likewise means "in a grid of 2
rows and 1 column, create this subplot in the 2nd position".

After calling ``subplot()`` all following pyplot commands will modify that subplot
until a new subplot is created.

.. redirect-from:: /gallery/pyplots/pyplot_three
"""

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

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

# %%
Expand Down
Loading