setting figure height in ipython

The default size chosen by imshow yields unpleasantly small images. Fortunately, you can easily change them using the rather strangely named gcf() function:

import pylab as P  
...  
f = P.gcf()  
f.set_figheight(16)  
f.set_figwidth(16)

log-spaced values with numpy

I knew this had to exist, since otherwise generated logarithmic plots in matplotlib would be a pain in the butt. Still, it took a bit of searching, although perhaps just the name should have clued me in.

 fig, ax = plt.subplots()
 steps = N.log10(N.logspace(0.9, 1-1e-5))
 ax.set_yscale('log', basex=10)
 ax.plot(steps, f(steps), '-')

Also, a shout-out for the ipython inline graphs (

ipython notebook --pylab inline

). Beautiful, and I can copy-paste them into emails and google docs!