コード例 #1
0
ファイル: backend_gtkagg.py プロジェクト: jtomase/matplotlib
    def print_figure(self,
                     filename,
                     dpi=None,
                     facecolor='w',
                     edgecolor='w',
                     orientation='portrait',
                     **kwargs):
        if DEBUG: print 'FigureCanvasGTKAgg.print_figure'
        # delete the renderer to prevent improper blitting after print

        if dpi is None: dpi = matplotlib.rcParams['savefig.dpi']
        root, ext = os.path.splitext(filename)
        ext = ext.lower()[1:]
        if ext == 'jpg':
            FigureCanvasGTK.print_figure(self, filename, dpi, facecolor,
                                         edgecolor, orientation, **kwargs)

        else:
            agg = self.switch_backends(FigureCanvasAgg)
            try:
                agg.print_figure(filename, dpi, facecolor, edgecolor,
                                 orientation, **kwargs)
            except IOError, msg:
                error_msg_gtk('Failed to save\nError message: %s' % (msg, ),
                              self)
コード例 #2
0
    def print_figure(self, filename, dpi=150,
                     facecolor='w', edgecolor='w',
                     orientation='portrait'):
        if DEBUG: print 'FigureCanvasGTKAgg.print_figure'
        # delete the renderer to prevent improper blitting after print

        root, ext = os.path.splitext(filename)       
        ext = ext.lower()[1:]
        if ext == 'jpg':
            FigureCanvasGTK.print_figure(self, filename, dpi, facecolor,
                                         edgecolor, orientation)
            
        else:
            agg = self.switch_backends(FigureCanvasAgg)
            agg.print_figure(filename, dpi, facecolor, edgecolor, orientation)
コード例 #3
0
    def print_figure(self, filename, dpi=150,
                     facecolor='w', edgecolor='w',
                     orientation='portrait'):
        if DEBUG: print 'FigureCanvasGTKAgg.print_figure'
        # delete the renderer to prevent improper blitting after print

        root, ext = os.path.splitext(filename)       
        ext = ext.lower()[1:]
        if ext == 'jpg':
            FigureCanvasGTK.print_figure(self, filename, dpi, facecolor,
                                         edgecolor, orientation)
            
        else:
            agg = self.switch_backends(FigureCanvasAgg)
            agg.print_figure(filename, dpi, facecolor, edgecolor, orientation)
コード例 #4
0
    def print_figure(self, filename, dpi=150, facecolor="w", edgecolor="w", orientation="portrait"):
        if DEBUG:
            print "FigureCanvasGTKAgg.print_figure"
        # delete the renderer to prevent improper blitting after print

        root, ext = os.path.splitext(filename)
        ext = ext.lower()[1:]
        if ext == "jpg":
            FigureCanvasGTK.print_figure(self, filename, dpi, facecolor, edgecolor, orientation)

        else:
            agg = self.switch_backends(FigureCanvasAgg)
            agg.print_figure(filename, dpi, facecolor, edgecolor, orientation)

        self.figure.set_canvas(self)
コード例 #5
0
    def print_figure(self, filename, dpi=150,
                     facecolor='w', edgecolor='w',
                     orientation='portrait'):
        if DEBUG: print 'FigureCanvasGTKAgg.print_figure'
        # delete the renderer to prevent improper blitting after print

        root, ext = os.path.splitext(filename)       
        ext = ext.lower()[1:]
        if ext == 'jpg':
            FigureCanvasGTK.print_figure(self, filename, dpi, facecolor,
                                         edgecolor, orientation)
            
        else:
            agg = self.switch_backends(FigureCanvasAgg)
            try: agg.print_figure(filename, dpi, facecolor, edgecolor, orientation)
            except IOError, msg:
                error_msg_gtk('Failed to save\nError message: %s'%(msg,), self)
コード例 #6
0
    def print_figure(self, filename, dpi=None, facecolor="w", edgecolor="w", orientation="portrait", **kwargs):
        if DEBUG:
            print "FigureCanvasGTKAgg.print_figure"
        # delete the renderer to prevent improper blitting after print

        if dpi is None:
            dpi = matplotlib.rcParams["savefig.dpi"]
        root, ext = os.path.splitext(filename)
        ext = ext.lower()[1:]
        if ext == "jpg":
            FigureCanvasGTK.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, **kwargs)

        else:
            agg = self.switch_backends(FigureCanvasAgg)
            try:
                agg.print_figure(filename, dpi, facecolor, edgecolor, orientation, **kwargs)
            except IOError, msg:
                error_msg_gtk("Failed to save\nError message: %s" % (msg,), self)