/usr/lib64/python2.6/site-packages/matplotlib
NameSizeModeActions
backends/-0755rm
delaunay/-0755rm
mpl-data/-0755rm
numerix/-0755rm
projections/-0755rm
sphinxext/-0755rm
afm.py150890644editdlrm
afm.pyc169590644editdlrm
afm.pyo169590644editdlrm
artist.py356230644editdlrm
artist.pyc403260644editdlrm
artist.pyo403260644editdlrm
axes.py2800890644editdlrm
axes.pyc2493960644editdlrm
axes.pyo2482840644editdlrm
axis.py573540644editdlrm
axis.pyc589730644editdlrm
axis.pyo586660644editdlrm
backend_bases.py723180644editdlrm
backend_bases.pyc779670644editdlrm
backend_bases.pyo778770644editdlrm
bezier.py149170644editdlrm
bezier.pyc135260644editdlrm
bezier.pyo135260644editdlrm
blocking_input.py136900644editdlrm
blocking_input.pyc143460644editdlrm
blocking_input.pyo140280644editdlrm
cbook.py427560644editdlrm
cbook.pyc567550644editdlrm
cbook.pyo565290644editdlrm
cm.py80980644editdlrm
cm.pyc97720644editdlrm
cm.pyo97720644editdlrm
collections.py407840644editdlrm
collections.pyc440060644editdlrm
collections.pyo440060644editdlrm
colorbar.py274560644editdlrm
colorbar.pyc254970644editdlrm
colorbar.pyo254970644editdlrm
colors.py391100644editdlrm
colors.pyc400790644editdlrm
colors.pyo400790644editdlrm
contour.py428950644editdlrm
contour.pyc360990644editdlrm
contour.pyo359370644editdlrm
dates.py360070755editdlrm
dates.pyc400170644editdlrm
dates.pyo399530644editdlrm
dviread.py320330644editdlrm
dviread.pyc346820644editdlrm
dviread.pyo345390644editdlrm
figure.py412640644editdlrm
figure.pyc429390644editdlrm
figure.pyo428080644editdlrm
finance.py205820644editdlrm
finance.pyc185190644editdlrm
finance.pyo183590644editdlrm
fontconfig_pattern.py64290644editdlrm
fontconfig_pattern.pyc65190644editdlrm
fontconfig_pattern.pyo65190644editdlrm
font_manager.py426530644editdlrm
font_manager.pyc404560644editdlrm
font_manager.pyo404560644editdlrm
ft2font.so3061680775editdlrm
hatch.py65640644editdlrm
hatch.pyc91200644editdlrm
hatch.pyo91200644editdlrm
image.py315400644editdlrm
image.pyc330420644editdlrm
image.pyo329960644editdlrm
legend.py323020644editdlrm
legend.pyc235510644editdlrm
legend.pyo233780644editdlrm
lines.py546850644editdlrm
lines.pyc564310644editdlrm
lines.pyo563260644editdlrm
mathtext.py1020090644editdlrm
mathtext.pyc1030670644editdlrm
mathtext.pyo1026790644editdlrm
mlab.py942940644editdlrm
mlab.pyc1000040644editdlrm
mlab.pyo998240644editdlrm
mpl.py7850644editdlrm
mpl.pyc11760644editdlrm
mpl.pyo11760644editdlrm
nxutils.so95120775editdlrm
offsetbox.py298070644editdlrm
offsetbox.pyc338890644editdlrm
offsetbox.pyo338340644editdlrm
patches.py1284850644editdlrm
patches.pyc1301480644editdlrm
patches.pyo1300100644editdlrm
path.py217650644editdlrm
path.pyc211740644editdlrm
path.pyo209540644editdlrm
pylab.py109810644editdlrm
pylab.pyc123990644editdlrm
pylab.pyo123990644editdlrm
pyparsing.py1439240644editdlrm
pyparsing.pyc1467370644editdlrm
pyparsing.pyo1467370644editdlrm
pyplot.py824680644editdlrm
pyplot.pyc802790644editdlrm
pyplot.pyo802790644editdlrm
quiver.py375400644editdlrm
quiver.pyc337880644editdlrm
quiver.pyo337880644editdlrm
rcsetup.py234340644editdlrm
rcsetup.pyc211190644editdlrm
rcsetup.pyo209490644editdlrm
scale.py142330644editdlrm
scale.pyc194740644editdlrm
scale.pyo194740644editdlrm
spines.py126840644editdlrm
spines.pyc116360644editdlrm
spines.pyo112090644editdlrm
table.py168280644editdlrm
table.pyc169310644editdlrm
table.pyo167800644editdlrm
texmanager.py224640644editdlrm
texmanager.pyc199620644editdlrm
texmanager.pyo199620644editdlrm
text.py598220644editdlrm
text.pyc592400644editdlrm
text.pyo592400644editdlrm
ticker.py404280644editdlrm
ticker.pyc504610644editdlrm
ticker.pyo503250644editdlrm
tight_bbox.py36550644editdlrm
tight_bbox.pyc40660644editdlrm
tight_bbox.pyo40660644editdlrm
transforms.py753870644editdlrm
transforms.pyc896110644editdlrm
transforms.pyo887020644editdlrm
ttconv.so653600775editdlrm
type1font.py115370644editdlrm
type1font.pyc112560644editdlrm
type1font.pyo112560644editdlrm
units.py49760644editdlrm
units.pyc57750644editdlrm
units.pyo57750644editdlrm
widgets.py408330644editdlrm
widgets.pyc425680644editdlrm
widgets.pyo423820644editdlrm
windowing.py4540644editdlrm
windowing.pyc12830644editdlrm
windowing.pyo12830644editdlrm
_cm.py3704140644editdlrm
_cm.pyc1030420644editdlrm
_cm.pyo1030420644editdlrm
_cntr.so211840775editdlrm
_delaunay.so611200775editdlrm
_image.so2822480775editdlrm
_mathtext_data.py579900644editdlrm
_mathtext_data.pyc637870644editdlrm
_mathtext_data.pyo637870644editdlrm
_path.so2799920775editdlrm
_png.so1564720775editdlrm
_pylab_helpers.py27150644editdlrm
_pylab_helpers.pyc37080644editdlrm
_pylab_helpers.pyo37080644editdlrm
__init__.py289720644editdlrm
__init__.pyc289800644editdlrm
__init__.pyo289260644editdlrm
Edit: /usr/lib64/python2.6/site-packages/matplotlib/contour.pyo (35937B)
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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/site-packages/matplotlib/contour.pyRps  cC s:ti|o|St|to ||S||SdS(sget the text of the labelN(R8Rct isinstancetdict(R;RBR((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/site-packages/matplotlib/contour.pyR2sD      -  &N(t__name__t __module__t__doc__RFRQRYRbRfRyRpRdRRRRRR2(((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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((s8/usr/lib64/python2.6/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&