From 8acb82e2f7d7b47630e43ba11be4b9bfbb3f54a4 Mon Sep 17 00:00:00 2001 From: Anubhav Shrimal Date: Fri, 12 Oct 2018 15:14:44 +0530 Subject: [PATCH 1/6] Rectified plot error The plot shown on the page: https://matplotlib.org/tutorials/introductory/usage.html#sphx-glr-tutorials-introductory-usage-py Will be possible only if plt.show() is outside the loop --- tutorials/introductory/usage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index 3c2835295323..673f8e694d3c 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -611,7 +611,7 @@ def my_plotter(ax, data1, data2, param_dict): plt.ioff() for i in range(3): plt.plot(np.random.rand(10)) - plt.show() +plt.show() ############################################################################### # which makes three plots, one at a time. From 8f00d15708e5c41963bd1db864509cef55274f93 Mon Sep 17 00:00:00 2001 From: Anubhav Shrimal Date: Tue, 16 Oct 2018 17:37:22 +0530 Subject: [PATCH 2/6] Added corrections in docs as per requirements --- tutorials/introductory/usage.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index 673f8e694d3c..ab0110d853ff 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -611,10 +611,11 @@ def my_plotter(ax, data1, data2, param_dict): plt.ioff() for i in range(3): plt.plot(np.random.rand(10)) -plt.show() + plt.show() ############################################################################### -# which makes three plots, one at a time. +# which makes three plots, one at a time i.e. the second plot will show up, +# once the first plot is closed and the third after the second plot is closed. # # Summary # ------- From cae77fcf1dd53c6f35d44ab02d8fe595a7bf2977 Mon Sep 17 00:00:00 2001 From: Anubhav Shrimal Date: Tue, 16 Oct 2018 19:49:26 +0530 Subject: [PATCH 3/6] Commented the code block to remove plot rendering --- tutorials/introductory/usage.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index ab0110d853ff..fce13d6e4386 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -604,16 +604,15 @@ def my_plotter(ax, data1, data2, param_dict): # 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() - -############################################################################### +# +# 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 and the third after the second plot is closed. # From 1967ddcfe18bfd1e912d075a773ba723b21f0939 Mon Sep 17 00:00:00 2001 From: Anubhav Shrimal Date: Tue, 16 Oct 2018 20:04:22 +0530 Subject: [PATCH 4/6] Added :: --- tutorials/introductory/usage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index fce13d6e4386..cffb9d90f777 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -603,7 +603,7 @@ 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: +# restriction is lifted, so one can write a script like this:: # # import numpy as np # import matplotlib.pyplot as plt From 296a0e9e30bdf0c1ab1786b6cd22af76e5c98d4d Mon Sep 17 00:00:00 2001 From: Anubhav Shrimal Date: Tue, 16 Oct 2018 23:21:14 +0530 Subject: [PATCH 5/6] corrected trailing spaces and bad indentation --- tutorials/introductory/usage.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index cffb9d90f777..5777a9be6197 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -605,16 +605,16 @@ def my_plotter(ax, data1, data2, param_dict): # 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 i.e. the second plot will show up, -# once the first plot is closed and the third after the second plot is closed. +# 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 # ------- From 645ee13204296c0a2a4c8070e5b4a9efd91c658e Mon Sep 17 00:00:00 2001 From: Anubhav Shrimal Date: Wed, 17 Oct 2018 00:31:16 +0530 Subject: [PATCH 6/6] Removed E402 --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index ae9a5376d392..bad5b09da8b4 100644 --- a/.flake8 +++ b/.flake8 @@ -82,7 +82,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