ó ů)°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|_t|tjjƒsÉt‚||_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 isinstancet matplotlibtpathtPathtAssertionErrort_patht _patch_typet mtransformstIdentityTransformt_patch_transform(RR R Rtkwargs((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(R!t_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Ą|jdkst‚|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. R/iigŕ?N(R!Rtconvert_xunitsR0tconvert_yunitsR1R2R"tAffine2Dtscalet rotate_degR3t translateR$(RR5twidththeight((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt_recompute_transformns  cC s7|jdkr |jƒ|jStt|ƒjƒSdS(NR/(R!RAR$RRtget_patch_transform(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyRB~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(RDg(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(RRRRG(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyRG™s cC s|jƒ|j}tj|ƒrO|dkr7d }qO|dkrOd }qOnt|ƒdksmtdƒ‚|\}}|d kr•|dkr•tStSd S( 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. R5R gŕ?tzerotdataiisposition should be 2-tupleRDN(saxesgŕ?(sdatai(RFRtcbooktis_string_liketlenRtTrueR(Rtpositiont position_typetamount((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt is_frame_likeŸs       c C sÖ|jdkrdS|jdkr3|jdkrI|jjj\}}n:|jdkrp|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} | jdksjtd ƒ‚|jdkr|| d<|| didd 6dd 6dd6dd 6|j }||dd}||dd}dtj |||j j ƒf|_q¸t jd|j ƒd tjƒf|_nN|dkr|j dkr˛dtjjdddd|dƒf|_q¸|j dkrîdtjjddddd|ƒf|_q¸t jd|j ƒd tjƒf|_nž|dkr¸|j d krYdtjƒj|dƒf|_q¸|j d!krŒdtjƒjd|ƒf|_q¸t jd|j ƒd tjƒf|_ndS("s5calculate the offset transform performed by the spineR5R gŕ?RIRJiisposition should be 2-tupleRDtidentityR&R'R(R)i˙˙˙˙igR@tposts2unknown spine type "%s": no spine offset performedtpreN(saxesgŕ?(sdatai(saxessoutwardsdata(sleftsrightstopsbottom(i˙˙˙˙i(ii(ii˙˙˙˙(ii(sleftsright(sbottomstop(sleftsright(sbottomstop(RFRRKRLRMRR"R#t_spine_transformR tScaledTranslationR tdpi_scale_transtwarningstwarnR;t from_valuesR>(RRORPRQt offset_vectoffset_xtoffset_y((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyt_calc_offset_transform sb                ! !   !!  cC sć|dkrn4t|ƒdks-tdƒ‚|ddksCt‚||_|jƒ|jƒ}|jdkrŒtj||jj ƒ}n*|jdkrśtj|jj |ƒ}n|j |ƒ|j d k râ|j j ƒnd S(spset the position of the spine Spine position is specified by a 2 tuple of (position type, amount). The position types are: * 'outward' : place the spine out from the data area by the specified number of points. (Negative values specify placing the spine inward.) * 'axes' : place the spine at the specified Axes coordinate (from 0.0-1.0). * 'data' : place the spine at the specified data coordinate. Additionally, shorthand notations define a special positions: * 'center' -> ('axes',0.5) * 'zero' -> ('data', 0.0) R5RIis&position should be 'center' or 2-tupleiRDR RJR&R'R)R(N(scenterszero(soutwardsaxessdata(sleftsright(sbottomstop(RMRRR{tget_spine_transformR R"tblended_transform_factoryR RRRRRG(RROtttt2((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyREFs        cC s|jƒ|jS(sget the spine position(RFR(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 transformRJR&R'R(R)sunknown spine spine_type: %stwhichtgridRoRpRqs unknown spine_transform type: %sN(sleftsright(stopsbottom(sleftsright(stopsbottom( RFRrR t transScalet transLimitsR4R R"R}RRVtget_yaxis_transformtget_xaxis_transform(Rtwhatthowt data_xformtresulttbase_transform((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyR|us2      cC s1|jdkrtdƒ‚n||f|_dS(sSet the bounds of the spine.R/s5set_bounds() method incompatible with circular spinesN(R RVR(RRbRc((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đ?(tmpathRRV(tclsR R R%RRŠ((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ŽRt unit_circleR7(RR R5R6R%RR 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.R7R8RARBRCRFRHRGRRRlRRmR{RER€R|RŒRt classmethodRR’R”(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyRs2 +         S ; *  #   (t __future__RRRtmatplotlib.artisttartisttmartistRRtmatplotlib.transformst transformsR"tmatplotlib.linestlinestmlinestmatplotlib.patchestpatchestmpatchestmatplotlib.pathRRŽtmatplotlib.cbookRKtnumpyR\RutPatchR(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/spines.pyts