Skip to content

Commit d73ce8c

Browse files
authored
Merge pull request matplotlib#31709 from meeseeksmachine/auto-backport-of-pr-31704-on-v3.11.x
Backport PR matplotlib#31704 on branch v3.11.x (DOC: Remove pyplot text example)
2 parents 9e2c940 + 7d55762 commit d73ce8c

2 files changed

Lines changed: 20 additions & 49 deletions

File tree

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
"""
2-
===========
3-
Simple plot
4-
===========
2+
==========
3+
Basic plot
4+
==========
55
6-
A simple plot where a list of numbers are plotted against their index,
7-
resulting in a straight line. Use a format string (here, 'o-r') to set the
8-
markers (circles), linestyle (solid line) and color (red).
6+
A basic plot using the :ref:`pyplot_interface`.
7+
8+
- `~.pyplot.plot` plots the data y versus x as lines and/or markers.
9+
- `~.pyplot.title`, `~.pyplot.xlabel` and `~.pyplot.ylabel` set the title,
10+
x-axis label and y-axis label.
11+
- `~.pyplot.show` displays the plot.
912
1013
.. redirect-from:: /gallery/pyplots/fig_axes_labels_simple
1114
.. redirect-from:: /gallery/pyplots/pyplot_formatstr
15+
.. redirect-from:: /gallery/pyplots/pyplot_text
1216
"""
1317

1418
import matplotlib.pyplot as plt
19+
import numpy as np
20+
21+
x = np.arange(0.0, 2.0, 0.01)
22+
y = np.sin(2 * np.pi * x)
1523

16-
plt.plot([1, 2, 3, 4], 'o-r')
17-
plt.ylabel('some numbers')
24+
plt.plot(x, y)
25+
plt.title("A basic plot using pyplot")
26+
plt.xlabel('Time [s]')
27+
plt.ylabel('Voltage [mV]')
1828
plt.show()
1929

2030
# %%
@@ -25,5 +35,7 @@
2535
# in this example:
2636
#
2737
# - `matplotlib.pyplot.plot`
38+
# - `matplotlib.pyplot.title`
39+
# - `matplotlib.pyplot.ylabel`
2840
# - `matplotlib.pyplot.ylabel`
2941
# - `matplotlib.pyplot.show`

galleries/examples/pyplots/pyplot_text.py

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

0 commit comments

Comments
 (0)