[R] Help on subgraphs in xyplot of lattice library

R. Michael Weylandt michael.weylandt at gmail.com
Sun Mar 11 02:29:44 CET 2012


That's not useful sample data -- like I said, dput() some sample data
and send it. I can try to figure out how to plot what you're asking,
but there is literally no data in what you sent.

Not copy and paste the output of a print command -- dput(). (You'll
understand why when you see it)

And like I also said, if you could give a sketch as to how you would
do this in base graphics, it will be much easier for us to help you
translate into lattice graphics. I only ask because you said you could
do so.

Michael

Also please send plain text if you know how.

On Sat, Mar 10, 2012 at 2:42 PM, Chee Chen <chee.chen at yahoo.com> wrote:
> Hi, Michael,
> Thank you for your help!
> In its simplified form,  the data frame looks like:
>
> idx     true_value      mean    diff_mean1     diff_mean2    diff_mean3
>  sdt     diff_std1    diff_std2    diff_std3     samplesize
> 1
>                              1000
> 2
>                                  1000
> 3
>       1000
> 4
>                                 1000
> 5
>       1000
> 1
>      5000
> 2
>                                      5000
> 3
>   5000
> 4
>   5000
> 5
>  5000
>
> I would like the plot to be:
> row1 has 4 subplots for samplesize 1000;
> row2  has 4 subplots for samplesize 5000;
>
> in each row:
>  the 1st subplot is true_value against mean;
>  the 2nd is an overlay plot for idx against diff_mean1, idx against
> diff_mean2, idx against diff_mean3;
> the 3rd is true_value against std;
> the 4th is an overlay plot for idx against diff_std1, idx against diff_std2,
> idx against diff_std3.
>
> I have looked at sample xyplot codes, but still did not know how to realize
> this.
>
> Thanks again!
> Chee
>
>
>
>
>
>
> From: R. Michael Weylandt
> Sent: Saturday, March 10, 2012 12:20 PM
> To: Chee Chen
> Cc: R-ORG
> Subject: Re: [R] Help on subgraphs in xyplot of lattice library
>
> What does your data look like....dput() is your friend.
>
> Also, it'd be helpful if you could give base graphics code for
> more-or-less what you are looking for (since you can do so already) as
> it's pretty hard to describe graphics without pictures.
>
> Running example(xyplot) might help you get started as well.
>
> Michael
>
> On Sat, Mar 10, 2012 at 12:04 PM, Chee Chen <chee.chen at yahoo.com> wrote:
>> Dear All,
>> I would like to ask a question on how to do overlay plots in each subgraph
>> of xyplot.
>> 1.  I did simulations for m=1000, 2500, 5000, 10000, as the sample sizes.
>> 2. for each sample size value m,  4 graphs are generated; each graph
>> contains overlayed comparisons between 4 methods,
>> 3.  now I want put them into a 4-by-4  plot by xyplot, i.e.,  4 sample
>> size values, each of which has 4 plots.
>>
>> I know how to do this using plot, but the spaces between subplots are big.
>>
>> I do not know how to make each subplot in xyplot an overlayed one as it
>> would appear using plot.
>>
>> Any help would be appreciated!
>>
>> Thank you,
>> Chee
>>
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> 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.



More information about the R-help mailing list