File: //opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyc
�
[�3Lc @ s d Z d d l j Z d d l m Z d d l Z d d l Z d e f d � � YZ
d e f d � � YZ d e
f d � � YZ d
e
f d � � YZ
d d d
� � YZ i Z d � Z d � Z d d l m Z e e � Z d � Z d � Z d � Z e d k re � e � n d S( s
The axes_divider module provide helper classes to adjust the positions of
multiple axes at the drawing time.
Divider: this is the class that is used calculates the axes
position. It divides the given renctangular area into several sub
rectangles. You intialize the divider by setting the horizontal
and vertical list of sizes that the division will be based on. You
then use the new_locator method, whose return value is a callable
object that can be used to set the axes_locator of the axes.
i����N( t SubplotBaset Dividerc B s� e Z d Z d d d � Z e d � � Z e d � � Z d � Z d � Z d � Z
d � Z d � Z d
� Z
d � Z d � Z e d
� Z d � Z d d d d � Z d d d � Z RS( s�
This is the class that is used calculates the axes position. It
divides the given renctangular area into several
sub-rectangles. You intialize the divider by setting the
horizontal and vertical lists of sizes
(:mod:`mpl_toolkits.axes_grid.axes_size`) that the division will
be based on. You then use the new_locator method to create a
callable object that can be used to as the axes_locator of the
axes.
t Cc C sL | | _ | | _ | | _ | | _ | | _ | | _ d | _ d | _ d S( s�
:param fig: matplotlib figure
:param pos: position (tuple of 4 floats) of the rectangle that
will be divided.
:param horizontal: list of sizes
(:mod:`~mpl_toolkits.axes_grid.axes_size`)
for horizontal division
:param vertical: list of sizes
(:mod:`~mpl_toolkits.axes_grid.axes_size`)
for vertical division
:param aspect: if True, the overall rectalngular area is reduced
so that the relative part of the horizontal and
vertical scales have same scale.
:param anchor: Detrmine how the reduced rectangle is placed
when aspect is True,
i N( t _figt _post _horizontalt _verticalt _anchort _aspectt
_xrefindext
_yrefindex( t selft figt post
horizontalt verticalt aspectt anchor( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt __init__$ s c C sl d \ } } x7 | D]/ } | j | � \ } } | | 7} | | 7} q W| d k rd | | | } | Sd Sd S( Ng ( g g ( t get_size( t lt
total_sizet renderert rs_sumt as_sumt st _rst _ast k( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt _calc_k@ s
c C sP d g } x@ | D]8 } | j | � \ } } | j | d | | | � q W| S( Ng i����( R t append( R R R t offsetsR R R ( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
_calc_offsetsQ s
!c C s
| | _ d S( s�
set the position of the rectangle.
:param pos: position (tuple of 4 floats) of the rectangle that
will be divided.
N( R ( R R
( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt set_position] s c C s | j S( s% return the position of the rectangle.( R ( R ( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt get_positionf s c C s_ | t j j j � k s* t | � d k r6 | | _ n% t d d j t j j j � � � � d S( s�
:param anchor: anchor position
===== ============
value description
===== ============
'C' Center
'SW' bottom left
'S' bottom
'SE' bottom right
'E' right
'NE' top right
'N' top
'NW' top left
'W' left
===== ============
i s argument must be among %ss , N( t mtransformst Bboxt coefst keyst lenR t
ValueErrort joint BBox( R R ( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
set_anchorj s *c C s | j S( s return the anchor( R ( R ( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
get_anchor� s c C s
| | _ d S( s�
:param horizontal: list of sizes
(:mod:`~mpl_toolkits.axes_grid.axes_size`)
for horizontal division
N( R ( R t h( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt set_horizontal� s c C s | j S( s return horizontal sizes( R ( R ( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt get_horizontal� s c C s
| | _ d S( s�
:param horizontal: list of sizes
(:mod:`~mpl_toolkits.axes_grid.axes_size`)
for horizontal division
N( R ( R t v( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt set_vertical� s c C s | j S( s return vertical sizes( R ( R ( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt get_vertical� s c C s
| | _ d S( s.
:param anchor: True or False
N( R ( R R ( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
set_aspect� s c C s | j S( s
return aspect( R ( R ( ( sW /opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
get_aspect� s c C s | j j � \ } } | j � \ } } }
} | j | j | |
| � } | j | j | | | � }
| j � r@t | |
� } | j | j | | � } | j | j | | � } | d | d | } | d | d | } t j
j | | |
| � } t j
j | | | | � } | j | j
� | � } | j | j } } n= | j | j | | � } | j | j |
| � } | | } } | d k r�| d } n | d k r�| d } n | | | | | | | | | } } | | | | | | | | | } } t j
j | | | | � S( sT
:param nx, nx1: Integers specifying the column-position of the
cell. When nx1 is None, a single nx-th column is
specified. Otherwise location of columns spanning between nx
to nx1 (but excluding nx1-th column) is specified.
:param ny, ny1: same as nx and nx1, but for row positions.
i����i i N( R t get_size_inchesR"