)Uc@ sdZddlmZddlZddlmZddlmZddlZddlm Z ddl m Z m Z m Z mZmZmZmZddlmZdd lmZdd lmZmZmZmZdd lmZdd lmZdd lmZddlmZe d\Z!Z"Z#Z$Z%Z&Z'Z(dZ)de fdYZ*dfdYZ+e*j,Z-e*j.Z/e*j0Z0e*j1Z1ej2j3dej4e*ej5e*j6j7dS(sn This module contains all the 2D line class which can draw with a variety of line styles, markers and colors. i(tdivisionN(tma(tverbose(tArtist(titerabletis_string_liket is_numliket ls_mappertdedenttflattent is_math_text(tcolorConverter(tPath(tAffine2DtBboxtTransformedPathtIdentityTransform(trcParams(tallow_rasterization(t docstring(tFontPropertiesicC st|dkrFtj||d||d|dk\}|S|d |d }}|d||d|}} |d| d} |||||| | } | dk| dk@} ||d||d|dk} | | d | dB@} || ||| | }}||d||d|dk}|| @}| jj\}|jj\}tj||fS(s Determine if any line segments are within radius of a point. Returns the list of line segments that are within that radius. iiii(tlentnptnonzerotravelt concatenate(tcxtcytxtytradiustrestxrtyrtdxtdytLnorm_sqtut candidatest point_hitstpxtpyt line_hitstpointstlines((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt segment_hitss 0$$ tLine2DcB ss eZdZidd6dd6dd6dd6d d 6d d 6d d 6ZZid d6dd6dd6dd6Zidd6ZiZejeejeej ej Z i!dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBe 6dCe 6dDe 6dEe6dFe6dGe6dHe6dIe6d d 6d d 6d d 6ZZdZdZdOZdZdZdUZdddddddddVdJddddddWdddXZdYZdZZd[Zd\Z d]Z!d^Z"d_Z#d`Z$daZ%dbZ&e'j&je&_dcZ(ddZ)e*deZ+ddfZ,dgZ-dhZ.e/diZ0djZ1dkZ2dlZ3dmZ4dnZ5doZ6dpZ7dqZ8e*drZ9dsZ:dtZ;duZ<e=dvZ>e=dwZ?e=dxZ@dyZAdzZBd{ZCd|ZDd}ZEd~ZFdZGdZHdZIdZJdZKdZLdZMdZNdZOdZPdZQdZRdZSdZTdZUdZVdZWdZXdZYdZZdZ[e\j]ddZ^dZ_dZ`eaddgddgddgddggeajbeajceajceajdgZeeaddgddgddgddggeajbeajceajceajdgZfeaddgddgddgddgddggeajbeajceajceajceajdgZgeaddgddgddgddggeajbeajceajceajdgZheaddgddgddgddggeajbeajceajceajdgZidZjdZkdZldZmdZndZodZpdZqdZrdZsdZtdZueaddgddggZvdZwdZxeaddgddggZydZzdZ{eaddgddggZ|dZ}dZ~eaddgddgddgddggeajbeajceajbeajcgZdZeaddgddgddgddgddgddggeajbeajceajbeajceajbeajcgZdZdZdZdZeaddgddgddggZdZdZdZdZeaddgddgddgddggeajbeajceajbeajcgZdZdZe*dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZe*dZdZdZdZdZdZdZdZdZdZdZRS(s A line - the line can have both a solid linestyle connecting all the vertices, and a marker at each vertex. Additionally, the drawing of the solid line is influenced by the drawstyle, eg one can create "stepped" lines in various styles. t _draw_solidt-t _draw_dasheds--t_draw_dash_dots-.t _draw_dottedt:t _draw_nothingtNonet tt _draw_linestdefaultt_draw_steps_mids steps-midt_draw_steps_pres steps-pret_draw_steps_posts steps-posttstepst _draw_pointt.t _draw_pixelt,t _draw_circletot_draw_triangle_downtvt_draw_triangle_upt^t_draw_triangle_lefttt_draw_tri_downt1t _draw_tri_upt2t_draw_tri_leftt3t_draw_tri_rightt4t _draw_squaretst_draw_pentagontpt _draw_start*t_draw_hexagon1tht_draw_hexagon2tHt _draw_plust+t_draw_xRt _draw_diamondtDt_draw_thin_diamondtdt _draw_vlinet|t _draw_hlinet_t_draw_tickleftt_draw_tickrightt _draw_tickupt_draw_tickdownt_draw_caretleftt_draw_caretrightt _draw_caretupt_draw_caretdowntfulltlefttrighttbottomttopitbutttroundt projectingtmitertbevelc C s|jdkrd|jSt|drt|jdkrd|jd|jd|jd|jd|jd|jdfSt|drddjgt|j|jD]\}}d ||f^qSd SdS( NR8s Line2D(%s)t_xis#Line2D((%g,%g),(%g,%g),...,(%g,%g))iiRBs(%g,%g)sLine2D()(t_labelthasattrRR|t_ytjointzip(tselfRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt__str__s $A@tnoneicK stj|t|s(tdnt|sCtdn|dkr\td}n|dkrutd}n|dkrtd}n|dkrtd}n|dkrtd}n| dkrtd} n|dkrtd }n|dkr td }n|dkr$td }n|dkr=td }n|dkrRd }n|j||j||j||j ||j ||j ||j ||j ||j||j||j| |j|d|_|j| |j| |j| |j||j| d|_d|_|j|||_t|jr~|j|_ntjg|_ tjg|_!t"|_#t"|_$|j%||dS(s Create a :class:`~matplotlib.lines.Line2D` instance with *x* and *y* data in sequences *xdata*, *ydata*. The kwargs are :class:`~matplotlib.lines.Line2D` properties: %(Line2D)s See :meth:`set_linestyle` for a decription of the line styles, :meth:`set_marker` for a description of the markers, and :meth:`set_drawstyle` for a description of the draw styles. sxdata must be a sequencesydata must be a sequenceslines.linewidthslines.linestyles lines.markers lines.colorslines.markersizeslines.antialiasedslines.dash_capstyleslines.dash_joinstyleslines.solid_capstyleslines.solid_joinstyleR:g?N(&Rt__init__Rt RuntimeErrorR6Rtset_dash_capstyletset_dash_joinstyletset_solid_capstyletset_solid_joinstylet set_linestylet set_drawstylet set_linewidtht set_colort set_markert set_markeverytset_antialiasedtset_markersizet_dashSeqtset_markerfacecolortset_markerfacecoloralttset_markeredgecolortset_markeredgewidtht set_fillstylet_point_size_reductiontverticalOffsettupdatet pickradiusRt_pickerRtasarrayt_xorigt_yorigtTruet _invalidxt _invalidytset_data(Rtxdatatydatat linewidtht linestyletcolortmarkert markersizetmarkeredgewidthtmarkeredgecolortmarkerfacecolortmarkerfacecoloraltt fillstylet antialiasedt dash_capstyletsolid_capstyletdash_joinstyletsolid_joinstyleRt drawstylet markeverytkwargs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRsp"                                      c C st|jr|j||St|js:tdn|jsL|jrY|jnt|j dkrxt ifS|j j \}}|j |}|j}|dddf}|dddf}|jdkrtjd|j}n|jjd|j}|jdkrd||jd||jd}tjtj||d\} nt|j|j|||} | |j7} t r|jd krd G|jGd G|jG|jGHd G|GHd G|GHdG| GHnt| dktd| fS(s. Test whether the mouse event occurred on the line. The pick radius determines the precision of the location test (usually within five points of the value). Use :meth:`~matplotlib.lines.Line2D.get_pickradius` or :meth:`~matplotlib.lines.Line2D.set_pickradius` to view or modify it. Returns *True* if any values are within the radius along with ``{'ind': pointlist}``, where *pointlist* is the set of points within the radius. TODO: sort returned indices by distance s pick radius should be a distanceiNis,no figure set when check if mouse is on linegR@R6ius Checking linetattxttyttind(sNoneN(tcallablet _containsRRt ValueErrorRRtrecacheRt_xytFalset_transformed_pathtget_transformed_path_and_affinettransform_pathtverticestfigureR6twarningtwarntdpit _linestyleRRRRt less_equalR-t ind_offsetR}tdict( Rt mouseeventtpathtaffinetxyRRtpixelsReR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytcontainss8       %    cC s|jS(s1return the pick radius used for containment tests(R(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_pickradiusAscC s ||_dS(scSets the pick radius used for containment tests ACCEPTS: float distance in points N(R(RRe((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytset_pickradiusEscC s|jS(s- return the marker fillstyle (t _fillstyle(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt get_fillstyleLscC s"||jkst||_dS(s Set the marker fill style; 'full' means fill the whole marker. The other options are for half filled markers ACCEPTS: ['full' | 'left' | 'right' | 'bottom' | 'top'] N(t fillStylestAssertionErrorR(Rtfs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRRscC s ||_dS(s Set the markevery property to subsample the plot when using markers. Eg if ``markevery=5``, every 5-th marker will be plotted. *every* can be None Every point will be plotted an integer N Every N-th marker will be plotted starting with marker 0 A length-2 tuple of integers every=(start, N) will start at point start and plot every N-th marker ACCEPTS: None | integer | (startind, stride) N(t _markevery(Rtevery((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR\scC s|jS(sreturn the markevery setting(R(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt get_markeveryqscC s.t|r||_n ||_||_dS(sSets the event picker details for the line. ACCEPTS: float distance in points or callable pick function ``fn(artist, event)`` N(RRRR(RRX((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt set_pickerus   cC sttj}|j|jj|jdt|jdk rp|j d|j j d}|j |}n|S(NtignoregR@g?( Rtunittupdate_from_data_xyt get_transformt transformt get_xydataRt_markerR6t _markersizeRRtpadded(Rtrenderertbboxtms((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_window_extents !cC sttj|||jdk r@|jjjd|j|_n|jdk rp|jjjd|j|_ ndS(Ntunits( Rtset_axestxaxisR6t callbackstconnecttrecache_alwayst_xcidtyaxist_ycid(Rtax((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs !cG sOt|dkr%|d\}}n |\}}|j||j|dS(sb Set the x and y data ACCEPTS: 2D array (rows are x, y) or two 1D arrays iiN(Rt set_xdatat set_ydata(RtargsRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs   cC s|jdtdS(Ntalways(RR(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRscC s |s|jri|j|j}tj|jrHtj|t}ntj|t}|j}n |j }|s|j r|j |j }tj|j rtj|t}ntj|t}|j}n |j }t|dkr$t|dkr$|tj|jt}nt|dkrdt|dkrd|tj|jt}nt|t|krtdn|jt|df}|jt|df}tj|stj|rtj||fd|_ntj||fd|_|jdddf|_ |jdddf|_ t|_|jrt|dkr|j|r|jjdkr|jjdkr|jdkrt|_nt|dr|jj }nd}t!|jd||_d|_"t|_t|_ dS(Nis'xdata and ydata must be the same lengthiidt rectilineartlineart_path(#Rtconvert_xunitsRRt isMaskedArrayRtfloatRRR|Rtconvert_yunitsRRRtonestshapeRtreshapeRRRt _subslicetaxest _is_sortedtnamet get_xscaleRR6RR~Rt_interpolation_stepsR R(RRtxconvRtyconvRtinterpolation_steps((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRsP  $$ *   cC sS|dk r.t|j|ddf}n |j}t||j|_dS(N(R6R RRRRR(RtsubsliceR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt_transform_paths " cC s&tj||t|_t|_dS(s set the Transformation instance used by this artist ACCEPTS: a :class:`matplotlib.transforms.Transform` instance N(Rt set_transformRRR(Rtt((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs cC s8t|dkrdStj|d|dd!dkS(sreturn true if x is sortediiii(RRtalltrue(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRscC s|js|jr|jnd|_|jr|jr|jj\}}|jj|gd\}|jj|gd\}t t |dd|d}|j |_|j |n|j dkr|j n|jsdS|jd|j|j}|j||j|j|j|j|j|j|j|j|jr}|j}|j} n|j}|j } |j!| |j"||j#|j$|j%j&|j'd} | dkr\|j j(\} } t)| j*r\t+|| |_,|j-j&|j.d} t+|| } | ||| | j/q\n|j0dk r|j}|j||j|j1|j|j2|j|j|j3} | dkr|j j4\} } t)| j*r|j5}|dk rt6|r#|\}}n d|}}| j7dk rX| j7|d|}nd}| j*|d|}t8||}n| }t+|| }||||| j/qn|j9n|j9|j:ddS(NiRsRtitline2dR5R9(;RRRRRRt get_xboundR|t searchsortedtslicetmaxtstartRRR6t get_visiblet open_grouptget_gidtnew_gct _set_gc_cliptset_foregroundt_colorRt _antialiasedRt _linewidtht set_alphat_alphat is_dashedt _dashcapstylet_dashjoinstylet_solidcapstylet_solidjoinstylet set_joinstylet set_capstyletset_snaptget_snapt _lineStylestgetRRRRtgetattrt _lineFunct drawStylest _drawstyletfrozenRtget_markeredgecolort_markeredgewidtht _markerFunct!get_transformed_points_and_affineRRtcodesR trestoret close_group(RRtx0tx1ti0ti1RtgctcapRtfuncnamettpathRtdrawFuncRtstartindtstrideR8Rt subsampledt markerFunc((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytdraws~                          cC s|jS(N(R (R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_antialiased?scC s|jS(N(R(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt get_color@scC s|jS(N(R2(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt get_drawstyleAscC s|jS(N(R(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt get_linestyleBscC s|jS(N(R!(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt get_linewidthDscC s|jS(N(R(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt get_markerEscC s[t|jrM|jdkrM|j|jks?t|jrCdS|jSn|jS|jS(Ntautotk(Rt_markeredgecolorRtfilled_markersR R(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR4Gs cC s|jS(N(R5(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_markeredgewidthTscC sv|r|j}n |j}|dksEt|rI|jdkrI|St|rn|jdkrn|jS|SdS(NRRO(t_markerfacecoloraltt_markerfacecolorR6RtlowerR(Rtalttfc((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt_get_markerfacecolorVs  *cC s|jdtS(NRW(RYR(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_markerfacecolorcscC s|jdtS(NRW(RYR(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_markerfacecoloraltfscC s|jS(N(R(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_markersizeiscC s"|jd||jd|fS(sa Return the xdata, ydata. If *orig* is *True*, return the original data torig(t get_xdatat get_ydata(RR]((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_datakscC s*|r |jS|jr#|jn|jS(s| Return the xdata. If *orig* is *True*, return the original data, else the processed data. (RRRR|(RR]((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR^ts   cC s*|r |jS|jr#|jn|jS(s| Return the ydata. If *orig* is *True*, return the original data, else the processed data. (RRRR(RR]((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR_s   cC s&|js|jr|jn|jS(se Return the :class:`~matplotlib.path.Path` object associated with this line. (RRRR(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_paths cC s&|js|jr|jn|jS(s< Return the *xy* data as a Nx2 numpy array. (RRRR(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs cC s ||_dS(sk True if line should be drawin with antialiased rendering ACCEPTS: [True | False] N(R (Rtb((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRscC s ||_dS(sR Set the color of the line ACCEPTS: any matplotlib color N(R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRscC s ||_dS(sA Set the drawstyle of the plot 'default' connects the points with lines. The steps variants produce step-plots. 'steps' is equivalent to 'steps-pre' and is maintained for backward-compatibility. ACCEPTS: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ] N(R2(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs cC s ||_dS(sV Set the line width in points ACCEPTS: float value in points N(R!(Rtw((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRscC sxb|jD]W}|j|r |j|t|t|krW|t|}nd}Pq q W||jkr|tkrt|}qtjd|t|fn|dkrd}n||_ dS(s Set the linestyle of the line (also accepts drawstyles) ================ ================= linestyle description ================ ================= ``'-'`` solid ``'--'`` dashed ``'-.'`` dash_dot ``':'`` dotted ``'None'`` draw nothing ``' '`` draw nothing ``''`` draw nothing ================ ================= 'steps' is equivalent to 'steps-pre' and is maintained for backward-compatibility. .. seealso:: :meth:`set_drawstyle` To set the drawing style (stepping) of the plot. ACCEPTS: [ ``'-'`` | ``'--'`` | ``'-.'`` | ``':'`` | ``'None'`` | ``' '`` | ``''`` ] and any drawstyle in combination with a linestyle, e.g. ``'steps--'``. R0sUnrecognized line style %s, %sR7R8R6N(R7R8( t drawStyleKeyst startswithRRR-RRtreportttypeR(RRtds((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs      cC sm||jkr+||_|j||_n>t|rL||_d|_ntjd|t|fdS(s Set the line marker ========== ========================== marker description ========== ========================== ``'.'`` point ``','`` pixel ``'o'`` circle ``'v'`` triangle_down ``'^'`` triangle_up ``'<'`` triangle_left ``'>'`` triangle_right ``'1'`` tri_down ``'2'`` tri_up ``'3'`` tri_left ``'4'`` tri_right ``'s'`` square ``'p'`` pentagon ``'*'`` star ``'h'`` hexagon1 ``'H'`` hexagon2 ``'+'`` plus ``'x'`` x ``'D'`` diamond ``'d'`` thin_diamond ``'|'`` vline ``'_'`` hline TICKLEFT tickleft TICKRIGHT tickright TICKUP tickup TICKDOWN tickdown CARETLEFT caretleft CARETRIGHT caretright CARETUP caretup CARETDOWN caretdown ``'None'`` nothing ``' '`` nothing ``''`` nothing '$...$' render the string using mathtext ========== ========================== ACCEPTS: [ ``'+'`` | ``'*'`` | ``','`` | ``'.'`` | ``'1'`` | ``'2'`` | ``'3'`` | ``'4'`` | ``'<'`` | ``'>'`` | ``'D'`` | ``'H'`` | ``'^'`` | ``'_'`` | ``'d'`` | ``'h'`` | ``'o'`` | ``'p'`` | ``'s'`` | ``'v'`` | ``'x'`` | ``'|'`` | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | CARETUP | CARETDOWN | CARETLEFT | CARETRIGHT | ``'None'`` | ``' '`` | ``''`` | '$...$'] t_draw_mathtext_paths Unrecognized marker style %s, %sN(t_markersRR6R RRfRg(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs8     cC s"|dkrd}n||_dS(sR Set the marker edge color ACCEPTS: any matplotlib color RON(R6RQ(Rtec((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR5s  cC s&|dkrtd}n||_dS(s] Set the marker edge width in points ACCEPTS: float value in points slines.markeredgewidthN(R6RR5(Rtew((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR?s  cC s"|dkrd}n||_dS(sS Set the marker face color. ACCEPTS: any matplotlib color RON(R6RU(RRX((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRIs  cC s"|dkrd}n||_dS(s] Set the alternate marker face color. ACCEPTS: any matplotlib color RON(R6RT(RRX((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRTs  cC s ||_dS(sG Set the marker size in points ACCEPTS: float N(R(Rtsz((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR_scC s||_t|_dS(sH Set the data np.array for x ACCEPTS: 1D array N(RRR(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRgs cC s||_t|_dS(sH Set the data np.array for y ACCEPTS: 1D array N(RRR(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRps cC sH|dkst|dkr.|jdn |jd||_dS(s Set the dash sequence, sequence of dashes with on off ink in points. If seq is empty or if seq = (None, None), the linestyle will be set to solid. ACCEPTS: sequence of on/off ink in points iR0s--N(NN(R6RRR(Rtseq((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt set_dashesys cC s|j||||dS(N(R0(RRR?Rttrans((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR9sc C sJddlm}ddlm}|jttdd}|ddd|jd |d td }t |j dkrd S|j j d d\} } |j j d d\} } | | } | | }t | |}t j| d| | d| j|j|j|}|j}|j||||||d S(sa Draws mathtext markers '$...$' using TextPath object. Submitted by tcb i(t PathPatch(tTextPathtsizeg?RiRVtfontpropertiestusetexs text.usetexNtaxisg?(ii(tmatplotlib.patchesRqtmatplotlib.textRrR+RRRNRRRtminRR t translatetscaletpoints_to_pixelsR\t _get_rgb_facet draw_markers(RRR?RRpRqRrtpropsttexttxmintymintxmaxtymaxtwidththeighttmax_dimt path_transtrgbFace((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRis$       cC s|j}tjdt|ddftj}|dddf|dddf|ddddf<|ddddf<|dddf|dddf|ddddf<|ddddf((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR<s )SS cC s|j}tjdt|ddftj}|dddf|dddf|ddddf<|ddddf<|dddf|dddf|ddddf<|ddddf((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR=s )SS cC s]|j}tjdt|dftj}d|dddf|dddf|ddddf((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR;s %AAS cO sdS(N((RRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR5scC s$|jd|j|||dS(Ntsolid(Rt draw_path(RRR?RRp((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR/s cC sI|jd|jdk r2|jd|jn|j|||dS(Ntdashedi(RRR6RoR(RRR?RRp((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR1s cC s$|jd|j|||dS(Ntdashdot(RR(RRR?RRp((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR2s cC s$|jd|j|||dS(Ntdotted(RR(RRR?RRp((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR3s c C sT|j|j|jdk|j|j|jd}tj|}|j}|j}|dkr|j|t j ||||n|jdt } |dkrd} n0|dkrd} n|d krd } nd } t j } |j | }|j|| |||||j d }|j|| |||| dS( Ng@g?RrRWRugp@RvgV@Rsgf@g(R+R|RRR R{R}RR~R t unit_circleRtunit_circle_righthalft rotate_deg( RRR?RRRcRRRt rgbFace_alttrotatet righthalf((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR?s.        gcC sN|jt|j}|j}|j|tj|j|||dS(N(R+RR}RR~R tunit_rectanglet_draw_pixel_transform(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRA s    c C sP|j|j|jdk|j|jd}tj||}|j}|j}|dkr|j|tj ||||n|jdt } |dkrd} n0|dkrd} n|d krd } nd } tj } |j | }|j|| |||||j d }|j|| |||| dS( Ng@g?RrRWRugp@RvgV@Rsgf@g( R+R|RR R{R}RR~R RRRR( RRR?RRRcRRRRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRCs.        gg?gig@iicC se|j|j|jdkd|j|j}|dksGt|dkro||}}d} d} ni|dkr||}}d } d } nA|dkr||}}d } d } n||}}d } d} tj||j| } |j} |j} | dkr<|j ||j | ||| n%|jdt }|j |j |j|jg}| dkr|d| d}|d | d}n| dkr|d | d}|d| d}nW| dkr|d| d}|d | d}n$|d | d}|d| d}|j ||| ||| |j ||| |||dS(Ng@g?tuptdownRsRtgigf@igV@igp@iRrRWRviRu(RRsleftsright(R+R|RRR R{RR}RR~t_triangle_pathRt_triangle_path_ut_triangle_path_lt_triangle_path_dt_triangle_path_r(RRR?RRt directiontoffsetRRtrottskipRRRRtmpathstmpatht mpath_alt((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt_draw_triangle;sX                  cC s|j||||ddS(NR(R(RRR?RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRGqscC s|j||||ddS(NR(R(RRR?RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyREuscC s|j||||ddS(NRs(R(RRR?RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRIyscC s|j||||ddS(NRt(R(RRR?RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRK}sc C s|j|j|jdk|j|j}tjddj|}|j}|j}|dkr|j|t j ||||n|jdt } |dkrd} n0|dkrd} n|d krd } nd } t ddgd dgd d gdd gddgg} t dd gd d gd d gdd gdd gg} |j | }|j|| |||||j|| |||| dS(Ng@gRrRWRugRvgf@Rsgp@gV@g?g?( R+R|RR RzR{R}RR~R RRR( RRR?RRtsideRRRRRRuRv((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRUs.      99 c C s|j|j|jdk|j|j}tjddjdj|}|j}|j}|dkr|j |t j ||||nt ddgddgddgddgg} t ddgddgddgddgg} |dkrd} n0|d kr+d } n|d kr@d } nd} |j| }|jd t } |j || |||||j || |||| dS(Ng@gi-Rrgg?Rugp@RvgV@Rsgf@RW( R+R|RR RzRR{R}RR~R RR( RRR?RRRRRRRtRsRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRbs.'   00    c C s|j|j|jdk|j|j}tjddjd}|j}|j}|dkr|j|d|}|j |t j ||||nt ddgddgddgddgg} t ddgddgddgddgg} |dkr#d } n0|d kr8d } n|d krMd } nd} |j| j|d|}|jdt } |j || |||||j || |||| dS(Ng@gi-Rrg333333?gg?Rugp@RvgV@Rsgf@RW( R+R|RR RzRR}RR{R~R RR( RRR?RRRRRRRtRsRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRds2    00    cC s#|j|j|jdkd|j|j}tj|}|j}|j}tjd} |dkr|j || ||||n| j } dt j dd} t| d| d| d| dg} t| d| d | d | d| dg} t| d| d| d d| g| dg}t| d| d| d d| g| dg}|d kr| | }}nE|d kr| | }}n)|d kr||}}n ||}}|jdt }|j |||||||j ||||||dS(Ng@g?iRrig@iiiiRvRuRsRW(R+R|RR R{R}RR tunit_regular_polygonR~RRtsqrtR(RRR?RRRRRRtpolypathtvertsRRvRuRsRtRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRWs6    (/22     cC sK|j|j|jdkd|j|j}tj|}|j}|j}tjddd} |dkr|j || ||||n| j } tt j | ddddf| d d ddf| df} tt j | d d ddf| d f} tt j | dd ddf| df} tt j | d| dd ddf| df}|dkr| | }}nE|dkr| | }}n)|dkr| |}}n || }}|jdt }|j |||||||j ||||||dS(Ng@g?it innerCirclegŋ!r?Rriiii iiiRvRuRsRW(R+R|RR R{R}RR tunit_regular_starR~RRtvstackR(RRR?RRRRRRRRRvRuRsRtRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRYs4    N55<     cC s%|j|j|jdkd|j|j}tj|}|j}|j}tjd} |dkr|j || ||||n| j } t t j dt jd} tt j| dg| dddf| dgf} tt j| dg| d dddf| dgf} t| dddf}t| dddf}|d kr| | }}nE|d kr| | }}n)|dkr||}}n ||}}|jdt}|j |||||||j ||||||dS(Ng@g?iRrig@iiiiiRvRuRsRW(iii(iiii(iiii(R+R|RR R{R}RR RR~RtabsRtcostpiRR(RRR?RRRRRRRRRRvRuRsRtRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR[#s6     ;A     cC s-|j|j|jdkd|j|j}tj|jd}|j}|j}tj d} |dkr|j || ||||n| j } t j ddd} } t| dddf} t| dddf}tt j| | g| dddf| | g| | gf}tt j| | g| dddf| | gf}|d kr| |}}nE|dkr|| }}n)|dkr||}}n ||}}|jdt}|j |||||||j ||||||dS(Ng@g?iiRriig@iiiiRvRuRsRWg?(iiiii(iiii(iii(iii(R+R|RR R{RR}RR RR~RRRRR(RRR?RRRRRRRRRRRvRuRsRtRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR]Js6    E<     cC sg|j|j|jdkd|j|j}tj|}|j||j|||dS(Ng?g?(R+R|RR R{R~t_line_marker_path(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRfrs cC sp|j|j|jdkd|j|j}tj|jd}|j||j|||dS(Ng?g?iZ(R+R|RR R{RR~R(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRhzs cC sg|j|j|jdk|j|j}tj| d}|j||j|||dS(Ng?(R+R|RR R{R~t_tickhoriz_path(RRR?RRRtmarker_transform((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRjs cC sf|j|j|jdk|j|j}tj|d}|j||j|||dS(Ng?(R+R|RR R{R~R(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRks gcC sf|j|j|jdk|j|j}tjd|}|j||j|||dS(Ng?(R+R|RR R{R~t_tickvert_path(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRls cC sg|j|j|jdk|j|j}tjd| }|j||j|||dS(Ng?(R+R|RR R{R~R(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRms cC sg|j|j|jdkd|j|j}tj|}|j||j|||dS(Ng@g?(R+R|RR R{R~t _plus_path(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR_s g?g?gcC sg|j|j|jdkd|j|j}tj|}|j||j|||dS(Ng@g?(R+R|RR R{R~t _tri_path(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRMs cC sp|j|j|jdkd|j|j}tj|jd}|j||j|||dS(Ng@g?i(R+R|RR R{RR~R(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyROs cC sp|j|j|jdkd|j|j}tj|jd}|j||j|||dS(Ng@g?iZ(R+R|RR R{RR~R(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRQs cC sp|j|j|jdkd|j|j}tj|jd}|j||j|||dS(Ng@g?i(R+R|RR R{RR~R(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRSs g?cC sg|j|j|jdkd|j|j}tj|}|j||j|||dS(Ng@g?(R+R|RR R{R~t _caret_path(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRqs cC sp|j|j|jdkd|j|j}tj|jd}|j||j|||dS(Ng@g?i(R+R|RR R{RR~R(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRps cC sp|j|j|jdkd|j|j}tj|jd}|j||j|||dS(Ng@g?i(R+R|RR R{RR~R(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRns cC sp|j|j|jdkd|j|j}tj|jd}|j||j|||dS(Ng@g?iZ(R+R|RR R{RR~R(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRos cC sg|j|j|jdkd|j|j}tj|}|j||j|||dS(Ng@g?(R+R|RR R{R~t_x_path(RRR?RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRas cC stj|||j|_|j|_|j|_|j|_|j|_|j|_|j|_|j |_ |j |_ |j |_ |j |_ |j |_ |j|_|j|_|j|_|j|_|j|_|j|_dS(s"copy properties from other to selfN(Rt update_fromRR!RRRURTRQR5RRR%R&R'R(RR6R2(Rtother((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs&                 cC sL|jd|}t|r9|jdkr9d}ntj|}|S(NRWR(RYRRVR6R tto_rgb(RRWt facecolorR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR}s  cC s|j|dS(salias for set_antialiasedN(R(Rtval((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytset_aa$scC s|j|dS(salias for set_colorN(R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytset_c(scC s|j|dS(salias for set_linestyleN(R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytset_ls-scC s|j|dS(salias for set_linewidthN(R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytset_lw2scC s|j|dS(salias for set_markeredgecolorN(R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytset_mec7scC s|j|dS(salias for set_markeredgewidthN(R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytset_mew<scC s|j|dS(salias for set_markerfacecolorN(R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytset_mfcAscC s|j|dS(s alias for set_markerfacecoloraltN(R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt set_mfcaltEscC s|j|dS(salias for set_markersizeN(R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytset_msIscC s |jS(salias for get_antialiased(RI(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_aaMscC s |jS(salias for get_color(RJ(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_cQscC s |jS(salias for get_linestyle(RL(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_lsVscC s |jS(salias for get_linewidth(RM(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_lw[scC s |jS(salias for get_markeredgecolor(R4(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_mec`scC s |jS(salias for get_markeredgewidth(RS(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_mewescC s |jS(salias for get_markerfacecolor(RZ(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_mfcjscC s |jS(s alias for get_markerfacecoloralt(R[(RRW((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyt get_mfcaltnscC s |jS(salias for get_markersize(R\(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_msrscC sL|j}||jkr?td|fd|jfn||_dS(si Set the join style for dashed linestyles ACCEPTS: ['miter' | 'round' | 'bevel'] s set_dash_joinstyle passed "%s"; svalid joinstyles are %sN(RVt validJoinRR&(RRV((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRvs   cC sL|j}||jkr?td|fd|jfn||_dS(sh Set the join style for solid linestyles ACCEPTS: ['miter' | 'round' | 'bevel'] s!set_solid_joinstyle passed "%s"; svalid joinstyles are %sN(RVRRR((RRV((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs   cC s|jS(s: Get the join style for dashed linestyles (R&(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_dash_joinstylescC s|jS(s9 Get the join style for solid linestyles (R((R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_solid_joinstylescC sL|j}||jkr?td|fd|jfn||_dS(sm Set the cap style for dashed linestyles ACCEPTS: ['butt' | 'round' | 'projecting'] sset_dash_capstyle passed "%s"; svalid capstyles are %sN(RVtvalidCapRR%(RRV((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs   cC sL|j}||jkr?td|fd|jfn||_dS(sm Set the cap style for solid linestyles ACCEPTS: ['butt' | 'round' | 'projecting'] s set_solid_capstyle passed "%s"; svalid capstyles are %sN(RVRRR'(RRV((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs   cC s|jS(s9 Get the cap style for dashed linestyles (R%(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_dash_capstylescC s|jS(s8 Get the cap style for solid linestyles (R'(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytget_solid_capstylescC s |jdkS(s return True if line is dashstyles--s-.R4(s--s-.R4(R(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR$s( RDRHRFRJRLRVReRcR\R^RXRZ(sfullsleftsrightsbottomstop(RwsroundRy(RzsroundR{Ng333333gɿg333333?gɿg333333gɿg333333?gɿg333333gɿ(t__name__t __module__t__doc__t lineStylesR-t _drawStyles_lt _drawStyles_sR1RtkeysRdtTICKLEFTt TICKRIGHTtTICKUPtTICKDOWNt CARETLEFTt CARETRIGHTtCARETUPt CARETDOWNtmarkersRjRRRtzorderRRRR6RRRRRRRRRRRRRRRRRRRRRHRIRJRKRLRMRNR4RSRYRZR[R\RR`R^R_RaRRRRRRRRRRRRRRRoR9RiR<R=R;R5R/R1R2R3R?R RzRRARCR tMOVETOtLINETOt CLOSEPOLYRRRRRRRGRERIRKRURbRdRWRYR[R]RRfRhRRjRkRRlRmRR_RRMRORQRSRRqRpRnRoRRaRR}RRRRRRRRRRRRRRRRRRRRRRRRRRR$(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyR.Gs      O =         5 N               0 B    !        *!*!3'*!*! 6        & % ' '              '                               tVertexSelectorcB s)eZdZdZdZdZRS(s Manage the callbacks to maintain a list of selected vertices for :class:`matplotlib.lines.Line2D`. Derived classes should override :meth:`~matplotlib.lines.VertexSelector.process_selected` to do something with the picks. Here is an example which highlights the selected verts with red circles:: import numpy as np import matplotlib.pyplot as plt import matplotlib.lines as lines class HighlightSelected(lines.VertexSelector): def __init__(self, line, fmt='ro', **kwargs): lines.VertexSelector.__init__(self, line) self.markers, = self.axes.plot([], [], fmt, **kwargs) def process_selected(self, ind, xs, ys): self.markers.set_data(xs, ys) self.canvas.draw() fig = plt.figure() ax = fig.add_subplot(111) x, y = np.random.rand(2, 30) line, = ax.plot(x, y, 'bs-', picker=5) selector = HighlightSelected(line) plt.show() cC st|dstdn|jdkr?tdn|j|_||_|jjj|_|jjd|j |_ t |_ dS(s Initialize the class with a :class:`matplotlib.lines.Line2D` instance. The line should already be added to some :class:`matplotlib.axes.Axes` instance and should have the picker property set. Rs'You must first add the line to the Axess2You must first set the picker property of the linet pick_eventN( R~Rt get_pickerR6RtlineRtcanvast mpl_connecttonpicktcidtsetR(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs  cC sdS(s Default "do nothing" implementation of the :meth:`process_selected` method. *ind* are the indices of the selected vertices. *xs* and *ys* are the coordinates of the selected vertices. N((RRtxstys((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pytprocess_selectedscC s|j|jk rdSxC|jD]8}||jkrH|jj|q |jj|q Wt|j}|j|jj\}}|j|||||dS(s=When the line is picked, update the set of selected indicies.N( tartistRRtremovetaddtlisttsortR`R(RteventtiRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs (RRRRRR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyRs  (8Rt __future__RtnumpyRRt matplotlibRRRtcbookRRRRRR R tcolorsR RR t transformsR RRRRRRtmatplotlib.font_managerRtrangeRRRRRRRRR-R.RR-RRjt lineMarkersR1RtinterpdRtkwdoctdedent_interpdRtim_func(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/lines.pyts<  4"$ )O