本文整理汇总了Python中matplotlib.backend_bases.FigureCanvasBase.draw方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasBase.draw方法的具体用法?Python FigureCanvasBase.draw怎么用?Python FigureCanvasBase.draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backend_bases.FigureCanvasBase
的用法示例。
在下文中一共展示了FigureCanvasBase.draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: compute_output
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import draw [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()
示例2: compute
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import draw [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)