/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/finance.pyo (18359B)
Ñò „ñ™Jc@s;dZddkZddkZddkZddklZyddklZWn#ej oddklZnXyddk Z Wnej oedƒ‚nXddk Z ddk l Z lZddklZddklZdd klZlZdd klZdd klZlZlZdd klZdd klZeƒZ ei!i"e dƒZ#e$e%d„Z&dd„Z(e$e%dd„Z)dddd„Z*ddddd„Z+dddd„Z,ddddd„Z-ddddd„Z.ddddd„Z/ddddd„Z0d d!ddd"„Z1dS(#so A collection of modules for collecting, analyzing and plotting financial data. User contributions welcome! iÿÿÿÿN(turlopen(tmd5s8The finance module requires datetime support (python2.3)(tverboset get_configdir(tdate2num(tBunch(tLineCollectiontPolyCollection(tcolorConverter(tLine2DtTICKLEFTt TICKRIGHT(t Rectangle(tAffine2Ds finance.cachecCsg}|iƒ}d}xx|dD]l}|idƒ}t|ƒdjoq#n|d}|djoIy)d}titi||ƒd Œ} Wq²tj o d}q²Xntiti||ƒd Œ} t | ƒ} g} |dd!D]} | t | ƒqï~ \} }}}t |dƒ}|oBt |d ƒ}||}| |9} ||9}||9}|}n|i | | ||||fƒq#W|i ƒ|ont|ƒdjodSttit|Œƒ\}} }}}}td |d | d |d |d|d|ƒS|SdS(s  Parse the historical data in file handle fh from yahoo finance and return results as a list of d, open, close, high, low, volume where d is a floating poing representation of date, as returned by date2num if adjust=True, use adjusted prices it,iis%Y-%m-%dis%d-%b-%yiitdatetopentclosethightlowtvolumeN(t readlinestNonetsplittlentdatetimeRttimetstrptimet ValueErrorRtfloattinttappendtreversetmaptnptasarraytzipR(tfhtasobjecttadjustedtresultstlinestdatefmttlinetvalstdatestrtdttdt_[1]tvalRRRRRtaclosetmR((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pytparse_yahoo_historical$sD     # :     # *,c Css|iƒ}|id|i|if}|id|i|if}d}||d|d|d|d|d|d|f}|d jo%tiitt |ƒi ƒƒ}ntii |ƒo't |ƒ}t id||fƒnƒtiitƒptitƒnt|ƒ} t |dƒ}|i| iƒƒ|iƒt id||fƒt |dƒ}|S( se Fetch historical data for ticker between date1 and date2. date1 and date2 are datetime instances Ex: fh = fetch_historical_yahoo('^GSPC', d1, d2) cachename is the name of the local file cache. If None, will default to the md5 hash or the url (which incorporates the ticker and date range) a file handle is returned is_http://table.finance.yahoo.com/table.csv?a=%d&b=%d&c=%d&d=%d&e=%d&f=%d&s=%s&y=0&g=d&ignore=.csviisUsing cachefile %s for %stwsSaved %s data to cache file %strN(tuppertmonthtdaytyearRtostpathtjointcachedirRt hexdigesttexiststfileRtreporttisdirtmkdirRtwritetreadR( ttickertdate1tdate2t cachenametd1td2turlFmtturlR%turlfh((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pytfetch_historical_yahooXs(  %   c Csht||||ƒ}yt|||ƒ}Wn6tj o*}tidtd|idƒdSX|S(sŒ Get historical data for ticker between date1 and date2. date1 and date2 are datetime instances results are a list of tuples (d, open, close, high, low, volume) where d is a floating poing representation of date, as returned by date2num if asobject is True, the return val is an object with attrs date, open, close, high, low, volume, which are equal length arrays if adjust=True, use adjusted prices Ex: sp = f.quotes_historical_yahoo('^GSPC', d1, d2, asobject=True, adjusted=True) returns = (sp.open[1:] - sp.open[:-1])/sp.open[1:] [n,bins,patches] = hist(returns, 100) mu = mean(returns) sigma = std(returns) x = normpdf(bins, mu, sigma) plot(bins, x, color='red', lw=2) cachename is the name of the local file cache. If None, will default to the md5 hash or the url (which incorporates the ticker and date range) surlopen() failure s iN(RPR4tIOErrortwarningstwarnRNtstrerrorR( RGRHRIR&R'RJR%trettexc((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pytquotes_historical_yahoo‡s itkR6cCs7g}x |D]}|d \}}} } } | |jo |} n|} td||fd| | fd| dtƒ} td||fd||fd| dtdtd|ƒ}td||fd| | fd| dtd|dtƒ}|i| ||fƒ|i| ƒ|i|ƒ|i|ƒq W|iƒ|S(s% quotes is a list of (time, open, close, high, low, ...) tuples Represent the time, open, close, high, low as a vertical line ranging from low to high. The left tick is the open and the right tick is the close. time must be in float date format - see date2num ax : an Axes instance to plot to ticksize : open/close tick marker in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open return value is a list of lines added itxdatatydatatcolort antialiasedtmarkert markersize(R tFalseR R textendtadd_linetautoscale_view(taxtquotestticksizetcolorupt colordownR)tqttRRRRR[tvlinetolinetcline((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pytplot_day_summary®s:       gš™™™™™É?gð?c Cs6|d}g}g}x |D]} | d \} } } } }| | jo|}| }| | }n|}| }| | }td| | fd|| fddddd tƒ}td | ||fd |d |d |d|ƒ}|i|ƒ|i|ƒ|i|ƒ|i|ƒ|i|ƒqW|iƒ||fS(s‰ quotes is a list of (time, open, close, high, low, ...) tuples. As long as the first 5 elements of the tuples are these values, the tuple can be as long as you want (eg it may store volume). time must be in float days format - see date2num Plot the time, open, close, high, low as a vertical line ranging from low to high. Use a rectangular bar to represent the open-close span. If close >= open, use colorup to color the bar, otherwise use colordown ax : an Axes instance to plot to width : fraction of a day for the rectangle width colorup : the color of the rectangle where close >= open colordown : the color of the rectangle where close < open alpha : the rectangle alpha level return value is lines, patches where lines is a list of lines added and patches is a list of the rectangle patches added g@iRYRZR[RXt linewidthgà?R\txytwidththeightt facecolort edgecolor(R tTrueR t set_alphaRRat add_patchRb(RcRdRpRfRgtalphatOFFSETR)tpatchesRhRiRRRRR[tlowerRqRjtrect((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pyt candlestickìs>          ic)Cs£g}ttt|ƒƒ||ƒD]9\} } } | djo|| | f| | ffq#q#~} | dfd fg} d |dffg}g}ttt|ƒƒ|ƒD]*\} }|djo|| |fq°q°~}g}ttt|ƒƒ|ƒD]*\} }|djo|| |fqq~}|iidd}tƒi|dƒ}ti|ƒ\}}}|||df}ti|ƒ\}}}|||df}h|t 6|t 6}g}t||ƒD];\}}|djo"|djo||||jqÛqÛ~}d}d}t | d|d|d |ƒ}t | d|d |d|d |d |i ƒ} | i |ƒt |d|d |d|d |d |i ƒ}!|!i |ƒdt| ƒ}"}#tg}$|D]} | djo |$| qÞqÞ~$ƒ}%tg}&|D]} | djo |&| qq~&ƒ}'|"|%f|#|'ff}(|i|(ƒ|iƒ|i|ƒ|i| ƒ|i|!ƒ|| |!fS(s³ Represent the time, open, close, high, low as a vertical line ranging from low to high. The left tick is the open and the right tick is the close. ax : an Axes instance to plot to ticksize : size of open and close ticks in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open return value is a list of lines added iÿÿÿÿigð?gR@gitcolorst linewidthst antialiasedstoffsetst transOffset(ii(ii(i(i(R$txrangeRtfiguretdpiR tscaleRtto_rgbRtR_Rt transDatat set_transformtmintmaxtupdate_datalimRbtadd_collection()RctopenstclosesthighstlowsReRfRgR0tiRRt rangeSegmentst openSegmentst closeSegmentst_[2]Rt offsetsOpent_[3]Rt offsetsCloseR…t tickTransformR6tgtbtcolordt_[4]R}tuseAAtlwtrangeCollectiontopenCollectiontcloseCollectiontminpytmaxxt_[5]tminyt_[6]tmaxytcorners((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pytplot_day_summary22sXeSS  X        88     gè?c $Csç|d} g} ttt|ƒƒ||ƒD]h\} } } | djoL| djo?| | | | f| | | f| | | f| | | ffq-q-~ }g}ttt|ƒƒ||ƒD]9\} }}|djo|| |f| |ffqÁqÁ~}ti|ƒ\}}}||||f}ti|ƒ\}}}||||f}h|t6|t6}g}t||ƒD];\} } | djo"| djo||| | jqq~}d }d }t|ddd|d|ƒ}t|d |d dd|d|ƒ}dt|ƒ}}t g}|D]}|djo ||q2q2~ƒ} t g}!|D]}|djo |!|qjqj~!ƒ}"|| f||"ff}#|i |#ƒ|i ƒ|i |ƒ|i |ƒ||fS(s‡ Represent the open, close as a bar line and high low range as a vertical line. ax : an Axes instance to plot to width : the bar width in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open alpha : bar transparency return value is lineCollection, barCollection g@iÿÿÿÿigà?R}iR~Rt facecolorst edgecolors(i(gà?(iiii((iiii(iiii((iiii(R$R‚RRR†RtR_RRR‰RŠR‹RbRŒ($RcRRŽRRRpRfRgRwtdeltaR0R‘RRtbarVertsR•RRR’R6RšR›RœR—R}RžRŸR t barCollectiontminxR¤RR¦R¥R¨R©((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pyt candlestick2s< ”e  X    88    cCs™ti|ƒ\}} } || | |f}ti|ƒ\}} } || | |f}h|t6|t6} g} t||ƒD];\} }| djo"|djo| | | |jq|q|~ }|d}g}t|ƒD]X\}}|djo?|||df|||f|||f||dffqÛqÛ~}t|d|dd dd dd ƒ}dt|ƒt|ƒff}|i |ƒ|i ƒ|S(s½ Add a volume overlay to the current axes. The opens and closes are used to determine the color of the bar. -1 is missing. If a value is missing on one it must be missing on all ax : an Axes instance to plot to width : the bar width in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open alpha : bar transparency iÿÿÿÿg@iR«R¬iRR~gà?(iiii((iiii(i(gà?(ii( RR†RtR_R$t enumerateRRRŠR‹Rb(RcRRŽtvolumesRfRgRpRwR6RšR›RœR0RRR}R­R•R‘tvtbarsR¯R©((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pytvolume_overlayÕs$  X r    c Cs+t||d |d|d||||ƒS(s  Add a volume overlay to the current axes. The closes are used to determine the color of the bar. -1 is missing. If a value is missing on one it must be missing on all ax : an Axes instance to plot to width : the bar width in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open alpha : bar transparency nb: first point is not displayed - it is used only for choosing the right color iÿÿÿÿi(R¶(RcRŽR³RfRgRpRw((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pytvolume_overlay2sc-Csñti|ƒ\}}}||||f}ti|ƒ\}}}||||f}h|t6|t6} t|Œ\} } } } }}g}t| d | dƒD];\}}|djo"|djo|| ||jq¢q¢~}|id| | d| djƒ|d}| d}g}|D]C\}}}}}}||df||f||f|dffq(~}|iidd}|ii |i i }t ƒi ||ƒ} g}!|D]\}}}}}}|!|q¾~!} g}"| D]}|"|dfqñ~"}#d}$d}%t |d|d dd |$d |%d |#d |iƒ}&|&i| ƒt| ƒt| ƒ}'}(d})tg}*|D]\}}}}}}|*|q†~*ƒ}+|'|)f|(|+ff},|i|,ƒ|i|&ƒ|iƒ|&S(s‡ Add a volume overlay to the current axes. quotes is a list of (d, open, close, high, low, volume) and close-open is used to determine the color of the bar kwarg width : the bar width in points colorup : the color of the lines where close1 >= close0 colordown : the color of the lines where close1 < close0 alpha : bar transparency iÿÿÿÿiig@gð?gR@gà?R«R¬RR~R€R(i(gà?(iiii((iiii(RR†RtR_R$tinsertRƒR„tbboxRqtviewLimR R…RR‡RˆR‰RŠR‹RŒRb(-RcRdRfRgRpRwR6RšR›RœtdatesRRŽRRR³R0tclose0tclose1R}trighttleftR•R/RRRRRRµtsxtsyt barTransformR—Rt offsetsBarsRžRŸR¯R£R¤R¦R¥R¨R©((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pytvolume_overlay3sF  `"  W3'   9   R›tlcCséti||ƒf}ti||ƒf}|d}| d} g} |D]B} | djo/| | df| | f|| f|dffqJqJ~ } |iidd} |ii|ii}tƒi| |ƒ}g}t |ƒD]*\}} | djo||dfqåqå~}t | d|d|dd d dd |d |i ƒ}|i |ƒdt |ƒ}}d}tg}|D]} | djo || qq~ƒ}||f||ff}|i|ƒ|iƒ|i|ƒ|S(sÄ Add a bar collection graph with height vals (-1 is missing). ax : an Axes instance to plot to width : the bar width in points alpha : bar transparency g@iÿÿÿÿigð?gR@R«R¬RR~gà?R€R(i(gà?(Rtto_rgbaRƒR„R¹RqRºR R…R²RR‡RˆRRŠR‹RbRŒ(RcR,RrRsRpRwR«R¬R¾R¿R0R´RµRÀRÁRÂR•R‘RÃR¯R£R¤R¦R—R¨R©((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pyt index_bar`s2   VD   8   (2t__doc__R;RRRturllib2RthashlibRt ImportErrorRtnumpyR"t matplotlibRRR»Rtmatplotlib.cbookRtmatplotlib.collectionsRRtmatplotlib.colorsRR)R R R RyR tmatplotlib.transformsR t configdirR<R=R>R_RtR4RRPRWRmR|RªR±R¶R·RÄRÇ(((s8/usr/lib64/python2.6/site-packages/matplotlib/finance.pytsR$  4 /'=  E\ E+H