减少matplotlib中的y刻度,字符串错误

时间:2019-04-29 17:05:53

标签: python matplotlib plot

如何使用matplotlib减小y刻度?

这是我创建情节的代码:

plt.plot(loss)
plt.locator_params(nbins=10)
plt.title('andamento loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.show()
plt.savefig('andamento_loss.png')

但我收到此错误:

UserWarning: 'set_params()' not defined for locator of type <class 'matplotlib.category.StrCategoryLocator'>
  str(type(self)))

我该如何解决这个问题?

0 个答案:

没有答案