From 326eff4a2e263cd1fe4d63e8976e5a2f4e3fde6c Mon Sep 17 00:00:00 2001 From: Anubhav Shrimal Date: Wed, 17 Oct 2018 05:45:30 +0530 Subject: [PATCH] Backport PR #12501: Rectified plot error --- .flake8 | 2 +- tutorials/introductory/usage.py | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.flake8 b/.flake8 index fd1d6aecf6b2..ef218a394bf7 100644 --- a/.flake8 +++ b/.flake8 @@ -103,7 +103,7 @@ per-file-ignores = tutorials/introductory/images.py: E402, E501 tutorials/introductory/pyplot.py: E402, E501 tutorials/introductory/sample_plots.py: E501 - tutorials/introductory/usage.py: E402, E501 + tutorials/introductory/usage.py: E501 tutorials/text/annotations.py: E501 tutorials/text/pgf.py: E501 tutorials/text/text_intro.py: E402 diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index 7aa538c66bf1..fdd5ffc6068a 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -600,18 +600,18 @@ def my_plotter(ax, data1, data2, param_dict): # Prior to version 1.0, show() generally could not be called # more than once in a single script (although sometimes one # could get away with it); for version 1.0.1 and above, this -# restriction is lifted, so one can write a script like this: - -import numpy as np -import matplotlib.pyplot as plt - -plt.ioff() -for i in range(3): - plt.plot(np.random.rand(10)) - plt.show() - -############################################################################### -# which makes three plots, one at a time. +# restriction is lifted, so one can write a script like this:: +# +# import numpy as np +# import matplotlib.pyplot as plt +# +# plt.ioff() +# for i in range(3): +# plt.plot(np.random.rand(10)) +# plt.show() +# +# which makes three plots, one at a time. I.e. the second plot will show up, +# once the first plot is closed. # # Summary # -------