本文整理汇总了Python中matplotlib.image.NonUniformImage.autoscale_None方法的典型用法代码示例。如果您正苦于以下问题:Python NonUniformImage.autoscale_None方法的具体用法?Python NonUniformImage.autoscale_None怎么用?Python NonUniformImage.autoscale_None使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.image.NonUniformImage
的用法示例。
在下文中一共展示了NonUniformImage.autoscale_None方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from matplotlib.image import NonUniformImage [as 别名]
# 或者: from matplotlib.image.NonUniformImage import autoscale_None [as 别名]
def execute(self):
pylab.ioff()
self.figure = pylab.figure()
self.figure.canvas.mpl_connect('motion_notify_event', self.dataPrinter)
x = self.fieldContainer.dimensions[-1].data
y = self.fieldContainer.dimensions[-2].data
xmin=scipy.amin(x)
xmax=scipy.amax(x)
ymin=scipy.amin(y)
ymax=scipy.amax(y)
#Support for images with non uniform axes adapted
#from python-matplotlib-doc/examples/pcolor_nonuniform.py
ax = self.figure.add_subplot(111)
vmin = self.fieldContainer.attributes.get('vmin', None)
vmax = self.fieldContainer.attributes.get('vmax', None)
if vmin is not None:
vmin /= self.fieldContainer.unit
if vmax is not None:
vmax /= self.fieldContainer.unit
if MPL_LT_0_98_1 or self.fieldContainer.isLinearlyDiscretised():
pylab.imshow(self.fieldContainer.maskedData,
aspect='auto',
interpolation='nearest',
vmin=vmin,
vmax=vmax,
origin='lower',
extent=(xmin, xmax, ymin, ymax))
pylab.colorbar(format=F(self.fieldContainer), ax=ax)
else:
im = NonUniformImage(ax, extent=(xmin,xmax,ymin,ymax))
if vmin is not None or vmax is not None:
im.set_clim(vmin, vmax)
im.set_data(x, y, self.fieldContainer.maskedData)
else:
im.set_data(x, y, self.fieldContainer.maskedData)
im.autoscale_None()
ax.images.append(im)
ax.set_xlim(xmin,xmax)
ax.set_ylim(ymin,ymax)
pylab.colorbar(im,format=F(self.fieldContainer), ax=ax)
pylab.xlabel(self.fieldContainer.dimensions[-1].shortlabel)
pylab.ylabel(self.fieldContainer.dimensions[-2].shortlabel)
pylab.title(self.fieldContainer.label)
#ax=pylab.gca()
if self.show:
pylab.ion()
pylab.show()