本文整理匯總了Python中matplotlib.cm.bone方法的典型用法代碼示例。如果您正苦於以下問題:Python cm.bone方法的具體用法?Python cm.bone怎麽用?Python cm.bone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類matplotlib.cm
的用法示例。
在下文中一共展示了cm.bone方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: viz_attn
# 需要導入模塊: from matplotlib import cm [as 別名]
# 或者: from matplotlib.cm import bone [as 別名]
def viz_attn(input_sentence, output_words, attentions):
maxi = max(len(input_sentence.split()),len(output_words))
attentions = attentions[:maxi,:maxi]
fig = plt.figure()
ax = fig.add_subplot(111)
cax = ax.matshow(attentions.numpy(), cmap=cm.bone)
fig.colorbar(cax)
ax.set_xticklabels([''] + input_sentence.split(' ') +
['<EOS>'], rotation=90)
ax.set_yticklabels([''] + output_words)
ax.xaxis.set_major_locator(ticker.MultipleLocator(1))
ax.yaxis.set_major_locator(ticker.MultipleLocator(1))
plt.show()
示例2: bone
# 需要導入模塊: from matplotlib import cm [as 別名]
# 或者: from matplotlib.cm import bone [as 別名]
def bone():
'''
set the default colormap to bone and apply to current image if any.
See help(colormaps) for more information
'''
rc('image', cmap='bone')
im = gci()
if im is not None:
im.set_cmap(cm.bone)
draw_if_interactive()
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost