From bcf12b4b129c6c1fd9d365f7e33725547dfe4271 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sun, 20 Nov 2022 13:33:46 +0100 Subject: [PATCH] Tweak markup in toolkits tutorials. --- tutorials/toolkits/axes_grid.py | 10 +++---- tutorials/toolkits/axisartist.py | 48 +++++++++++++++----------------- tutorials/toolkits/mplot3d.py | 2 +- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/tutorials/toolkits/axes_grid.py b/tutorials/toolkits/axes_grid.py index 4950010c8836..defc60f8cd4e 100644 --- a/tutorials/toolkits/axes_grid.py +++ b/tutorials/toolkits/axes_grid.py @@ -1,9 +1,9 @@ r""" .. _axes_grid1_users-guide-index: -========================================== -Overview of :mod:`mpl_toolkits.axes_grid1` -========================================== +====================== +The axes_grid1 toolkit +====================== :mod:`.axes_grid1` provides the following features: @@ -138,14 +138,14 @@ parasite axes. To create a host axes, you may use ``host_subplot`` or ``host_axes`` command. -Example 1. twinx +Example 1: twinx ~~~~~~~~~~~~~~~~ .. figure:: ../../gallery/axes_grid1/images/sphx_glr_parasite_simple_001.png :target: ../../gallery/axes_grid1/parasite_simple.html :align: center -Example 2. twin +Example 2: twin ~~~~~~~~~~~~~~~ ``twin`` without a transform argument assumes that the parasite axes has the diff --git a/tutorials/toolkits/axisartist.py b/tutorials/toolkits/axisartist.py index 087a4fab20ff..d05087e9f8b2 100644 --- a/tutorials/toolkits/axisartist.py +++ b/tutorials/toolkits/axisartist.py @@ -1,9 +1,7 @@ r""" -============================== -Overview of axisartist toolkit -============================== - -The axisartist toolkit tutorial. +====================== +The axisartist toolkit +====================== .. warning:: *axisartist* uses a custom Axes class @@ -267,14 +265,14 @@ 1. Changing tick locations and label. - Same as the original Matplotlib's axes:: + Same as the original Matplotlib's axes:: - ax.set_xticks([1, 2, 3]) + ax.set_xticks([1, 2, 3]) 2. Changing axis properties like color, etc. - Change the properties of appropriate artists. For example, to change - the color of the ticklabels:: + Change the properties of appropriate artists. For example, to change + the color of the ticklabels:: ax.axis["left"].major_ticklabels.set_color("r") @@ -340,18 +338,18 @@ default setting of above properties for each, "bottom", "left", "top", and "right" axis. - ========== =========== ========= ========== ========= ========== - ? ? left bottom right top - ---------- ----------- --------- ---------- --------- ---------- - axislabel direction '-' '+' '+' '-' - axislabel rotation 180 0 0 180 - axislabel va center top center bottom - axislabel ha right center right center - ticklabel direction '-' '+' '+' '-' - ticklabels rotation 90 0 -90 180 - ticklabel ha right center right center - ticklabel va center baseline center baseline - ========== =========== ========= ========== ========= ========== +========== =========== ========= ========== ========= ========== + ? ? left bottom right top +---------- ----------- --------- ---------- --------- ---------- +axislabel direction '-' '+' '+' '-' +axislabel rotation 180 0 0 180 +axislabel va center top center bottom +axislabel ha right center right center +ticklabel direction '-' '+' '+' '-' +ticklabels rotation 90 0 -90 180 +ticklabel ha right center right center +ticklabel va center baseline center baseline +========== =========== ========= ========== ========= ========== And, 'set_axis_direction("top")' means to adjust the text rotation etc, for settings suitable for "top" axis. The concept of axis @@ -490,10 +488,10 @@ def inv_tr(x, y): # has a cycle of 360 degree. # The second coordinate (latitude, but radius in polar) has a minimum of 0 extreme_finder = angle_helper.ExtremeFinderCycle(20, 20, - lon_cycle = 360, - lat_cycle = None, - lon_minmax = None, - lat_minmax = (0, np.inf), + lon_cycle=360, + lat_cycle=None, + lon_minmax=None, + lat_minmax=(0, np.inf), ) # Find a grid values appropriate for the coordinate (degree, diff --git a/tutorials/toolkits/mplot3d.py b/tutorials/toolkits/mplot3d.py index 49188e9f392f..d0d964ee7066 100644 --- a/tutorials/toolkits/mplot3d.py +++ b/tutorials/toolkits/mplot3d.py @@ -1,6 +1,6 @@ """ =================== -The mplot3d Toolkit +The mplot3d toolkit =================== Generating 3D plots using the mplot3d toolkit.