/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends
NameSizeModeActions
Matplotlib.nib/-0755rm
backend_agg.py130370644editdlrm
backend_agg.pyc149550644editdlrm
backend_agg.pyo137440644editdlrm
backend_cairo.py164930644editdlrm
backend_cairo.pyc187640644editdlrm
backend_cairo.pyo187640644editdlrm
backend_cocoaagg.py89880644editdlrm
backend_cocoaagg.pyc123330644editdlrm
backend_cocoaagg.pyo123330644editdlrm
backend_emf.py223360644editdlrm
backend_emf.pyc258570644editdlrm
backend_emf.pyo258570644editdlrm
backend_fltkagg.py208520644editdlrm
backend_fltkagg.pyc274110644editdlrm
backend_fltkagg.pyo274110644editdlrm
backend_gdk.py159680644editdlrm
backend_gdk.pyc176250644editdlrm
backend_gdk.pyo176250644editdlrm
backend_gtk.py407070644editdlrm
backend_gtk.pyc463100644editdlrm
backend_gtk.pyo463100644editdlrm
backend_gtkagg.py41340644editdlrm
backend_gtkagg.pyc52310644editdlrm
backend_gtkagg.pyo52310644editdlrm
backend_gtkcairo.py20790644editdlrm
backend_gtkcairo.pyc38830644editdlrm
backend_gtkcairo.pyo38830644editdlrm
backend_macosx.py146440644editdlrm
backend_macosx.pyc213160644editdlrm
backend_macosx.pyo212190644editdlrm
backend_mixed.py51660644editdlrm
backend_mixed.pyc49220644editdlrm
backend_mixed.pyo48510644editdlrm
backend_pdf.py777160644editdlrm
backend_pdf.pyc681600644editdlrm
backend_pdf.pyo680420644editdlrm
backend_ps.py514440644editdlrm
backend_ps.pyc488740644editdlrm
backend_ps.pyo488740644editdlrm
backend_qt.py168460644editdlrm
backend_qt.pyc217020644editdlrm
backend_qt.pyo217020644editdlrm
backend_qt4.py210060644editdlrm
backend_qt4.pyc254250644editdlrm
backend_qt4.pyo254250644editdlrm
backend_qt4agg.py47990644editdlrm
backend_qt4agg.pyc60520644editdlrm
backend_qt4agg.pyo60520644editdlrm
backend_qtagg.py49720644editdlrm
backend_qtagg.pyc61960644editdlrm
backend_qtagg.pyo61960644editdlrm
backend_svg.py259510644editdlrm
backend_svg.pyc248920644editdlrm
backend_svg.pyo247840644editdlrm
backend_template.py88060644editdlrm
backend_template.pyc96450644editdlrm
backend_template.pyo96450644editdlrm
backend_wx.py789210644editdlrm
backend_wx.pyc811000644editdlrm
backend_wx.pyo810240644editdlrm
backend_wxagg.py90990644editdlrm
backend_wxagg.pyc95970644editdlrm
backend_wxagg.pyo95970644editdlrm
_backend_agg.so4308400755editdlrm
_backend_gdk.so83920755editdlrm
_gtkagg.so1438800755editdlrm
__init__.py22250644editdlrm
__init__.pyc21720644editdlrm
__init__.pyo21720644editdlrm
Edit: /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyc (9645B)
Ñò 8”tJc @ sñdZddklZddkZddklZddklZlZl Z l Z ddk l Z ddk lZdefd „ƒYZd efd „ƒYZd „Zd „Zd„Zde fd„ƒYZde fd„ƒYZeZdS(s© This is a fully functional do nothing backend to provide a template to backend writers. It is fully functional in that you can select it as a backend with import matplotlib matplotlib.use('Template') and your matplotlib scripts will (should!) run without error, though no output is produced. This provides a nice starting point for backend writers because you can selectively implement methods (draw_rectangle, draw_lines, etc...) and slowly see your figure come to life w/o having to have a full blown implementation before getting any results. Copy this to backend_xxx.py and replace all instances of 'template' with 'xxx'. Then implement the class methods and functions below, and add 'xxx' to the switchyard in matplotlib/backends/__init__.py and 'xxx' to the backends list in the validate_backend methon in matplotlib/__init__.py and you're off. You can use your backend with:: import matplotlib matplotlib.use('xxx') from pylab import * plot([1,2,3]) show() matplotlib also supports external backends, so you can place you can use any module in your PYTHONPATH with the syntax:: import matplotlib matplotlib.use('module://my_backend') where my_backend.py is your module name. Thus syntax is also recognized in the rc file and in the -d argument in pylab, eg:: python simple_plot.py -dmodule://my_backend The files that are most relevant to backend_writers are matplotlib/backends/backend_your_backend.py matplotlib/backend_bases.py matplotlib/backends/__init__.py matplotlib/__init__.py matplotlib/_pylab_helpers.py Naming Conventions * classes Upper or MixedUpperCase * varables lower or lowerUpper * functions lower or underscore_separated iÿÿÿÿ(tdivisionN(tGcf(t RendererBasetGraphicsContextBasetFigureManagerBasetFigureCanvasBase(tFigure(tBboxtRendererTemplatecB skeZdZd„Zd d„Zd d d„Zed„Zd„Z d„Z d„Z d„Z d „Z RS( sö The renderer handles drawing/rendering operations. This is a minimal do-nothing class that can be used to get started when writing a new backend. Refer to backend_bases.RendererBase for documentation of the classes methods. cC s ||_dS(N(tdpi(tselfR ((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt__init__KscC sdS(N((R tgctpatht transformtrgbFace((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt draw_pathNscC sdS(N((R txtytimtbboxtclippathtclippath_trans((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt draw_imageiscC sdS(N((R R RRtstproptangletismath((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt draw_textlscC stS(N(tTrue(R ((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytflipyoscC sdS(Nid(idid((R ((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytget_canvas_width_heightrscC sdS(Ni(iii((R RRR((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytget_text_width_height_descentuscC stƒS(N(tGraphicsContextTemplate(R ((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytnew_gcxscC s|S(N((R tpoints((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytpoints_to_pixels{sN(t__name__t __module__t__doc__R tNoneRRtFalseRRRR R"R$(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyRCs       R!cB seZdZRS(sâ The graphics context provides the color, line styles, etc... See the gtk and postscript backends for examples of mapping the graphics context attributes (cap styles, join styles, line widths, colors) to a particular backend. In GTK this is done by wrapping a gtk.gdk.GC object and forwarding the appropriate calls to it using a dictionary mapping styles to gdk constants. In Postscript, all the work is done by the renderer, mapping line styles to postscript calls. If it's more appropriate to do the mapping at the renderer level (as in the postscript backend), you don't need to override any of the GC methods. If it's more appropriate to wrap an instance (as in the GTK backend) and do the mapping here, you'll need to override several of the setter methods. The base GraphicsContext stores colors as a RGB tuple on the unit interval, eg, (0.5, 0.0, 1.0). You may need to map this to colors appropriate for your backend. (R%R&R'(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyR!„scC sdS(s— For image backends - is not required For GUI backends - this should be overriden if drawing should be done in interactive python mode N((((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytdraw_if_interactive£scC sxtiƒD]}q WdS(s: For image backends - is not required For GUI backends - show() is usually the last line of a pylab script and tells the backend that it is time to draw. In interactive mode, this may be a do nothing func. See the GTK backend for an example of how to handle interactive versus batch mode N(Rtget_all_fig_managers(tmanager((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytshow«s cO s@|idtƒ}|||Ž}t|ƒ}t||ƒ}|S(s. Create a new figure manager instance t FigureClass(tpopRtFigureCanvasTemplatetFigureManagerTemplate(tnumtargstkwargsR.tthisFigtcanvasR,((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytnew_figure_manager¸s  R0cB sBeZdZd„ZeiiƒZded(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyR0Çs    R1cB seZdZRS(s† Wrap everything up into a window for the pylab interface For non interactive backends, the base class does all the work (R%R&R'(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyR1ñs(R't __future__Rt matplotlibtmatplotlib._pylab_helpersRtmatplotlib.backend_basesRRRRtmatplotlib.figureRtmatplotlib.transformsRRR!R*R-R7R0R1t FigureManager(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt7s "A  *