While you cannot add an axes to another axes, you can set position of

an axes "relative to" another axes. The threads below show simple

approaches.

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

http://old.nabble.com/embedding-figures-inside-another-(coordinates)-td22826126.html#a22832238

This may or may not work on your cases depending the complexity of your plots.

Of course, if you need more control on the axes position, you may

implement your own axes_locator.

Regards,

-JJ

## ···

On Mon, Oct 18, 2010 at 9:33 PM, Radek Machulka <radek.machulka@...287...> wrote:

That 'spacial plot' is just several simple plots placed in the 'parent

figure'. So my class just create this bunch of plots as an axes and place them

somewhere.

This is the 'plotting core' of my class:# plot 1

rect1 = [a, b, c, d] # where a, b, c and d values depends on the data, ...

self.plot1 = self.figure.add_axes(rect1)

self.plot1.plot(data1)and the same (similar) for rest of plots (with differnt a,b,c,d values, of

course).So since it is not possible to place axes to another axes there is probably no

solution for my problem.

What can I probably do is create grid of figures (if figures are realy only

element where can axes be placed), but this seems not possible, or rewrite my

class using different elements for subplots instead of axes, if there is

anything...Well, thanks for clarifying this, I should definitely read more documentation

before I start code so complex apps.

But Thank You anyway

RadekDne pondělí 18 října 2010 13:49:34 jste napsal(a):

A figure is a figure and an axes is an axes. They are NOT

interchangeable. The AxesGrid essentially creates a list of axes.As you may already know, only figure class has an add_axes method. And

axes can only be added to a figure. You cannot add an axes to another

axes.Since I have no idea what kind of special plot your code creates, I

can only suggest you to revise your code to take an axes instance as

an input, not a figure instance.If you can, please post a simple, but complete code that demonstrate

your problem.Regards,

-JJ