Hackfut Security File Manager
Current Path:
/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
matplotlib
/
backends
/
📁
..
📁
Matplotlib.nib
📄
__init__.py
(2.17 KB)
📄
__init__.pyc
(2.12 KB)
📄
__init__.pyo
(2.12 KB)
📄
_backend_agg.so
(420.74 KB)
📄
_backend_gdk.so
(8.2 KB)
📄
_gtkagg.so
(140.51 KB)
📄
backend_agg.py
(12.73 KB)
📄
backend_agg.pyc
(14.6 KB)
📄
backend_agg.pyo
(13.42 KB)
📄
backend_cairo.py
(16.11 KB)
📄
backend_cairo.pyc
(18.32 KB)
📄
backend_cairo.pyo
(18.32 KB)
📄
backend_cocoaagg.py
(8.78 KB)
📄
backend_cocoaagg.pyc
(12.04 KB)
📄
backend_cocoaagg.pyo
(12.04 KB)
📄
backend_emf.py
(21.81 KB)
📄
backend_emf.pyc
(25.25 KB)
📄
backend_emf.pyo
(25.25 KB)
📄
backend_fltkagg.py
(20.36 KB)
📄
backend_fltkagg.pyc
(26.77 KB)
📄
backend_fltkagg.pyo
(26.77 KB)
📄
backend_gdk.py
(15.59 KB)
📄
backend_gdk.pyc
(17.21 KB)
📄
backend_gdk.pyo
(17.21 KB)
📄
backend_gtk.py
(39.75 KB)
📄
backend_gtk.pyc
(45.22 KB)
📄
backend_gtk.pyo
(45.22 KB)
📄
backend_gtkagg.py
(4.04 KB)
📄
backend_gtkagg.pyc
(5.11 KB)
📄
backend_gtkagg.pyo
(5.11 KB)
📄
backend_gtkcairo.py
(2.03 KB)
📄
backend_gtkcairo.pyc
(3.79 KB)
📄
backend_gtkcairo.pyo
(3.79 KB)
📄
backend_macosx.py
(14.3 KB)
📄
backend_macosx.pyc
(20.82 KB)
📄
backend_macosx.pyo
(20.72 KB)
📄
backend_mixed.py
(5.04 KB)
📄
backend_mixed.pyc
(4.81 KB)
📄
backend_mixed.pyo
(4.74 KB)
📄
backend_pdf.py
(75.89 KB)
📄
backend_pdf.pyc
(66.56 KB)
📄
backend_pdf.pyo
(66.45 KB)
📄
backend_ps.py
(50.24 KB)
📄
backend_ps.pyc
(47.73 KB)
📄
backend_ps.pyo
(47.73 KB)
📄
backend_qt.py
(16.45 KB)
📄
backend_qt.pyc
(21.19 KB)
📄
backend_qt.pyo
(21.19 KB)
📄
backend_qt4.py
(20.51 KB)
📄
backend_qt4.pyc
(24.83 KB)
📄
backend_qt4.pyo
(24.83 KB)
📄
backend_qt4agg.py
(4.69 KB)
📄
backend_qt4agg.pyc
(5.91 KB)
📄
backend_qt4agg.pyo
(5.91 KB)
📄
backend_qtagg.py
(4.86 KB)
📄
backend_qtagg.pyc
(6.05 KB)
📄
backend_qtagg.pyo
(6.05 KB)
📄
backend_svg.py
(25.34 KB)
📄
backend_svg.pyc
(24.31 KB)
📄
backend_svg.pyo
(24.2 KB)
📄
backend_template.py
(8.6 KB)
📄
backend_template.pyc
(9.42 KB)
📄
backend_template.pyo
(9.42 KB)
📄
backend_wx.py
(77.07 KB)
📄
backend_wx.pyc
(79.2 KB)
📄
backend_wx.pyo
(79.13 KB)
📄
backend_wxagg.py
(8.89 KB)
📄
backend_wxagg.pyc
(9.37 KB)
📄
backend_wxagg.pyo
(9.37 KB)
Editing: backend_qtagg.py
""" Render to qt from agg """ from __future__ import division import os, sys import matplotlib from matplotlib import verbose from matplotlib.figure import Figure from backend_agg import FigureCanvasAgg from backend_qt import qt, FigureManagerQT, FigureCanvasQT,\ show, draw_if_interactive, backend_version, \ NavigationToolbar2QT DEBUG = False def new_figure_manager( num, *args, **kwargs ): """ Create a new figure manager instance """ if DEBUG: print 'backend_qtagg.new_figure_manager' FigureClass = kwargs.pop('FigureClass', Figure) thisFig = FigureClass( *args, **kwargs ) canvas = FigureCanvasQTAgg( thisFig ) return FigureManagerQTAgg( canvas, num ) class NavigationToolbar2QTAgg(NavigationToolbar2QT): def _get_canvas(self, fig): return FigureCanvasQTAgg(fig) class FigureManagerQTAgg(FigureManagerQT): def _get_toolbar(self, canvas, parent): # must be inited after the window, drawingArea and figure # attrs are set if matplotlib.rcParams['toolbar']=='classic': print "Classic toolbar is not yet supported" elif matplotlib.rcParams['toolbar']=='toolbar2': toolbar = NavigationToolbar2QTAgg(canvas, parent) else: toolbar = None return toolbar class FigureCanvasQTAgg( FigureCanvasAgg, FigureCanvasQT ): """ The canvas the figure renders into. Calls the draw and print fig methods, creates the renderers, etc... Public attribute figure - A Figure instance """ def __init__( self, figure ): if DEBUG: print 'FigureCanvasQtAgg: ', figure FigureCanvasQT.__init__( self, figure ) FigureCanvasAgg.__init__( self, figure ) self.drawRect = False self.rect = [] self.replot = True self.pixmap = qt.QPixmap() def resizeEvent( self, e ): FigureCanvasQT.resizeEvent( self, e ) def drawRectangle( self, rect ): self.rect = rect self.drawRect = True # False in repaint does not clear the image before repainting self.repaint( False ) def paintEvent( self, e ): """ Draw to the Agg backend and then copy the image to the qt.drawable. In Qt, all drawing should be done inside of here when a widget is shown onscreen. """ FigureCanvasQT.paintEvent( self, e ) if DEBUG: print 'FigureCanvasQtAgg.paintEvent: ', self, \ self.get_width_height() p = qt.QPainter( self ) # only replot data when needed if type(self.replot) is bool: # might be a bbox for blitting if self.replot: FigureCanvasAgg.draw( self ) #stringBuffer = str( self.buffer_rgba(0,0) ) # matplotlib is in rgba byte order. # qImage wants to put the bytes into argb format and # is in a 4 byte unsigned int. little endian system is LSB first # and expects the bytes in reverse order (bgra). if ( qt.QImage.systemByteOrder() == qt.QImage.LittleEndian ): stringBuffer = self.renderer._renderer.tostring_bgra() else: stringBuffer = self.renderer._renderer.tostring_argb() qImage = qt.QImage( stringBuffer, self.renderer.width, self.renderer.height, 32, None, 0, qt.QImage.IgnoreEndian ) self.pixmap.convertFromImage( qImage, qt.QPixmap.Color ) p.drawPixmap( qt.QPoint( 0, 0 ), self.pixmap ) # draw the zoom rectangle to the QPainter if ( self.drawRect ): p.setPen( qt.QPen( qt.Qt.black, 1, qt.Qt.DotLine ) ) p.drawRect( self.rect[0], self.rect[1], self.rect[2], self.rect[3] ) # we are blitting here else: bbox = self.replot l, b, r, t = bbox.extents w = int(r) - int(l) h = int(t) - int(b) reg = self.copy_from_bbox(bbox) stringBuffer = reg.to_string_argb() qImage = qt.QImage(stringBuffer, w, h, 32, None, 0, qt.QImage.IgnoreEndian) self.pixmap.convertFromImage(qImage, qt.QPixmap.Color) p.drawPixmap(qt.QPoint(l, self.renderer.height-t), self.pixmap) p.end() self.replot = False self.drawRect = False def draw( self ): """ Draw the figure when xwindows is ready for the update """ if DEBUG: print "FigureCanvasQtAgg.draw", self self.replot = True FigureCanvasAgg.draw(self) self.repaint(False) def blit(self, bbox=None): """ Blit the region in bbox """ self.replot = bbox self.repaint(False) def print_figure(self, *args, **kwargs): FigureCanvasAgg.print_figure(self, *args, **kwargs) self.draw()
Upload File
Create Folder