@@ -4,15 +4,17 @@ AxesDivider
44The axes_divider module provide helper classes to adjust the axes
55positions of set of images in the drawing time.
66
7- * *Size * This provides a classese of units that the size of each axes
8- will be determined. For example, you can specify a fixed size
7+ * :mod: `~mpl_toolkits.axes_grid.axes_size ` provides a classese of
8+ units that the size of each axes will be determined. For example,
9+ you can specify a fixed size
910
10- * *Divider * this is the class that is used calculates the axes
11- position. It divides the given renctangular area into several
12- areas. You intialize the divider by setting the horizontal and
13- vertical list of sizes that the division will be based on. You then
14- use the new_locator method, whose return value is a callable object
15- that can be used to set the axes_locator of the axes.
11+ * :class: `~mpl_toolkits.axes_grid.axes_size.Divider ` this is the class
12+ that is used calculates the axes position. It divides the given
13+ renctangular area into several areas. You intialize the divider by
14+ setting the horizontal and vertical list of sizes that the division
15+ will be based on. You then use the new_locator method, whose return
16+ value is a callable object that can be used to set the axes_locator
17+ of the axes.
1618
1719
1820You first initialize the divider by specifying its grids, i.e., horiz and vert.
@@ -25,10 +27,11 @@ for example,::
2527 divider = Divider(fig, rect, horiz, vert)
2628
2729where, rect is a bounds of the box that will be divided and h0,..h3,
28- v0,..v2 need to be an callable object that returns a tuple of two
29- floats. The first float is the relative size, and the second float is
30- the absolute size. Use of the subclasses contained in the Size class
31- is recommanded. Lets' consider a following grid.
30+ v0,..v2 need to be an instance of classes in the
31+ :mod: `~mpl_toolkits.axes_grid.axes_size `. They have *get_size * method
32+ that returns a tuple of two floats. The first float is the relative
33+ size, and the second float is the absolute size. Consider a following
34+ grid.
3235
3336+-----+-----+-----+-----+
3437| v0 | | | |
@@ -39,34 +42,34 @@ is recommanded. Lets' consider a following grid.
3942+-----+-----+-----+-----+
4043
4144
42- * h0 => 2, 0
43- * h1 => 0, 2
44- * h2 => 0, 3
45+ * v0 => 0, 2
46+ * v1 => 2, 0
47+ * v2 => 3, 0
4548
4649The height of the bottom row is always 2 (axes_divider internally
4750assumes that the unit is inch). The first and the second rows with
48- height ration of 2:3. For example, if the total height of the grid 6,
49- the the first and second row will each occupy 2/(2+3) and 3/(2+3) of
51+ height ratio of 2:3. For example, if the total height of the grid 6,
52+ then the first and second row will each occupy 2/(2+3) and 3/(2+3) of
5053(6-1) inches. The widths of columns (horiz) will be similarly
5154determined. When aspect ratio is set, the total height (or width) will
5255be adjusted accordingly.
5356
5457
55- The Size class is a container class that contains several sub-class
58+ The :mod: ` mpl_toolkits.axes_grid.axes_size ` contains several classes
5659that can be used to set the horiz and vert. For example, for the
5760vertical configuration above will be::
5861
59- from Size import Fixed, Scaled
62+ from mpl_toolkits.axes_grid.axes_size import Fixed, Scaled
6063 vert = [Fixed(2), Scaled(2), Scaled(3)]
6164
62- After you set up the divider object, you
63- Then you create a locator instance which will be given to the axes.::
65+ After you set up the divider object, then you create a locator
66+ instance which will be given to the axes.::
6467
6568 locator = divider.new_locator(nx=0, ny=1)
6669 ax.set_axes_locator(locator)
6770
6871The return value of the new_locator method is a instance of the
69- AxesLocator class. It is a callable object that will return the
72+ AxesLocator class. It is a callable object that returns the
7073location and size of the cell at the first column and the second row.
7174You may create a locator that spans over multiple cells.::
7275
0 commit comments