ax.set(title="simple plot",
xlabel="x-axis",
ylabel="y-axis")
fig.savefig("image/sample-plot.png")
I checked matplotlib version to see if it's an old one.
Here is an example
y_vals =[1,2,3,4,5]
x_label = [1,2,3,4,5]
plt.ylabel("%")
plt.xlabel("months")
plt.xticks(x_label,["jan","feb","mars","apr","etc"])
plt.plot(x_label,y_vals)
plt.savefig("sample-plot.png")
plt.show()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.