Jc @ s d Z d d k i Z d d k i Z d d k i Z d d k Z d d k l Z l Z l Z l Z d d k l Z d d k l Z d d k l Z d d k l Z e Z d Z d d Z d d Z d e i f d YZ d e f d YZ d e f d YZ d e f d YZ d e f d YZ! d e f d YZ" d e f d YZ# d e f d YZ$ d S( s The OffsetBox is a simple container artist. The child artist are meant to be drawn at a relative position to its parent. The [VH]Packer, DrawingArea and TextArea are derived from the OffsetBox. The [VH]Packer automatically adjust the relative postisions of their children, which should be instances of the OffsetBox. This is used to align similar artists together, e.g., in legend. The DrawingArea can contain any Artist as a child. The DrawingArea has a fixed width and height. The position of children relative to the parent is fixed. The TextArea is contains a single Text instance. The width and height of the TextArea instance is the width and height of the its child text. iN( t Bboxt BboxBaset TransformedBboxt BboxTransformTo( t FontProperties( t FancyBboxPatch( t rcParams( t bbox_artistc O s t o t | | n d S( N( t DEBUGt mbbox_artist( t argst kwargs( ( s: /usr/lib64/python2.6/site-packages/matplotlib/offsetbox.pyR s t fixedc C s t | \ } } | d j ol t i i d g g } | D] } | | | q9 ~ } | d } | d j o | d | } n | | f S| d j ok | t | t | d } t i i d g g } | D] } | | | q ~ } | d } | | f S| d j o t | } | d j o | | t | } n t | t | | } t i g } t t | D] } | | | | qx~ } | | f St d | f d S( s Geiven a list of (width, xdescent) of each boxes, calculate the total width and the x-offset positions of each items according to *mode*. xdescent is analagous to the usual descent, but along the x-direction. xdescent values are currently ignored. *wd_list* : list of (width, xdescent) of boxes to be packed. *sep* : spacing between boxes *total* : Intended total length. None if not used. *mode* : packing mode. 'fixed', 'expand', or 'equal'. R i it expandg ?t equals Unknown mode : %sN( t zipt npt addt accumulatet Nonet sumt lent maxt floatt arrayt ranget ValueError( t wd_listt totalt sept modet w_listt d_listt _[1]t wt offsets_t offsetst _[2]t maxht _[3]t i( ( s: /usr/lib64/python2.6/site-packages/matplotlib/offsetbox.pyt _get_packed_offsets( s( 8 8 >t baselinec C s | d j o1 t g } | D] \ } } | | q ~ } n | d j o t g } | D] \ } } | | | qY ~ } t g } | D] \ } } | | q ~ } | | } g } | D] \ } } | d q ~ } n | d j o1 d } g } | D] \ } } | | q ~ } n | d j o9 d } g } | D] \ } } | | | | q:~ } n^ | d j o= d } g } | D] \ } } | | | d | q~ } n t d | f | | | f S( s* Geiven a list of (height, descent) of each boxes, align the boxes with *align* and calculate the y-offsets of each boxes. total width and the offset positions of each items according to *mode*. xdescent is analagous to the usual descent, but along the x-direction. xdescent values are currently ignored. *hd_list* : list of (width, xdescent) of boxes to be aligned. *sep* : spacing between boxes *height* : Intended total length. None if not used. *align* : align mode. 'baseline', 'top', 'bottom', or 'center'. R* g t leftt topt rightt bottomt centerg ?s Unknown Align mode : %sN( R+ s top( R- R. ( R R R ( t hd_listt heightt alignR! t ht dR% t height_descentR' t descentt _[4]R$ t _[5]t _[6]t _[7]( ( s: /usr/lib64/python2.6/site-packages/matplotlib/offsetbox.pyt _get_aligned_offsetsW s$ 1 1- + + 3 7t OffsetBoxc B sz e Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z RS( s The OffsetBox is a simple container artist. The child artist are meant to be drawn at a relative position to its parent. c O s/ t t | i | | g | _ d | _ d S( Ni ( i i ( t superR<