adding a subplot

Hi there,

I’m wondering whether there is an easy way to append an additional subplot to an existing figure without losing the subplots already drawn.

Currently if I do something like

subplot(211); plot(…); subplot(212); plot(…);

Then I get inconsistent drawing results if I try something like:

subplot(313); plot(…);

Cheers,

Alex

Yes, it is “possible”, but it can be messy to do so. Also, which version of matplotlib are you using? Is there a particular reason why you don’t know the number of plots ahead of time?

Ben Root

···

On Mon, Jun 27, 2011 at 5:09 PM, Alex Flint <alex.flint@…287…> wrote:

Hi there,

I’m wondering whether there is an easy way to append an additional subplot to an existing figure without losing the subplots already drawn.

Currently if I do something like

subplot(211); plot(…); subplot(212); plot(…);

Then I get inconsistent drawing results if I try something like:

subplot(313); plot(…);

Cheers,

Alex

I’m using 0.99.3, which is from the ubuntu maverick repos.

This comes up mostly when I’m drawing plots interactively from ipython.

Cheers,

Alex

···

On Tue, Jun 28, 2011 at 10:44 AM, Benjamin Root <ben.root@…1304…> wrote:

On Mon, Jun 27, 2011 at 5:09 PM, Alex Flint <alex.flint@…287…> wrote:

Hi there,

I’m wondering whether there is an easy way to append an additional subplot to an existing figure without losing the subplots already drawn.

Currently if I do something like

subplot(211); plot(…); subplot(212); plot(…);

Then I get inconsistent drawing results if I try something like:

subplot(313); plot(…);

Cheers,

Alex

Yes, it is “possible”, but it can be messy to do so. Also, which version of matplotlib are you using? Is there a particular reason why you don’t know the number of plots ahead of time?

Ben Root