/opt/alt/python27/lib64/python2.7/site-packages/matplotlib
NameSizeModeActions
backends/-0755rm
delaunay/-0755rm
mpl-data/-0755rm
numerix/-0755rm
projections/-0755rm
sphinxext/-0755rm
afm.py150890644editdlrm
afm.pyc173880644editdlrm
afm.pyo173880644editdlrm
artist.py356230644editdlrm
artist.pyc414310644editdlrm
artist.pyo414310644editdlrm
axes.py2800890644editdlrm
axes.pyc2525680644editdlrm
axes.pyo2514560644editdlrm
axis.py573540644editdlrm
axis.pyc608580644editdlrm
axis.pyo605510644editdlrm
backend_bases.py723180644editdlrm
backend_bases.pyc799690644editdlrm
backend_bases.pyo798790644editdlrm
bezier.py149170644editdlrm
bezier.pyc138120644editdlrm
bezier.pyo138120644editdlrm
blocking_input.py136900644editdlrm
blocking_input.pyc147620644editdlrm
blocking_input.pyo144440644editdlrm
cbook.py427560644editdlrm
cbook.pyc586920644editdlrm
cbook.pyo584660644editdlrm
cm.py80980644editdlrm
cm.pyc100320644editdlrm
cm.pyo100320644editdlrm
collections.py407840644editdlrm
collections.pyc451110644editdlrm
collections.pyo451110644editdlrm
colorbar.py274560644editdlrm
colorbar.pyc258350644editdlrm
colorbar.pyo258350644editdlrm
colors.py391100644editdlrm
colors.pyc406900644editdlrm
colors.pyo406900644editdlrm
contour.py428950644editdlrm
contour.pyc364630644editdlrm
contour.pyo363010644editdlrm
dates.py360070755editdlrm
dates.pyc411350644editdlrm
dates.pyo410710644editdlrm
dviread.py320330644editdlrm
dviread.pyc354880644editdlrm
dviread.pyo353450644editdlrm
figure.py412640644editdlrm
figure.pyc437060644editdlrm
figure.pyo435750644editdlrm
finance.py205820644editdlrm
finance.pyc186750644editdlrm
finance.pyo185150644editdlrm
fontconfig_pattern.py64290644editdlrm
fontconfig_pattern.pyc67100644editdlrm
fontconfig_pattern.pyo67100644editdlrm
font_manager.py426530644editdlrm
font_manager.pyc412750644editdlrm
font_manager.pyo412750644editdlrm
ft2font.so3061680755editdlrm
hatch.py65640644editdlrm
hatch.pyc94840644editdlrm
hatch.pyo94840644editdlrm
image.py315400644editdlrm
image.pyc337830644editdlrm
image.pyo337370644editdlrm
legend.py323020644editdlrm
legend.pyc238760644editdlrm
legend.pyo237030644editdlrm
lines.py546850644editdlrm
lines.pyc579910644editdlrm
lines.pyo578860644editdlrm
mathtext.py1020090644editdlrm
mathtext.pyc1060700644editdlrm
mathtext.pyo1056820644editdlrm
mlab.py942940644editdlrm
mlab.pyc1019150644editdlrm
mlab.pyo1017350644editdlrm
mpl.py7850644editdlrm
mpl.pyc11890644editdlrm
mpl.pyo11890644editdlrm
nxutils.so97040755editdlrm
offsetbox.py298070644editdlrm
offsetbox.pyc348250644editdlrm
offsetbox.pyo347700644editdlrm
patches.py1284850644editdlrm
patches.pyc1337360644editdlrm
patches.pyo1335980644editdlrm
path.py217650644editdlrm
path.pyc214990644editdlrm
path.pyo212790644editdlrm
pylab.py109810644editdlrm
pylab.pyc124380644editdlrm
pylab.pyo124380644editdlrm
pyparsing.py1439240644editdlrm
pyparsing.pyc1511830644editdlrm
pyparsing.pyo1511830644editdlrm
pyplot.py824680644editdlrm
pyplot.pyc819820644editdlrm
pyplot.pyo819820644editdlrm
quiver.py375400644editdlrm
quiver.pyc341520644editdlrm
quiver.pyo341520644editdlrm
rcsetup.py234340644editdlrm
rcsetup.pyc215220644editdlrm
rcsetup.pyo213520644editdlrm
scale.py142330644editdlrm
scale.pyc202540644editdlrm
scale.pyo202540644editdlrm
spines.py126840644editdlrm
spines.pyc118830644editdlrm
spines.pyo114560644editdlrm
table.py168280644editdlrm
table.pyc173730644editdlrm
table.pyo172220644editdlrm
texmanager.py224640644editdlrm
texmanager.pyc202090644editdlrm
texmanager.pyo202090644editdlrm
text.py598220644editdlrm
text.pyc606960644editdlrm
text.pyo606960644editdlrm
ticker.py404280644editdlrm
ticker.pyc521640644editdlrm
ticker.pyo520280644editdlrm
tight_bbox.py36550644editdlrm
tight_bbox.pyc41570644editdlrm
tight_bbox.pyo41570644editdlrm
transforms.py753870644editdlrm
transforms.pyc924320644editdlrm
transforms.pyo915230644editdlrm
ttconv.so654880755editdlrm
type1font.py115370644editdlrm
type1font.pyc114900644editdlrm
type1font.pyo114900644editdlrm
units.py49760644editdlrm
units.pyc59180644editdlrm
units.pyo59180644editdlrm
widgets.py408330644editdlrm
widgets.pyc436080644editdlrm
widgets.pyo434220644editdlrm
windowing.py4540644editdlrm
windowing.pyc13610644editdlrm
windowing.pyo13610644editdlrm
_cm.py3704140644editdlrm
_cm.pyc1030550644editdlrm
_cm.pyo1030550644editdlrm
_cntr.so209600755editdlrm
_delaunay.so611840755editdlrm
_image.so2828560755editdlrm
_mathtext_data.py579900644editdlrm
_mathtext_data.pyc638000644editdlrm
_mathtext_data.pyo638000644editdlrm
_path.so2803120755editdlrm
_png.so1565040755editdlrm
_pylab_helpers.py27150644editdlrm
_pylab_helpers.pyc38380644editdlrm
_pylab_helpers.pyo38380644editdlrm
__init__.py289720644editdlrm
__init__.pyc294350644editdlrm
__init__.pyo293810644editdlrm
Edit: /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyo (36301B)
Jc@ s#dZddklZddkZddkZddkZddklZddk i Z ddk i Z ddk iZddkiZddkiZddkiZddkiZddkiZddkiZddkiZddklZdfdYZdei efd YZ!dS( sQ These are classes to support contour plotting and labelling for the axes class i(tdivisionN(tma(tBlockingContourLabelertContourLabelercB seZdZdZdZdZdZdZdZdZ dZ d Z dd d Z d Zd dZdZRS(s3Mixin to provide labelling capability to ContourSetcO s|idd}|idd}|idd}|idd|_|idd}|id t|_|id t|_t|d jo"|i}t t|i}nt|djot |d } gg}}xHt |iD]7\} } | | jo|i | |i | qqWt|t| jo=d t | } | d 7} | t |i7} t| qn td||_||_ti|_|djot|ii} not|ttt gjotdnCt|t jot|ii} n|ii||} | gt||_|djo(||_ti|i|i|_nXt i!|dt|i}t t|i|_t"i#d|dt i$|_g|_%|io7dGHdGH|p dGHnt&|}|||n|i'|||i(|_)|i%|_*|i+|_,t-i.d|i(|_/|i/S(sF call signature:: clabel(cs, **kwargs) adds labels to line contours in *cs*, where *cs* is a :class:`~matplotlib.contour.ContourSet` object returned by contour. :: clabel(cs, v, **kwargs) only labels contours listed in *v*. Optional keyword arguments: *fontsize*: See http://matplotlib.sf.net/fonts.html *colors*: - if *None*, the color of each label matches the color of the corresponding contour - if one string color, e.g. *colors* = 'r' or *colors* = 'red', all labels will be plotted in this color - if a tuple of matplotlib color args (string, float, rgb, etc), different labels will be plotted in different colors in the order specified *inline*: controls whether the underlying contour is removed or not. Default is *True*. *inline_spacing*: space in pixels to leave on each side of label when placing inline. Defaults to 5. This spacing will be exact for labels at locations where the contour is straight, less so for labels on curved contours. *fmt*: a format string for the label. Default is '%1.3f' Alternatively, this can be a dictionary matching contour levels with arbitrary strings to use for each contour level (i.e., fmt[level]=string) *manual*: if *True*, contour labels will be placed manually using mouse clicks. Click the first button near a contour to add a label, click the second button (or potentially both mouse buttons at once) to finish adding labels. The third button can be used to remove the last label added, but only if labels are not inline. Alternatively, the keyboard can be used to select label locations (enter to end label placement, delete or backspace act like the third mouse button, and any other key will select a label location). *rightside_up*: if *True* (default), label rotations will always be plus or minus 90 degrees from level. .. plot:: mpl_examples/pylab_examples/contour_demo.py tfontsizetinlineitinline_spacingitfmts%1.3ftcolorstmanualt rightside_upisSpecified levels s don't match available levels s-Illegal arguments to clabel, see help(clabel)s$Font size must be an integer number.tNtcmaptnorms9Select label locations manually using first mouse button.s.End manual selection with second mouse button.s1Remove last label by clicking third mouse button.s text.TextN(0tgettNonetlabelFmttFalset labelManualtTrueR tlentlevelstrangetlistt enumeratetappendtstrt ValueErrort TypeErrortlabelLevelListtlabelIndiceListt font_managertFontPropertiestlabelFontPropstinttget_size_in_pointsttypetfloattset_sizetlabelFontSizeListt labelMappabletnpttaketcvaluestlabelCValueListRtListedColormaptcmtScalarMappabletNoNormtlabelXYsRtlabelst labelTextstcltcl_xyt labelCValuest cl_cvaluestcbookt silent_listtlabelTextsList(tselftargstkwargsRRRt_colorsRtindicestlevlabstitlevtmsgt font_sizeR tblocking_contour_labeler((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytclabel#srO                   c C st|}|d|jodSti|dddf}ti|dddf}ti|dddf}ti|dddf}|}||d|jp||d|jodSdSdS(s-if contours are too short, don't plot a labeli iNig333333?(RR)tamaxtamin( R;t linecontourt labelwidthtlcsizetxmaxtxmintymaxtymintlw((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt print_labels *cC s|igjoxg}|iD]2}|ti||dd||ddq~}x0|D] }|d|jodSdSq`WndSdS(s6if there's a label already nearby, find a better placeiiig333333?N(R1R)tsqrt(R;txtyRPt_[1]tloctdisttd((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt too_closesB c C st|d}ti|}xU|D]M}||||||} } |i| | |oq&q&| | |fSq&W|d}||||||} } | | |fS(sB labels are ploted at a location with the smallest dispersion of the contour from a straight line unless there's another label nearby, in which case the second best place on the contour is picked up if there's no good place a label isplotted at the beginning of the contour ii(R"R)targsortRY( R;t distancestXXtYYtysizeRPthysizetadisttindRSRT((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytget_label_coordss  cC sDti|ot||}nt|i|||}|S(s$get the width of the label in points(R8tis_string_likeRtget_text(R;RBRtfsizeRP((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytget_label_widthscC stiti|iiidddd}ti|d|d}|i||i ||d|i d|ii i i }ti|iddddfd}|S(s This computes actual onscreen label width. This uses some black magic to determine onscreen extent of non-drawn label. This magic may not be very robust. itaxisiitktrendererN(R)tmeantasarraytaxRgtreshapettexttTexttset_label_propsRdtget_window_extenttfiguretcanvasRitdifftcorners(R;RBRRetxxtttbboxRP((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytget_real_label_widths 3,cC sA|i||i||i|i|i|iidS(s0set the label properties - color, fontsize, textN(tset_textt set_colortset_fontpropertiesR!t set_clip_boxRlRx(R;tlabelRntcolor((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyRps  cC s:ti|o|St|to ||S||SdS(sget the text of the labelN(R8Rct isinstancetdict(R;RBR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyRds  cC s1t|}|djotti||}nd}|djo |}n|}ti|dddf||f}ti|dddf||f}|dddfi|d}|dddfi|d} |dddfi|d} |dddfi|d} ||| | | || |} ti| | d| |di} tii g}t |D]}|t | || |q~d}|i |||||\}}}g}|D]}|t |q~}|i||f}|||fS(sfind a good place to plot a label (relatively flat part of the contour) and the angle of rotation for the text object iNiii(RR"R)tceiltresizeRmRRtraveltaddtreduceRtabsRbttupletindex(R;RIRJtnsizetxsizeR^R\R]tyfirsttylasttxfirsttxlasttstLRURARWRSRTRat_[2]tltlctdind((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt locate_label(s(    ((""""")H$'ic C s|d jo g}n|d}ti|}|o_ti||d!||d f}t|o&ti||d!||d f}nd}nti|}|||}ti| |g} |oti|ddg} nti| } ti ||| | dt } ti | ddi } ti | djo d} n&ti| d| ddti} |io:| d jo| d} n| d jod| } qng}t|o| | ti| |g} ti |tit|| dt}ti|d o;t|d|djo ti ||| dg}nti|d o;t|d|djo ti ||| dg}nti|dti|dg}|oRti ti|o4|iti|||d|dd!|fqqti|dp*|iti||dd |fnti|dp&|iti|||dfqn| |fS( s This function calculates the appropriate label rotation given the linecontour coordinates in screen units, the index of the label location and the label width. It will also break contour and calculate inlining if *lc* is not empty (lc defaults to the empty list if None). *spacing* is the space around the label in pixels to leave empty. Do both of these tasks at once to avoid calling mlab.path_length multiple times, which is relatively costly. The method used here involves calculating the path length along the contour in pixel coordinates and then looking approximately label width / 2 away from central point to determine rotation and then to break contour if desired. g@iiitextrapRgggf@iZiN(Rtmlabtis_closed_polygonR)tr_Rt path_lengthtarrayt zeros_liket less_simple_linear_interpolationRRtRtalltarctan2tpiR tarangeRtisnanR"tfloorRR(R;tslcRaRPRtspacingthlwtclosedtpltxitdptlltddtrotationtnlctItxy1txy2((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytcalc_label_rot_and_inlineMs\  " &   %    $00&8**c C s|iiii||f\}}ti||d|dddd}|ii|d|i} |i ||i } |i || | |i i ||ii ||ii ||f|ii|dS(NRthorizontalalignmenttcentertverticalalignmenttalpha(Rlt transDatatinvertedttransform_pointRnRoR(tto_rgbaRRdRRpR3RR6R1t add_artist( R;RSRTRRBtcvaluetdxtdyRwRt_text((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt add_labels' icC s0|ii||ii|}|idS(s>Defaults to removing last label, but any index can be suppliedN(R6tpopR3tremove(R;RRw((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt pop_labelscC s|ii}xt|i|i|i|iD]\}}}}|i|}|i||i |} g} |i } xNt | D]@\} } | i }|i |}ti|o-ti||ddddff}n|}|i|| o|i|| \}}}|o |}nd}|i||| ||\}}|i||||||oBx?|D]3}t|djo| iti|qxqxWqq| i| qW|o| 2| i| q.q.WdS(Nii(RlRtzipRRR'R,t collectionsRfRt get_pathsRtverticest transformRRR)RRQRRRRRRtpathtPathtextend(R;RRttransticonRBReRtconRPt additionstpathstsegNumtlinepathRtslc0RRSRTRatlcargRtnewtn((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR2sD      -  &N(t__name__t __module__t__doc__RFRQRYRbRfRyRpRdRRRRRR2(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR s     %j  t ContourSetcB seZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zded ZRS(s Create and store a set of contour lines or filled regions. User-callable method: clabel Useful attributes: ax: the axes object in which the contours are drawn collections: a silent_list of LineCollections or PolyCollections levels: contour levels layers: same as levels for line contours; half-way between levels for filled contours. See _process_colors method. c O sj||_|idd"|_|idt|_|idd"|_|idd"|_|idd|_|idd"|_ |idd"|_ |id d"}|id d"|_ |id d"}|id d |_ |idt |_|idd|_|idd"|_t|t ipt|itioJt |_|d"jot i}n|i d j otdqn t|_|i d"j on|i d"j on|d"j on|i d"j o|d"j otdn|i djotid|_ n|i|\}}}|i d"j o%t i|i dt|i}n|iotid|_ntid|_g|_ g|_!h|d 6} |d"j o|| d iigGz?N( RRRRRt MaxNLocatortcreate_dummy_axistzmaxtzmint set_boundsRt_autoR(R;R R R#R$RBtzmargin((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt_autolevs(         c C s|idjotdn|i\}}|idjo|idjo#titi|ti|S|i\}}}}ti |||}ti |||} ti|| Sn|idjo"d|d|f\}}}}n|i\}}}}t |||} t |||} |ti|d| }|ti|d| } |idjo| ddd} nti|| S(s Return X, Y arrays such that contour(Z) will match imshow(Z) if origin is not None. The center of pixel Z[i,j] depends on origin: if origin is None, x = j, y = i; if origin is 'lower', x = j + 0.5, y = i + 0.5; if origin is 'upper', x = j + 0.5, y = Nrows - i - 0.5 If extent is not None, x and y will be scaled to match, as in imshow. If origin is None and extent is not None, then extent will give the minimum and maximum values of x and y. isInput must be a 2D array.ig?tupperNi( tndimRtshapeRRRR)tmeshgridRtlinspaceR%( R;R tNytNxRRRRRSRTRR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt_initialize_x_ys( #"c C sv|ii|d}|ii|d}ti|dti}ti|dti}ti|ddti}|idjotdn|i \}}|i |i jo!|i |i jo|||fS|idjp|idjotdn|i \}|i \}||jp ||jotddnti ||\}}|||fS( s  For functions like contour, check that the dimensions of the input arrays match; if x and y are 1D, convert them to 2D using meshgrid. Possible change: I think we should make and use an ArgumentError Exception class (here and elsewhere). iitdtypeisInput z must be a 2D array.s Inputs x and y must be 1D or 2D.s,Length of x must be number of columns in z, s'and length of y must be number of rows.( Rltconvert_xunitstconvert_yunitsR)Rktfloat64RR*RR+R,( R;R<RSRTR R.R/tnxtny((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt _check_xyzs& &   c G s|io d}nd}t|}|djo5ti|ddti}|i|\}}nD|djo |i|d \}}}ntd||fti |d t }ti ||_ ti ||_|ioH|idjo8ti|dj|}tid |i|_nt |_|idjo|d jp |djo|i|d }ns|d }yHt|tjo|i||}nti|iti}Wntd||fnX|io#t|djotdn||_nt|i|_|idjo.|iidt|id|id n|idjo+|ii t!|id |i d nti|i|_ti"|i|_#ti$|i|_%|idjo#d|id|id |_#n|idjo#d|id |id|_%n|i|_&|iod|id |id |_&|idjo#d|i#|id |i&d|i}t|i}|djogdg|}|ioLtid}x<t|iD]'\}}|djo|||s&