我意识到这个问题之前已被问到(Python Pyplot Bar Plot bars disappear when using log scale),但给出的答案不适用于我。我把我的pyplot.bar(x_values,y_values等,登录= TRUE),但得到一个错误,指出:Barplot与日志y轴程序语法与matplotlib pyplot
"TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'"
我白白一直在寻找使用柱状图与pyplot代码的实际例子y轴设置为日志但没有找到它。我究竟做错了什么?
这里是代码:
import matplotlib.pyplot as pyplot
ax = fig.add_subplot(111)
fig = pyplot.figure()
x_axis = [0, 1, 2, 3, 4, 5]
y_axis = [334, 350, 385, 40000.0, 167000.0, 1590000.0]
ax.bar(x_axis, y_axis, log = 1)
pyplot.show()
我得到一个错误,甚至当我removre pyplot.show。在此先感谢帮助
显示使用_full_回溯请 – tacaswell