本文整理匯總了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)