From: Maximilian Friedersdorff Date: Mon, 28 Jan 2019 19:46:03 +0000 (+0000) Subject: feat: Make styling explicit X-Git-Url: https://git.friedersdorff.com/?p=max%2Fplotting_with_matplotlib.git;a=commitdiff_plain;h=45085ad4464c027cad0713b56112ceb7b4eb1dfc feat: Make styling explicit --- diff --git a/slides.rst b/slides.rst index 68003ae..e49b2bd 100644 --- a/slides.rst +++ b/slides.rst @@ -119,3 +119,9 @@ Subplots .. code-block:: python :include: subplot.py + :end-at: ax.set_xlabel('XLabel0') + +.. code-block:: python + :include: subplot.py + :start-at: for i in range(3): + diff --git a/subplot.py b/subplot.py index d817ec5..de99cb1 100644 --- a/subplot.py +++ b/subplot.py @@ -10,7 +10,6 @@ ax.plot(np.arange(0, 1e6, 1000)) ax.set_ylabel('YLabel0') ax.set_xlabel('XLabel0') - for i in range(3): ax = fig.add_subplot(gs[1, i]) ax.plot(np.arange(1., 0., -0.1) * 2000., @@ -21,6 +20,7 @@ for i in range(3): for tick in ax.get_xticklabels(): tick.set_rotation(55) +# Makes sure that axes labels are aligned with each other # same as fig.align_xlabels(); fig.align_ylabels() fig.align_labels()