-3
import matplotlib.pyplot as plt
class Plot_it_for_me:
def flow_rate_graph(self, num, name):
figure, axes=plt.subplots()
title='Case ' + str(num) + ' ' + name
figure.canvas.set_window_title(title)
axes.set_title(title)
axes.set_xlable('units in milisecond')
axes.set_ylable(name +' in Hz')
plt.plot([1,2,3],[3,2,1])
#And do the plotting
plt.show()
axes.legend()
爲什麼會出現以下錯誤?python劇情:對象沒有屬性'set_xlable'
AttributeError: 'AxesSubplot' object has no attribute 'set_xlable'
我使用Python 2.7與Anaconda。
什麼?所以這是拼寫錯誤? –
是的。請參閱[鏈接](http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.set_xlabel)。 –