From 39de23bbffd43d66f3d6b2f7d2ddd3df15a2f83b Mon Sep 17 00:00:00 2001 From: Yusei Tahara Date: Fri, 27 Dec 2019 10:12:03 +0900 Subject: [PATCH 1/2] Make pyplot import explicit in the 10 minutes to pandas page Beginners don't know what is `plt`, thus it is better to show how to import it explicitly. --- doc/source/getting_started/10min.rst | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/source/getting_started/10min.rst b/doc/source/getting_started/10min.rst index 66e500131b316..970a3f8dc765c 100644 --- a/doc/source/getting_started/10min.rst +++ b/doc/source/getting_started/10min.rst @@ -697,12 +697,6 @@ Plotting See the :ref:`Plotting ` docs. -.. ipython:: python - :suppress: - - import matplotlib.pyplot as plt - plt.close('all') - .. ipython:: python ts = pd.Series(np.random.randn(1000), @@ -717,6 +711,8 @@ of the columns with labels: .. ipython:: python + import matplotlib.pyplot as plt + df = pd.DataFrame(np.random.randn(1000, 4), index=ts.index, columns=['A', 'B', 'C', 'D']) df = df.cumsum() From 863d6ce919c5649989dc53a38e4fb5442e4b442e Mon Sep 17 00:00:00 2001 From: Yusei Tahara Date: Sat, 28 Dec 2019 15:23:59 +0900 Subject: [PATCH 2/2] import pyplot at the beginning of Plotting section Also add a comment about the standard convention for referencing the matplotlib API. --- doc/source/getting_started/10min.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/source/getting_started/10min.rst b/doc/source/getting_started/10min.rst index 970a3f8dc765c..3055a22129b91 100644 --- a/doc/source/getting_started/10min.rst +++ b/doc/source/getting_started/10min.rst @@ -697,6 +697,13 @@ Plotting See the :ref:`Plotting ` docs. +We use the standard convention for referencing the matplotlib API: + +.. ipython:: python + + import matplotlib.pyplot as plt + plt.close('all') + .. ipython:: python ts = pd.Series(np.random.randn(1000), @@ -711,8 +718,6 @@ of the columns with labels: .. ipython:: python - import matplotlib.pyplot as plt - df = pd.DataFrame(np.random.randn(1000, 4), index=ts.index, columns=['A', 'B', 'C', 'D']) df = df.cumsum()