2
votes

I am using iPython notebook wo do some visualization. Figures are inline (the profile defaults to interactive, as this supports a number of users who prefer interactive more frequently):

%pylab inline

Using the inline plot, I often set the fig size manually:

figsize(10,5)

I find that I need to run cells twice to realize a change in the fig size. For example, if I define cell [1] as figsize(10,5) and run it, the output is the correct size. If I then run cell [2] with `fig size(5,10)1 I get output that is of size (10,5). A second run of cell [2] draws correctly.

Any insight into why this is occurring? Is it due to the inline backend and I just need to live with it?

Thanks.

1
Something funny is going on with the state machine.... - tacaswell

1 Answers

1
votes
Definition: figsize(sizex, sizey)
Docstring:
Set the default figure size to be [sizex, sizey].

This is just an easy to remember, convenience wrapper that sets::

  matplotlib.rcParams['figure.figsize'] = [sizex, sizey]

This seem correct to me, if you run the following, whatever value of X, Y I always get the right plot

figsize(10,5)
plot(range(10))

if you run it after your plot, then you set the default for next plot... but without exact example, hard to say..