Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 424ac64

Browse files
committed
DOC: Add plt.show() to introductory pyplot example
Closes ##29227
1 parent 9d1a393 commit 424ac64

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
x = np.arange(0, 5, 0.1)
1616
y = np.sin(x)
1717
plt.plot(x, y)
18+
plt.show()
1819
1920
The explicit object-oriented API is recommended for complex plots, though
2021
pyplot is still usually used to create the figure and often the Axes in the
@@ -29,6 +30,7 @@
2930
y = np.sin(x)
3031
fig, ax = plt.subplots()
3132
ax.plot(x, y)
33+
plt.show()
3234
3335
3436
See :ref:`api_interfaces` for an explanation of the tradeoffs between the

0 commit comments

Comments
 (0)