Subaxes

Given an axes instance ax1, I would like to create another axes instance
ax2, embedded in the first one with a given rectangle, in ax1
coordinates.

For instance, I might want to create axes ax2 that sit in the top left
corner of ax1, with height and width 0.25 times those of ax1.

What is the right way of doing this? I have been too stupid to figure it
out.

Cheers,

Gaël

Hi Gaël,

there might be a better way of doing it, but the attached example seems to do
the job.

best regards Matthias

axes_in_axes.py (516 Bytes)

···

On Thursday 06 August 2009 10:46:44 Gael Varoquaux wrote:

Given an axes instance ax1, I would like to create another axes instance
ax2, embedded in the first one with a given rectangle, in ax1
coordinates.

For instance, I might want to create axes ax2 that sit in the top left
corner of ax1, with height and width 0.25 times those of ax1.

What is the right way of doing this? I have been too stupid to figure it
out.

Cheers,

Gaël

The thread below might be helpful.

http://thread.gmane.org/gmane.comp.python.matplotlib.general/16373

This will work as far as you keep the aspect="auto".

Also, if you're using matplotlib 0.99rc version, or matplotlib from
svn, you may take a look at

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#insetlocator

This works even though aspect=1 (or other value).

Regards,

-JJ

···

On Thu, Aug 6, 2009 at 7:27 AM, Matthias Michler<MatthiasMichler@...361...> wrote:

Hi Gaël,

there might be a better way of doing it, but the attached example seems to do
the job.

best regards Matthias

On Thursday 06 August 2009 10:46:44 Gael Varoquaux wrote:

Given an axes instance ax1, I would like to create another axes instance
ax2, embedded in the first one with a given rectangle, in ax1
coordinates.

For instance, I might want to create axes ax2 that sit in the top left
corner of ax1, with height and width 0.25 times those of ax1.

What is the right way of doing this? I have been too stupid to figure it
out.

Cheers,

Gaël

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thanks a lot to both of you. I have fallen in a time gap, and thus have
had to switch to other work and haven't been able to use your advice, but
it will come in handy when I get back to what I was doing.

Gaël

···

On Thu, Aug 06, 2009 at 10:53:13AM -0400, Jae-Joon Lee wrote:

The thread below might be helpful.

http://thread.gmane.org/gmane.comp.python.matplotlib.general/16373

This will work as far as you keep the aspect="auto".

Also, if you're using matplotlib 0.99rc version, or matplotlib from
svn, you may take a look at

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#insetlocator

This works even though aspect=1 (or other value).