10000 axes_grid toolkit initial check in · matplotlib/matplotlib@f44235e · GitHub
[go: up one dir, main page]

Skip to content

Commit f44235e

Browse files
committed
axes_grid toolkit initial check in
svn path=/trunk/matplotlib/; revision=7048
1 parent fe29f74 commit f44235e

38 files changed

+4772
-0
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
======================================================================
22

3+
2009-04-17 Initial check-in of the axes_grid toolkit. - JJL
4+
35
2009-04-17 Added a support for bbox_to_anchor in
46
offsetbox.AnchoredOffsetbox. Improved a documentation.
57
- JJL

doc/_static/demo_axes_grid.png

10.7 KB
Loading

doc/mpl_toolkits/axes_grid/figures

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../examples/axes_grid/

doc/mpl_toolkits/axes_grid/index.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
.. _toolkit_axesgrid-index:
3+
4+
Matplotlib AxesGrid Toolkit
5+
===========================
6+
7+
The matplotlib AxesGrid toolkit is a collection of helper classes to
8+
ease displaying multiple images in matplotlib. While the aspect
9+
parameter in matplotlib adjust the position of the single axes,
10+
AxesGrid toolkit provides a framework to adjust the position of
11+
multiple axes according to their aspects.
12+
13+
.. plot:: mpl_toolkits/axes_grid/figures/demo_axes_grid.py
14+
15+
16+
Documentation
17+
=============
18+
19+
.. toctree::
20+
:maxdepth: 2
21+
22+
users/index.rst
23+
Lines changed: 89 additions & 0 deletions
< 67E6 td data-grid-cell-id="diff-8e1634c53166036461bdfc0c3e19cefdae7a6dc7e4ff4dac1782585d4c5c938b-empty-5-1" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionNum-bgColor, var(--diffBlob-addition-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
AxesDivider
2+
===========
3+
4+
The axes_divider module provide helper classes to adjust the axes
+
positions of set of images in the drawing time.
6+
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
9+
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.
16+
17+
18+
You first initialize the divider by specifying its grids, i.e., horiz and vert.
19+
20+
for example,::
21+
22+
rect = [0.2, 0.2, 0.6, 0.6]
23+
horiz=[h0, h1, h2, h3]
24+
vert=[v0, v1, v2]
25+
divider = Divider(fig, rect, horiz, vert)
26+
27+
where, 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.
32+
33+
+-----+-----+-----+-----+
34+
| v0 | | | |
35+
+-----+-----+-----+-----+
36+
| v1 | | | |
37+
+-----+-----+-----+-----+
38+
|h0,v2| h1 | h2 | h3 |
39+
+-----+-----+-----+-----+
40+
41+
42+
* h0 => 2, 0
43+
* h1 => 0, 2
44+
* h2 => 0, 3
45+
46+
The height of the bottom row is always 2 (axes_divider internally
47+
assumes 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
50+
(6-1) inches. The widths of columns (horiz) will be similarly
51+
determined. When aspect ratio is set, the total height (or width) will
52+
be adjusted accordingly.
53+
54+
55+
The Size class is a container class that contains several sub-class
56+
that can be used to set the horiz and vert. For example, for the
57+
vertical configuration above will be::
58+
59+
from Size import Fixed, Scaled
60+
vert = [Fixed(2), Scaled(2), Scaled(3)]
61+
62+
After you set up the divider object, you
63+
Then you create a locator instance which will be given to the axes.::
64+
65+
locator = divider.new_locator(nx=0, ny=1)
66+
ax.set_axes_locator(locator)
67+
68+
The return value of the new_locator method is a instance of the
69+
AxesLocator class. It is a callable object that will return the
70+
location and size of the cell at the first column and the second row.
71+
You may create a locator that spans over multiple cells.::
72+
73+
locator = divider.new_locator(nx=0, nx=2, ny=1)
74+
75+
The above locator, when called, will return the position and size of
76+
the cells spanning the first and second column and the first row. You
77+
may consider it as [0:2, 1].
78+
79+
See the example,
80+
81+
.. plot:: mpl_toolkits/axes_grid/figures/simple_axes_divider2.py
82+
:include-source:
83+
84+
You can adjust the size of the each axes accroding to their x or y
85+
data limits (AxesX and AxesY), similar to the axes aspect parameter.
86+
87+
.. plot:: mpl_toolkits/axes_grid/figures/simple_axes_divider3.py
88+
:include-source:
89+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. _axes_grid_users-guide-index:
2+
3+
################################################
4+
The Matplotlib AxesGrid Toolkit User's Guide
5+
################################################
6+
7+
:Release: |version|
8+
:Date: |today|
9+
10+
.. toctree::
11+
12+
overview.rst

0 commit comments

Comments
 (0)
0