Advertisement
Guest User

Untitled

a guest
Dec 9th, 2012
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. from random import random
  2. import matplotlib.pyplot as plt
  3.  
  4. mylist = [[random() for _ in range(10)] for _ in range(10)]
  5.  
  6. fig = plt.figure()
  7. ax = fig.add_axes([0.1, 0.1, 0.6, 0.8])
  8. for i, l in enumerate(mylist):
  9.     ax.plot(range(10), l, label='label_%d' % i)
  10.  
  11. legenda = ax.legend(loc=2, borderaxespad=0., bbox_to_anchor=(1.02, 1.0))
  12. plt.savefig('plot.png', bbox_extra_artists=[legenda], bbox_inches='tight')
  13. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement