Wednesday, September 22, 2010

6.02 lab 2 notes

matplotlib does not format subplots nicely (labels overlap)
To fix, at bottom after created all subplots, add 2 lines:

hspace = .6 ## I experimentally determined this value worked for me
p.subplots_adjust( hspace=hspace )

(assuming import matplotlib.pyplot as p)

It's magic, I pulled it from
http://stackoverflow.com/questions/2418125/matplotlib-subplots-adjust-hspace-so-titles-and-xlabels-dont-overlap


Also, shortcut for closing all windows (instead of individually right-click and 'c' them all)
Type into the IDLE shell where the figures where generated,

p.close('all')

cheers

No comments:

Post a Comment