本文整理汇总了Python中matplotlib.pyplot.NullFormatter方法的典型用法代码示例。如果您正苦于以下问题:Python pyplot.NullFormatter方法的具体用法?Python pyplot.NullFormatter怎么用?Python pyplot.NullFormatter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.pyplot
的用法示例。
在下文中一共展示了pyplot.NullFormatter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: graph_barcode
# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import NullFormatter [as 别名]
def graph_barcode(data, ph, homology_group=0):
persistence = ph.transform(data)
# this function just produces the barcode graph for each homology group
xstart = [s[1][0] for s in persistence if s[0] == homology_group]
xstop = [s[1][1] for s in persistence if s[0] == homology_group]
y = [0.1 * x + 0.1 for x in range(len(xstart))]
plt.hlines(y, xstart, xstop, color='b', lw=4)
# Setup the plot
ax = plt.gca()
plt.ylim(0, max(y) + 0.1)
ax.yaxis.set_major_formatter(plt.NullFormatter())
plt.xlabel('epsilon')
plt.ylabel("Betti dim %s" % (homology_group,))
plt.show()
示例2: plot
# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import NullFormatter [as 别名]
def plot(values, metric_name):
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import sys
plt.style.use('ggplot')
fig, ax = plt.subplots(1, 1, figsize=(25, 3))
ax.margins(0)
x = []
y = []
for index,v in enumerate( values ):
# if not index: continue
# plt.plot(x, new_recall, linewidth=2, label='Condensed Mem Network')
x.append(index)
y.append(v[1]['our']-v[1]['jpeg'])
# plt.plot(x,y, 'o')
# plt.semilogy(x,y)
y_neg = [max(0,i) for i in y]
y_pos = [min(0,i) for i in y]
plt.bar(x,y_neg)
plt.bar(x,y_pos, color='r')
plt.tick_params(axis='x', which='both', bottom='off', top='off', labelbottom='off')
plt.title(metric_name.upper(), x=0.5, y=0.8, fontsize=14)
plt.legend(loc='')
ax.get_xaxis().set_visible(False)
ax.xaxis.set_major_formatter(plt.NullFormatter())
fig.tight_layout()
# plt.savefig('plot_size_' + metric_name + '.png', bbox_inches='tight_layout', pad_inches=0)
plt.savefig('plot_kodak_' + metric_name + '.png')
示例3: plot_mds
# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import NullFormatter [as 别名]
def plot_mds(utv, title='', labels=None, ax=None):
pos = pyrsa.mds(utv)
ax.set_frame_on(False)
ax.tick_params(left=False, bottom=False)
ax.xaxis.set_major_formatter(plt.NullFormatter())
ax.yaxis.set_major_formatter(plt.NullFormatter())
ax.scatter(pos[:, 0], pos[:, 1], s=0)
for i, label in enumerate(labels):
ax.annotate(label, (pos[i, 0], pos[i, 1]), fontsize=6)