ó ů)°Uc@ sÔddlmZddlZejZddljZddlmZddlmZddl j Z ddl j ZddljZddljZddljZddlZddlZdejfd„ƒYZdS(i˙˙˙˙(tdivisionN(tallow_rasterization(t docstringtSpinecB seZdZd„Zejd„ƒZd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zed„ƒZd„Zd„Zd„Zd„Zd„Zd„Zed„ƒZed„ƒZd„ZRS(s“an axis spine -- the line noting the data area boundaries Spines are the lines connecting the axis tick marks and noting the boundaries of the data area. They can be placed at arbitrary positions. See function:`~matplotlib.spines.Spine.set_position` for more information. The default position is ``('outward',0)``. Spines are subclasses of class:`~matplotlib.patches.Patch`, and inherit much of their behavior. Spines draw a line or a circle, depending if function:`~matplotlib.spines.Spine.set_patch_line` or function:`~matplotlib.spines.Spine.set_patch_circle` has been called. Line-like is the default. cC sdS(NR((tself((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt__str__$scK sÓtt|ƒj|||_|j|jjƒ||_|jdƒ|jt dƒ|j t dƒd|_ |j dƒ|j|jjƒd|_t|_d|_||_d|_tjƒ|_dS(sč - *axes* : the Axes instance containing the spine - *spine_type* : a string specifying the spine type - *path* : the path instance used to draw the spine Valid kwargs are: %(Patch)s tnonesaxes.edgecolorsaxes.linewidthg@tlineN(tsuperRt__init__taxest set_figuretfiguret spine_typet set_facecolort set_edgecolortrcParamst set_linewidthtNonetaxist set_zordert set_transformt transDatat_boundstFalset _smart_boundst _positiont_patht _patch_typet mtransformstIdentityTransformt_patch_transform(RR R tpathtkwargs((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyR 's           cC sW||_|jdkr.|jjj|ƒn%|jdkrS|jjj|ƒndS(s6set the spine and associated axis to have smart boundstlefttrightttoptbottomN(R"R#(stopR%(RR R tyaxistset_smart_boundstxaxis(Rtvalue((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyR'Rs  cC s|jS(s&get whether the spine has smart bounds(R(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pytget_smart_bounds\scC sLd|_||_|d|_|d|_d|_|j|jjƒdS(sset the spine to be circulartcircleiiN(Rt_centert_widtht_heightt_angleRR t transAxes(Rtcentertradius((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pytset_patch_circle`s      cC s d|_dS(sset the spine to be linearRN(R(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pytset_patch_lineiscC sŒ|j|jdƒ|j|jdƒf}|j|jƒ}|j|jƒ}tjƒj|d|dƒj|j ƒj |Œ|_ dS(sNOTE: This cannot be called until after this has been added to an Axes, otherwise unit conversion will fail. This maxes it very important to call the accessor method and not directly access the transformation member variable. iigŕ?N( tconvert_xunitsR,tconvert_yunitsR-R.RtAffine2Dtscalet rotate_degR/t translateR(RR1twidththeight((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt_recompute_transformns  cC s7|jdkr |jƒ|jStt|ƒjƒSdS(NR+(RR=RRRtget_patch_transform(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyR>~s cC s|jS(N(R(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pytget_path…scC s/|jdkr+d|_|j|jƒndS(Ntoutwardg(R@g(RRt set_position(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt_ensure_position_is_setˆs cC s,||_|jdk r(|jjƒndS(sÄregister an axis An axis should be registered with its corresponding spine from the Axes instance. This allows the spine to clear any axis properties when needed. N(RRtcla(RR((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt register_axisŽs cC s,d|_|jdk r(|jjƒndS(sClear the current spineN(RRRRC(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyRC™s cC s|jƒ|j}tj|ƒrO|dkr7d }qO|dkrOd }qOn|\}}|dkrw|dkrwtStSdS( sśreturn True if directly on axes frame This is useful for determining if a spine is the edge of an old style MPL plot. If so, this function will return True. R1R gŕ?tzerotdataiR@N(saxesgŕ?(sdatai(RBRtcbooktis_string_liketTrueR(Rtpositiont position_typetamount((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt is_frame_likeŸs       c C sť|jdkrdS|jdkr3|jd krI|jjj\}}n:|jd krp|jjj\}}ntd|jƒ‚|jrB||kr¨||}}n|}|}~~|jdkrđ|jj j\}}|jj ƒ}n6|jdkr&|jj j\}}|jj ƒ}nt |ƒ}|j ƒtj|ƒ}||krg||}}n||kr||}nN||k||k@}||} t| ƒrľ| d}n|}t||ƒ}||krß|}q0||k||k@}||} t| ƒr| d }n|}t||ƒ}qBn|j\}}|jj} |jdkru|| d<|| d ('axes',0.5) * 'zero' -> ('data', 0.0) R1RER"R#R%R$N(scenterszero(sleftsright(sbottomstop( RRvtget_spine_transformR Rtblended_transform_factoryR RRRRRC(RRJtttt2((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyRAFs       cC s|jƒ|jS(sget the spine position(RBR(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt get_positionps cC sa|jƒ|j\}}|dkr´|jj||jj|jj}|jdkrstj||jj ƒ}n=|jdkrtj|jj |ƒ}nt d|jƒ‚|S|jdkrŰ|jj ddƒ}n:|jdkr|jj ddƒ}nt d|jƒ‚|d kr%|S|d kr9||S|d krM||St d |ƒ‚d S(sget the spine transformRFR"R#R$R%sunknown spine spine_type: %stwhichtgridRjRkRls unknown spine_transform type: %sN(sleftsright(stopsbottom(sleftsright(stopsbottom( RBRmR t transScalet transLimitsR0R RRxRRQtget_yaxis_transformtget_xaxis_transform(Rtwhatthowt data_xformtresulttbase_transform((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyRwus2      cC s1|jdkrtdƒ‚n||f|_dS(sSet the bounds of the spine.R+s5set_bounds() method incompatible with circular spinesN(R RQR(RR]R^((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt set_bounds˜s cC s|jS(sGet the bounds of the spine.(R(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt get_boundsŸscK sš|dkr$tjd d gƒ}n||dkrHtjd d gƒ}nX|dkrltjd dgƒ}n4|dkrtjddgƒ}ntd|ƒ‚|||||}|S(sA (staticmethod) Returns a linear :class:`Spine`. R"gi R#gđ?R%R$s"unable to make path for spine "%s"(gi (gi (gđ?i (gđ?i (i g(i g(i gđ?(i gđ?(tmpathtPathRQ(tclsR R R!R R…((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt linear_spineŁs    cK s>tjjƒ}d}|||||}|j||ƒ|S(sC (staticmethod) Returns a circular :class:`Spine`. R+(R‰RŠt unit_circleR3(R‹R R1R2R!R R R…((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pytcircular_spineśs cC s|j|ƒdS(sö Set the edgecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples .. seealso:: :meth:`set_facecolor`, :meth:`set_edgecolor` For setting the edge or face color individually. N(R(Rtc((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt set_colorÁs (t__name__t __module__t__doc__RRtdedent_interpdR R'R*R3R4R=R>R?RBRDRCRMRgRRhRvRAR{RwR‡Rˆt classmethodRŒRŽR(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyRs2 +         S ; *  #   (t __future__Rt matplotlibRtmatplotlib.artisttartisttmartistRRtmatplotlib.transformst transformsRtmatplotlib.linestlinestmlinestmatplotlib.patchestpatchestmpatchestmatplotlib.pathR R‰tmatplotlib.cbookRGtnumpyRWRptPatchR(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyts