From 903907d5afab58eb8402c7ea1b0c0794873888cd Mon Sep 17 00:00:00 2001 From: Natalie Jann Date: Tue, 26 May 2020 18:24:53 +0200 Subject: [PATCH 1/4] DOC:make labels better readable GH34305 --- doc/source/user_guide/visualization.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/user_guide/visualization.rst b/doc/source/user_guide/visualization.rst index 451ddf046416e..7872eb134cc7c 100644 --- a/doc/source/user_guide/visualization.rst +++ b/doc/source/user_guide/visualization.rst @@ -1332,6 +1332,8 @@ otherwise you will see a warning. .. ipython:: python + import matplotlib + matplotlib.rc('xtick', labelsize=8) fig, axes = plt.subplots(4, 4, figsize=(6, 6)) plt.subplots_adjust(wspace=0.5, hspace=0.5) target1 = [axes[0][0], axes[1][1], axes[2][2], axes[3][3]] From eea2ff91992ced46dcbab0d9c5d4aa888d055eab Mon Sep 17 00:00:00 2001 From: Natalie Jann Date: Tue, 26 May 2020 22:13:13 +0200 Subject: [PATCH 2/4] DOC: format changes for GH34305 --- doc/source/user_guide/visualization.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/user_guide/visualization.rst b/doc/source/user_guide/visualization.rst index 7872eb134cc7c..49ceb65b088bf 100644 --- a/doc/source/user_guide/visualization.rst +++ b/doc/source/user_guide/visualization.rst @@ -1333,7 +1333,9 @@ otherwise you will see a warning. .. ipython:: python import matplotlib - matplotlib.rc('xtick', labelsize=8) + + matplotlib.rc('xtick', labelsize=8) + fig, axes = plt.subplots(4, 4, figsize=(6, 6)) plt.subplots_adjust(wspace=0.5, hspace=0.5) target1 = [axes[0][0], axes[1][1], axes[2][2], axes[3][3]] From 11c32e01961cebd7781449f4cc1954304a09544c Mon Sep 17 00:00:00 2001 From: Natalie Jann Date: Wed, 27 May 2020 21:38:46 +0200 Subject: [PATCH 3/4] DOC: increase space between layout subplots GH34305 --- doc/source/user_guide/visualization.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/source/user_guide/visualization.rst b/doc/source/user_guide/visualization.rst index 49ceb65b088bf..59c2cf2bedbd2 100644 --- a/doc/source/user_guide/visualization.rst +++ b/doc/source/user_guide/visualization.rst @@ -1331,11 +1331,14 @@ don't affect to the output. You should explicitly pass ``sharex=False`` and ``sh otherwise you will see a warning. .. ipython:: python + :suppress: import matplotlib matplotlib.rc('xtick', labelsize=8) +.. ipython:: python + fig, axes = plt.subplots(4, 4, figsize=(6, 6)) plt.subplots_adjust(wspace=0.5, hspace=0.5) target1 = [axes[0][0], axes[1][1], axes[2][2], axes[3][3]] @@ -1350,6 +1353,7 @@ otherwise you will see a warning. :suppress: plt.close('all') + matplotlib.rcdefaults() Another option is passing an ``ax`` argument to :meth:`Series.plot` to plot on a particular axis: @@ -1373,6 +1377,7 @@ Another option is passing an ``ax`` argument to :meth:`Series.plot` to plot on a .. ipython:: python fig, axes = plt.subplots(nrows=2, ncols=2) + plt.subplots_adjust(wspace=0.2, hspace=0.4) df['A'].plot(ax=axes[0, 0]); axes[0, 0].set_title('A'); df['B'].plot(ax=axes[0, 1]); From 0df76b013ef70521ce1b0918a14e9c29860674ad Mon Sep 17 00:00:00 2001 From: Natalie Jann Date: Thu, 28 May 2020 11:44:22 +0200 Subject: [PATCH 4/4] DOC:apply suggestions from review GH34305 --- doc/source/user_guide/visualization.rst | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/doc/source/user_guide/visualization.rst b/doc/source/user_guide/visualization.rst index 59c2cf2bedbd2..a813348a342c2 100644 --- a/doc/source/user_guide/visualization.rst +++ b/doc/source/user_guide/visualization.rst @@ -1330,16 +1330,9 @@ When multiple axes are passed via the ``ax`` keyword, ``layout``, ``sharex`` and don't affect to the output. You should explicitly pass ``sharex=False`` and ``sharey=False``, otherwise you will see a warning. -.. ipython:: python - :suppress: - - import matplotlib - - matplotlib.rc('xtick', labelsize=8) - .. ipython:: python - fig, axes = plt.subplots(4, 4, figsize=(6, 6)) + fig, axes = plt.subplots(4, 4, figsize=(9, 9)) plt.subplots_adjust(wspace=0.5, hspace=0.5) target1 = [axes[0][0], axes[1][1], axes[2][2], axes[3][3]] target2 = [axes[3][0], axes[2][1], axes[1][2], axes[0][3]] @@ -1353,7 +1346,6 @@ otherwise you will see a warning. :suppress: plt.close('all') - matplotlib.rcdefaults() Another option is passing an ``ax`` argument to :meth:`Series.plot` to plot on a particular axis: @@ -1377,7 +1369,7 @@ Another option is passing an ``ax`` argument to :meth:`Series.plot` to plot on a .. ipython:: python fig, axes = plt.subplots(nrows=2, ncols=2) - plt.subplots_adjust(wspace=0.2, hspace=0.4) + plt.subplots_adjust(wspace=0.2, hspace=0.5) df['A'].plot(ax=axes[0, 0]); axes[0, 0].set_title('A'); df['B'].plot(ax=axes[0, 1]);