python - Adding a legend to a plot of a list -


i'm not sure how add legend set of data . i've tried few online guides none seem of help.

l_list = np.linspace(0, 500, 6) #kg plt.hold(true) theta = 84 print("begin simulation...") print() in l_list:     print("mass = ", i, "kgs")     x, y, t = flightenvelope(i, theta)     #t, m, t = flightenvelope(l, i)     plt.plot(x,y)       print() print("simulation complete.") print() print("=============================================================") print("=============================================================") plt.ylabel("height of rocket (m)") plt.xlabel("horizontal distance traveled (m)") plt.title("trajectory of rocket") plt.grid(true) plt.show() 

just use:

plt.legend(["a", "b", "c"]) 

Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -