This page demonstrates Python tips and tricks that I use in my everyday programming as an atmospheric science graduate student.
-Brian Blaylock

Friday, July 11, 2014

Easy Legend

The easiest way to make a legend is to give the plot a label when you first make the plot.
Example:

plt.plot(times_utc,duchesne, label="Duchesne")
plt.plot(times_utc,mtn_home, label="Mountain Home")
plt.plot(times_utc,horsepool, label="Horsepool")

plt.legend(loc=2)


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.