Subject: Seeking advice on lattice package in R2.4.0 concerning stripplot

From: "Dr L. Y Hin" <[email-masked]>
Date: Sat, 16 Dec 2006 09:22:15 +0800

Dear all,

I am using the R 2.4.0 environment on Windows XP SP2 
machine and trying to use the lattice package version 
0.14-9 which you have kindly written to share with the 
R community.

I have a question concerning the stripplot which I'd be very
grateful if you can kindly advise me on:

I used the dataset called trydata to plot a graph using
stripplot (dataset attached), and the scripts used to 
procude the plot is as follows:

trydata<-dget("trydata")
stripplot(Position~Count|y*Grouping,jitter=T,group=subtype,
data=trydata,xlab="Count rate (%)",
pch=c(0,3,6,5),
key=list(text=list(c("GS in front", "GS at the back",
"MS in front","MS at the back")),
points = Rows(trellis.par.get("superpose.symbol"),1:4),
columns=2))

When I plotted the graph and viewed it on
R, the legend and the datapoint shapes are
correct. However, when I export it into .pdf
form using the pulldown menu in R, the legend for 
"GS in front" is incorrect. 
Instead if being a prism, it became
a circle. How can I get around this?
I've attached the figure thus generated in pdf form
for your kind consideration.

Specifically, how can I modify the specifications in the
command to produce the correct pch type in the legend 
as in the chart itself?

Thank you very much in advance for your kind advice.

Best
Lin
______________________________________________
[email-masked] 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.

---

From: Prof Brian D Ripley <[email-masked]>
Date: Sat, 16 Dec 2006 06:24:22 +0000 (GMT Standard Time)

The problem looks to be that you are specifying the types of symbols in two 

> points = Rows(trellis.par.get("superpose.symbol"),1:4),

The simplest thing to do is to run your code directly on the pdf() device,
but you could experiment with other ways of setting the key.

(We don't have the data, so cannot test these ideas.)

On Sat, 16 Dec 2006, Dr L. Y Hin wrote:

> Dear all,
>
> I am using the R 2.4.0 environment on Windows XP SP2 machine and trying to 
> use the lattice package version 0.14-9 which you have kindly written to share 
> with the R community.
>
> stripplot (dataset attached), and the scripts used to procude the plot is as 
> follows:
>
> trydata<-dget("trydata")
> form using the pulldown menu in R, the legend for "GS in front" is incorrect. 
> command to produce the correct pch type in the legend as in the chart itself?
>

-- 
Brian D. Ripley,                  [email-masked]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595