ó ù)°Uc@sÎddlZddlZddlmZejZddlmZddlmZm Z m Z m Z ddlm Z m Z mZmZmZddlmZmZddlmZdefd „ƒYZd efd „ƒYZd „Zd „Zdefd„ƒYZdefd„ƒYZied6ed6ed6Zd„Zd„Zeej ƒidj!eƒƒd6e_ d„Z"d„Z#ej$j%ddj!geƒD]Z&e'e&ƒ^qŸƒde#ƒj(ƒƒdS(iÿÿÿÿN(tma(tdedent(t NullFormattertScalarFormattertLogFormatterMathtextt Formatter(t NullLocatort LogLocatort AutoLocatortSymmetricalLogLocatort FixedLocator(t TransformtIdentityTransform(t docstringt ScaleBasecBs)eZdZd„Zd„Zd„ZRS(s@ The base class for all scales. Scales are separable transformations, working on a single dimension. Any subclasses will want to override: - :attr:`name` - :meth:`get_transform` And optionally: - :meth:`set_default_locators_and_formatters` - :meth:`limit_range_for_scale` cCs t‚dS(sq Return the :class:`~matplotlib.transforms.Transform` object associated with this scale. N(tNotImplementedError(tself((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyt get_transformscCs t‚dS(s¦ Set the :class:`~matplotlib.ticker.Locator` and :class:`~matplotlib.ticker.Formatter` objects on the given axis to match this scale. N(R(Rtaxis((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyt#set_default_locators_and_formatters"scCs ||fS(sù Returns the range *vmin*, *vmax*, possibly limited to the domain supported by this scale. *minpos* should be the minimum positive value in the data. This is used by log scales to determine a minimum value. ((Rtvmintvmaxtminpos((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pytlimit_range_for_scale*s(t__name__t __module__t__doc__RRR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR s  t LinearScalecBs/eZdZdZd„Zd„Zd„ZRS(s# The default linear scale. tlinearcKsdS(N((RRtkwargs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyt__init__;scCsD|jtƒƒ|jtƒƒ|jtƒƒ|jtƒƒdS(sd Set the locators and formatters to reasonable defaults for linear scaling. N(tset_major_locatorRtset_major_formatterRtset_minor_locatorRtset_minor_formatterR(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR>scCstƒS(sy The transform for linear scaling is just the :class:`~matplotlib.transforms.IdentityTransform`. (R (R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRHs(RRRtnameRRR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR4s   cCs/|dk}|jƒr+tj|d|ƒS|S(s Return a Numpy masked array where all non-positive values are masked. If there are no non-positive values, the original array is returned. gtmask(tanyRt MaskedArray(taR$((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyt_mask_non_positivesPs  cCsd||dk<|S(NgYóøÂn¥g((R'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyt_clip_non_positives[stLogScalecBsþeZdZdZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd efd „ƒYZ d efd „ƒYZ defd„ƒYZ defd„ƒYZ defd„ƒYZ d„Zd„Zd„Zd„ZRS(sÔ A standard logarithmic scale. Care is taken so non-positive values are not plotted. For computational efficiency (to push as much as possible to Numpy C code in the common cases), this scale provides different transforms depending on the base of the logarithm: - base 10 (:class:`Log10Transform`) - base 2 (:class:`Log2Transform`) - base e (:class:`NaturalLogTransform`) - arbitrary base (:class:`LogTransform`) tlogtLogTransformBasecBs#eZdZdZeZd„ZRS(icCs2tj|ƒ|dkr%t|_n t|_dS(NR$(R RR(t_handle_nonposR)(Rtnonpos((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRus   (RRt input_dimst output_dimstTruet is_separableR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR,pstLog10TransformcBs eZdZd„Zd„ZRS(g$@cCs<|j|dƒ}t|tƒr/tj|ƒStj|ƒS(Ng$@(R-t isinstanceR&Rtlog10tnp(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyt transform€s cCs tjƒS(N(R*tInvertedLog10Transform(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pytinverted†s(RRtbaseR7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR3}s R8cBs2eZdZdZeZdZd„Zd„ZRS(ig$@cCstjd|ƒdS(Ng$@(Rtpower(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR7scCs tjƒS(N(R*R3(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR9’s( RRR/R0R1R2R:R7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR8‰s  t Log2TransformcBs eZdZd„Zd„ZRS(g@cCsI|j|dƒ}t|tƒr<tj|ƒtjdƒStj|ƒS(Ng@i(R-R4R&RR+R6tlog2(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR7˜scCs tjƒS(N(R*tInvertedLog2Transform(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR9žs(RRR:R7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR<•s R>cBs2eZdZdZeZdZd„Zd„ZRS(ig@cCstjd|ƒdS(Ng@(RR;(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR7§scCs tjƒS(N(R*R<(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR9ªs( RRR/R0R1R2R:R7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR>¡s  tNaturalLogTransformcBs#eZejZd„Zd„ZRS(cCs?|j|tjƒ}t|tƒr2tj|ƒStj|ƒS(N(R-R6teR4R&RR+(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR7°s cCs tjƒS(N(R*tInvertedNaturalLogTransform(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR9¶s(RRR6R@R:R7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR?­s  RAcBs5eZdZdZeZejZd„Z d„Z RS(icCstjtj|ƒtjS(N(RR;R6R@(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR7¿scCs tjƒS(N(R*R?(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR9Âs( RRR/R0R1R2R6R@R:R7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRA¹s   t LogTransformcBs5eZdZdZeZd„Zd„Zd„ZRS(icCs;tj|ƒ||_|dkr.t|_n t|_dS(NR$(R RR:R(R-R)(RR:R.((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRÊs     cCs_|j||jƒ}t|tƒrBtj|ƒtj|jƒStj|ƒtj|jƒS(N(R-R:R4R&RR+R6(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR7ÒscCstj|jƒS(N(R*tInvertedLogTransformR:(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR9Øs( RRR/R0R1R2RR7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRBÅs   RCcBs5eZdZdZeZd„Zd„Zd„ZRS(icCstj|ƒ||_dS(N(R RR:(RR:((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRàs cCstj|j|ƒ|jS(N(RR;R:(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR7äscCstj|jƒS(N(R*RBR:(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR9çs( RRR/R0R1R2RR7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRCÛs   cKs*|jdkrH|jddƒ}|jdd ƒ}|jddƒ}n6|jddƒ}|jdd ƒ}|jd dƒ}|dkr™td ƒ‚n|dkrº|j|ƒ|_nZ|d krÛ|j|ƒ|_n9|tjkrÿ|j |ƒ|_n|j ||ƒ|_||_ ||_ d S(s) *basex*/*basey*: The base of the logarithm *nonposx*/*nonposy*: ['mask' | 'clip' ] non-positive values in *x* or *y* can be masked as invalid, or clipped to a very small positive number *subsx*/*subsy*: Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: ``[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]`` will place 10 logarithmically spaced minor ticks between each major tick. txtbasexg$@tsubsxtnonposxR$tbaseytsubsytnonposytclips/nonposx, nonposy kwarg must be 'mask' or 'clip'g@N(smaskRK( t axis_nametpoptNonet ValueErrorR3t _transformR<R6R@R?RBR:tsubs(RRRR:RQR.((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRës$    cCs\|jt|jƒƒ|jt|jƒƒ|jt|j|jƒƒ|jtƒƒdS(sb Set the locators and formatters to specialized versions for log scaling. N( RRR:R RR!RQR"R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRscCs|jS(s Return a :class:`~matplotlib.transforms.Transform` instance appropriate for the given logarithm base. (RP(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRscCs.|dkr|p||dkr'|p*|fS(s6 Limit the domain to positive values. g((RRRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR%s(RRRR#R R,R3R8R<R>R?RARBRCRRRR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR*_s         ) tSymmetricalLogScalecBs[eZdZdZdefd„ƒYZdefd„ƒYZd„Zd„Zd„Z RS( sh The symmetrical logarithmic scale is logarithmic in both the positive and negative directions from the origin. Since the values close to zero tend toward infinity, there is a need to have a range around zero that is linear. The parameter *linthresh* allows the user to specify the size of this range (-*linthresh*, *linthresh*). tsymlogtSymmetricalLogTransformcBs5eZdZdZeZd„Zd„Zd„ZRS(icCsRtj|ƒ||_||_tj|ƒ|_tj|ƒ|j||_dS(N(R RR:t linthreshR6R+t _log_baset _linadjust(RR:RU((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR>s    cCs©tj|ƒ}tj|ƒ}tj||j |jdtƒ}|tjtj|ƒƒ|j }|j j ƒr˜tjtj |j ||j |ƒƒStj|ƒSdS(Ntcopy(R6tasarraytsignRt masked_insideRUtFalseR+tabsRVR$R%twhereRW(RR'RZtmaskedR+((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR7Es"#  cCstj|j|jƒS(N(RRtInvertedSymmetricalLogTransformR:RU(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR9Qs( RRR/R0R1R2RR7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRT9s   R`cBs5eZdZdZeZd„Zd„Zd„ZRS(icCsktj|ƒ||_||_tj|ƒ|_tj|ƒ|j|_|tj|ƒ|j|_dS(N( R RR:RUR6R+RVt_log_linthreshRW(RR:RU((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRYs    cCsktj|ƒ}tj||jktj||j k||jtj|j| ƒ ƒtj|j|ƒƒS(N(R6RYR^RaRWR;R:(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR7as  cCstj|jƒS(N(RRRTR:(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR9is( RRR/R0R1R2RR7R9(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR`Ts   cKs²|jdkrH|jddƒ}|jddƒ}|jdd ƒ}n6|jddƒ}|jddƒ}|jd d ƒ}|j||ƒ|_||_||_||_d S( s" *basex*/*basey*: The base of the logarithm *linthreshx*/*linthreshy*: The range (-*x*, *x*) within which the plot is linear (to avoid having the plot go to infinity around zero). *subsx*/*subsy*: Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: ``[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]`` will place 10 logarithmically spaced minor ticks between each major tick. RDREg$@t linthreshxg@RFRHt linthreshyRIN(RLRMRNRTRPR:RURQ(RRRR:RURQ((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRls  cCsb|jt|jƒƒƒ|jt|jƒƒ|jt|jƒ|jƒƒ|jt ƒƒdS(sn Set the locators and formatters to specialized versions for symmetrical log scaling. N( RR RR RR:R!RQR"R(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRŒscCs|jS(sE Return a :class:`SymmetricalLogTransform` instance. (RP(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyR–s( RRRR#R RTR`RRR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyRR-s  RR+RScCstjƒ}|jƒ|S(N(t_scale_mappingtkeystsort(tnames((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pytget_scale_names£s  cKsQ|jƒ}|dkr!d}n|tkr@td|ƒ‚nt|||S(sC Return a scale class by name. ACCEPTS: [ %(names)s ] RsUnknown scale type '%s'N(tlowerRNRdRO(tscaleRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/scale.pyt scale_factory¨s     s | RgcCs|t|js6   "(( Îq       +