## matplotlib-users

 [Matplotlib-users] subplot inside subplot From: Vinu Vikram - 2008-02-06 13:51:42 Attachments: Message as HTML ```Hi All I have a figure of six subplot. I want to make one subplot in such a way that I have to plot two data set with common x-axis with the bottom plot is 30% of the subplot and the upper plot is 70% of the subplot. How can I do that? I tried x = arange(10) y=sin(x) z=cos(y) rect1 = [0.1, 0.1, 0.8, 0.2] rect2 = [0.1, 0.3, 0.8, 0.5] axUpper=axes(rect2) axLower=axes(rect1) axUpper.plot(x,y) axLower.plot(x,z) But how can I do this in a subplot? Thanks Vinu V -- VINU VIKRAM http://iucaa.ernet.in/~vvinuv/ ```
 Re: [Matplotlib-users] subplot inside subplot From: John Hunter - 2008-02-06 17:00:26 ```On Feb 6, 2008 7:51 AM, Vinu Vikram wrote: > Hi All > I have a figure of six subplot. I want to make one subplot in such a way > that I have to plot two data set with common x-axis with the bottom plot is > 30% of the subplot and the upper plot is 70% of the subplot. How can I do > that? I tried > > x = arange(10) > y=sin(x) > z=cos(y) > rect1 = [0.1, 0.1, 0.8, 0.2] > rect2 = [0.1, 0.3, 0.8, 0.5] > axUpper=axes(rect2) > axLower=axes(rect1) > axUpper.plot(x,y) > axLower.plot(x,z) > > But how can I do this in a subplot? You can do this with 'axes', but not with 'subplot'. subplot is just a special case of axes where the assumption is that the axes lie on a regular grid. JDH ```