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-%28coordinates%29-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.machu...@gmail.com> 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
> Radek
>
> Dne 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
>

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to