我意識到這個問題之前已被問到(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