Re: [R] plot layout with several plots ON plot area of previous plot

From: Jim Lemon <jim_at_bitwrit.com.au>
Date: Thu, 07 Apr 2011 20:53:39 +1000

On 04/07/2011 07:39 PM, Rainer M Krug wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 07/04/11 11:27, Rainer M Krug wrote:
>> Hi
>>
>> I would like to have a plot layout, on which line graphs are on the plot
>> area of an underlying bar graph.
>> How can I achieve this? I know about layout() and par() to create a
>> layout, but as far as I know, they assign non-overlapping plot areas.
>
> Sorry - did not do my homework and forgot to google - found the solution
> (http://tolstoy.newcastle.edu.au/R/help/04/11/6449.html).
>
> But an additional question - uis there a way to position the plots in
> relation to the co-ordinates of the first plot, i.e. the x axis of the
> first plot (ehich covers the whole plot area) is from 1 to 6 - can I
> position the second overlapping plot over the x-coordinate 3 of the
> first plot?
>
> Rainer
>
>
>>
>> Effectively, it should look as below:
>>
>> |------------------------|
>> | |
>> | |---| |---| |
>> | | | | | |
>> | | | | | |
>> | |-L-| |-L-| |
>> | |
>> | |
>> | |
>> | |
>> | |
>> | |
>> |-the bargraph-----------|
>>
>> L: the line graphs
>>
Hi Rainer,
I think you want the subplot function in the TeachingDemos package.

Jim



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 07 Apr 2011 - 09:55:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 07 Apr 2011 - 10:20:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive