本文整理汇总了Python中matplotlib.pylab.gcf方法的典型用法代码示例。如果您正苦于以下问题:Python pylab.gcf方法的具体用法?Python pylab.gcf怎么用?Python pylab.gcf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.pylab
的用法示例。
在下文中一共展示了pylab.gcf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save_images
# 需要导入模块: from matplotlib import pylab [as 别名]
# 或者: from matplotlib.pylab import gcf [as 别名]
def save_images(self, X, imgfile, density=False):
ax = plt.axes()
x = X[:, 0]
y = X[:, 1]
if density:
xy = np.vstack([x,y])
z = scipy.stats.gaussian_kde(xy)(xy)
ax.scatter(x, y, c=z, marker='o', edgecolor='')
else:
ax.scatter(x, y, marker='o', c=range(x.shape[0]),
cmap=plt.cm.coolwarm)
if self.collection is not None:
self.collection.set_transform(ax.transData)
ax.add_collection(self.collection)
ax.text(x[0], y[0], str('start'), transform=ax.transAxes)
ax.axis([-0.2, 1.2, -0.2, 1.2])
fig = plt.gcf()
plt.savefig(imgfile)
plt.close()
示例2: file_process
# 需要导入模块: from matplotlib import pylab [as 别名]
# 或者: from matplotlib.pylab import gcf [as 别名]
def file_process(filename):
fig = plt.gcf()
fig.set_size_inches(18.5,10.5)
fig.savefig("/home/rob/%s.png" % filename,dpi=300)
fig.savefig("/home/rob/%sLOWRES.png" % filename,dpi=50)
Image.open("/home/rob/%s.png" % filename).convert('L').save("/home/rob/%s.jpg" % filename)
Image.open("/home/rob/%sLOWRES.png" % filename).convert('L').save("/home/rob/%sLOWRES.jpg" % filename)
示例3: plot_spectrogram
# 需要导入模块: from matplotlib import pylab [as 别名]
# 或者: from matplotlib.pylab import gcf [as 别名]
def plot_spectrogram(spec, path):
spec = spec.transpose(1, 0) # (seq_len, feature_dim) -> (feature_dim, seq_len)
plt.gcf().clear()
plt.figure(figsize=(12, 3))
plt.imshow(spec, aspect="auto", origin="lower")
plt.colorbar()
plt.tight_layout()
plt.savefig(path, dpi=300, format="png")
plt.close()
####################
# PLOT EMBEDDING #
####################
开发者ID:andi611,项目名称:Self-Supervised-Speech-Pretraining-and-Representation-Learning,代码行数:16,代码来源:audio.py
示例4: plot_embedding
# 需要导入模块: from matplotlib import pylab [as 别名]
# 或者: from matplotlib.pylab import gcf [as 别名]
def plot_embedding(spec, path):
spec = spec.transpose(1, 0) # (seq_len, feature_dim) -> (feature_dim, seq_len)
plt.gcf().clear()
plt.figure(figsize=(12, 3))
plt.pcolormesh(spec, norm=SymLogNorm(linthresh=1e-3))
plt.colorbar()
plt.tight_layout()
plt.savefig(path, dpi=300, format="png")
plt.close()
开发者ID:andi611,项目名称:Self-Supervised-Speech-Pretraining-and-Representation-Learning,代码行数:11,代码来源:audio.py