当前位置: 首页>>代码示例>>Python>>正文


Python FigureCanvasBase.print_figure方法代码示例

本文整理汇总了Python中matplotlib.backend_bases.FigureCanvasBase.print_figure方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasBase.print_figure方法的具体用法?Python FigureCanvasBase.print_figure怎么用?Python FigureCanvasBase.print_figure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.backend_bases.FigureCanvasBase的用法示例。


在下文中一共展示了FigureCanvasBase.print_figure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: compute_output

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import print_figure [as 别名]
    def compute_output(self, output_module, configuration):
        figure = output_module.get_input('value')
        w = configuration["width"]
        h = configuration["height"]
        img_format = self.get_format(configuration)
        filename = self.get_filename(configuration, suffix='.%s' % img_format)

        w_inches = w / 72.0
        h_inches = h / 72.0

        previous_size = tuple(figure.get_size_inches())
        figure.set_size_inches(w_inches, h_inches)
        canvas = FigureCanvasBase(figure)
        canvas.print_figure(filename, dpi=72, format=img_format)
        figure.set_size_inches(previous_size[0],previous_size[1])
        canvas.draw()
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:18,代码来源:bases.py

示例2: compute

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import print_figure [as 别名]
    def compute(self):
        figure = self.get_input('figure')
        format = self.get_input('format')
        width = self.get_input('width')
        height = self.get_input('height')
        imageFile = self.interpreter.filePool.create_file(suffix=".%s" % format)

        fig = figure.figInstance
        w_inches = width / 72.0
        h_inches = height / 72.0

        previous_size = tuple(fig.get_size_inches())
        fig.set_size_inches(w_inches, h_inches)
        canvas = FigureCanvasBase(fig)
        canvas.print_figure(imageFile.name, dpi=72, format=format)
        fig.set_size_inches(previous_size[0],previous_size[1])
        canvas.draw()

        self.set_output('imageFile', imageFile)
开发者ID:tacaswell,项目名称:VisTrails,代码行数:21,代码来源:bases.py

示例3: save_with_matplotlib

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import print_figure [as 别名]
 def save_with_matplotlib(plot, width, height, dpi, filename):
     from matplotlib.backend_bases import FigureCanvasBase
     figure = ChacoFigure(plot, width, height, dpi)
     canvas = FigureCanvasBase(figure)
     canvas.print_figure(filename)
     logger.logger.info('Saved plot {}'.format(filename))
开发者ID:AustralianSynchrotron,项目名称:pdviper,代码行数:8,代码来源:chaco_output.py


注:本文中的matplotlib.backend_bases.FigureCanvasBase.print_figure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。