I'm trying to resize a matplotlib figure window as part of an
interactive IPython session. I occasionally draw plots that have
strong opinions about the size or aspect ratio of the plotting window,
and I'd like to be able to just put those preferences into the
function that draws the plot.
I can do this:
In : gcf().set_size_inches(15,15); draw()
But then I'm in the awkward position that the canvas doesn't fit
inside the window and only a small part of the plot is visible. If I
touch the corner of the window with the mouse, then the canvas
immediately resizes to the size of the window, destroying my desired
size or aspect ratio.
After a little googling and digging around in the matplotlib objects,
I was able to do this:
which does successfully resize the plotting window, but violates all
pretense of hiding the details of the backends from the plotting code.
I had hoped that once I figured out how to do this the ugly way then
grepping the matplotlib source tree for "geometry" would lead me to
the "right" way to do this. Alas, that strategy didn't work.
I'm using version 0.99.1.1 with the TkAgg backend.