Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfbeda64

Browse files
anubhavshrimalQuLogic
authored andcommitted
Rectified plot error (#12501)
* Rectified plot errorThe plot shown on the page:https://matplotlib.org/tutorials/introductory/usage.html#sphx-glr-tutorials-introductory-usage-pyWill be possible only if plt.show() is outside the loop* Added corrections in docs as per requirements* Commented the code block to remove plot rendering* Added ::* corrected trailing spaces and bad indentation* Removed E402
1 parent566bd8b commitfbeda64

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

‎.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ per-file-ignores =
8181
tutorials/introductory/images.py: E402, E501
8282
tutorials/introductory/pyplot.py: E402, E501
8383
tutorials/introductory/sample_plots.py: E501
84-
tutorials/introductory/usage.py:E402,E501
84+
tutorials/introductory/usage.py: E501
8585
tutorials/text/annotations.py: E501
8686
tutorials/text/pgf.py: E501
8787
tutorials/text/text_intro.py: E402

‎tutorials/introductory/usage.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -603,18 +603,18 @@ def my_plotter(ax, data1, data2, param_dict):
603603
# Prior to version 1.0, show() generally could not be called
604604
# more than once in a single script (although sometimes one
605605
# could get away with it); for version 1.0.1 and above, this
606-
# restriction is lifted, so one can write a script like this:
607-
608-
importnumpyasnp
609-
importmatplotlib.pyplotasplt
610-
611-
plt.ioff()
612-
foriinrange(3):
613-
plt.plot(np.random.rand(10))
614-
plt.show()
615-
616-
###############################################################################
617-
#which makes three plots, one at a time.
606+
# restriction is lifted, so one can write a script like this::
607+
#
608+
#import numpy as np
609+
#import matplotlib.pyplot as plt
610+
#
611+
#plt.ioff()
612+
#for i in range(3):
613+
# plt.plot(np.random.rand(10))
614+
# plt.show()
615+
#
616+
# which makes three plots, one at a time. I.e. the second plot will show up,
617+
#once the first plot is closed.
618618
#
619619
# Summary
620620
# -------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp