Forcing the size of a figure

Forcing the size of a figure
Now that I’m pre-building all my enlarged interpolated images to scroll through, I’m having trouble forcing the figure/FigureCanvas to be the size I want.

I’m trying:

fig.set_size_inches(768 / 72.0, 768 / 72.0), but it ends up the same size as the default plot.

Thanks,

Dave

Dave,

Don’t know if that is a bug or not (never tried that function). Typically, I just use the figsize kwarg in the figure constructor. Is it possible to do it from there, or are you looking to adjust the figure size after the figure has been displayed already?

Ben Root

···

On Fri, Aug 12, 2011 at 10:04 AM, David Just <Just.David@…3721…> wrote:

Now that I’m pre-building all my enlarged interpolated images to scroll through, I’m having trouble forcing the figure/FigureCanvas to be the size I want.

I’m trying:

fig.set_size_inches(768 / 72.0, 768 / 72.0), but it ends up the same size as the default plot.

Thanks,

Dave

Maybe you need to call fig.canvas.draw() to get the figura actually resized.

2011/8/12, Benjamin Root <ben.root@...1304...>:

···

On Fri, Aug 12, 2011 at 10:04 AM, David Just <Just.David@...3721...> wrote:

Now that I’m pre-building all my enlarged interpolated images to scroll
through, I’m having trouble forcing the figure/FigureCanvas to be the
size
I want.

I’m trying:
fig.set_size_inches(768 / 72.0, 768 / 72.0), but it ends up the same size
as the default plot.

Thanks,
Dave

Dave,

Don't know if that is a bug or not (never tried that function). Typically,
I just use the figsize kwarg in the figure constructor. Is it possible to
do it from there, or are you looking to adjust the figure size *after* the
figure has been displayed already?

Ben Root

Forcing the size of a figure

From: David Just [mailto:Just.David@…3721…]
Sent: Friday, August 12, 2011 11:05

Now that I’m pre-building all my enlarged interpolated images to scroll through, I’m having trouble forcing the figure/FigureCanvas to be the size I want.

I’m trying:
fig.set_size_inches(768 / 72.0, 768 / 72.0), but it ends up the same size as the default plot.

If the issue is that the GUI window is not changing size, try adding “forward=True” to the set_size_inches call.