import matplotlib.pyplot
plt.figure()
plt.plot(x, 'r+', label='one')
plt.plot(x1, 'go--', label ='two')
plt.plot(y, 'ro', label='Three')
plt.legend()
In the above code legend marker is 'r+', 'go--' and 'ro' but I want it to change into 1,2 and 3 as there are 3 plots.? Can anyone help me in solving this issue? Also is there any anyway it can be done without hardcoding the numbers? """ Thank you.
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.