Hi
Trying to finish a simple xyplot, but the key colors don't match
those specified on the plot. I have only been able to change the
color of the key text, but not the points.
Hours <- c
(25.88,32.31,24.04,23.27,16.64,19.75,27.25,17.9,20.45,29.65,20.83,27.17,
28.42,28,18.85,17.4,19.75,25.34,23.23,29.85,28.96,25.6,14.67,20.55,25.77
,
23.18,30.37,25.68,24.74,23.57,20.12,15.47,27.63,35,21.88,23.17,26.65,26.
5,19.64,19.57,26.67,23.03,21.85,28.43,27.11,17.43,24.36,23.88,24.13,31.2
7,28.82)
DistanceMeters <- c
(244.77,101.49,188.54,94.76,4.31,34.83,91.76,8.5,1,475.71,337.13,737.32,
272.06,173.71,5.39,45.39,92.69,304.39,487.79,342.87,396.17,382.04,1,0,26
9.4,441.37,303.39,330.39,169.89,462.5,84.62,41.24,1,574.75,5.65,61.52,16
0.99,94.14,103.93,24.38,575.64,4.15,251.73,347.13,5.8,69.92,477.86,465.7
3,152.09,390.05,205.81)
Surveyor <- as.factor(c
("K9","Human","K9","Human","Human","Human","K9","Human","Human","K9","K9
","K9","K9","Human","Human","Human","Human","Human","K9","Human","Human"
,"K9","Human","Human","K9","Human","Human","Human","Human","Human","K9",
"K9","K9","Human","Human","K9","K9","K9","Human","Human","Human","Human"
,"Human","K9","Human","Human","K9","Human","Human","Human","Human"))
library(lattice)
xyplot(DistanceMeters~Hours, groups=Surveyor, xlab="Time (h)",
ylab="Distace Moved (m)", pch = c(1, 16),
col=c("black","black"),
auto.key=T)
Produces dots correctly, but not the points in the key. Switching to
simpleKey I have only been able to change the color of the key text,
but not the points.
xyplot(DistanceMeters~Hours, groups=Surveyor, xlab="Time (h)",
ylab="Distace Moved (m)", pch = c(1, 16),
col=c("black","black"),
key=simpleKey( points = TRUE, text=c("Human", "Dog"),
pch=c(1,16),
col=c("black","black"), space = "right"))
Can anyone help?
Thanks
Ken
On 4/27/07, Ken Nussear <knussear at usgs.gov> wrote:> Hi > > Trying to finish a simple xyplot, but the key colors don't match > those specified on the plot. I have only been able to change the > color of the key text, but not the points. > > > Hours <- c > (25.88,32.31,24.04,23.27,16.64,19.75,27.25,17.9,20.45,29.65,20.83,27.17, > 28.42,28,18.85,17.4,19.75,25.34,23.23,29.85,28.96,25.6,14.67,20.55,25.77 > , > 23.18,30.37,25.68,24.74,23.57,20.12,15.47,27.63,35,21.88,23.17,26.65,26. > 5,19.64,19.57,26.67,23.03,21.85,28.43,27.11,17.43,24.36,23.88,24.13,31.2 > 7,28.82) > > DistanceMeters <- c > (244.77,101.49,188.54,94.76,4.31,34.83,91.76,8.5,1,475.71,337.13,737.32, > 272.06,173.71,5.39,45.39,92.69,304.39,487.79,342.87,396.17,382.04,1,0,26 > 9.4,441.37,303.39,330.39,169.89,462.5,84.62,41.24,1,574.75,5.65,61.52,16 > 0.99,94.14,103.93,24.38,575.64,4.15,251.73,347.13,5.8,69.92,477.86,465.7 > 3,152.09,390.05,205.81) > > Surveyor <- as.factor(c > ("K9","Human","K9","Human","Human","Human","K9","Human","Human","K9","K9 > ","K9","K9","Human","Human","Human","Human","Human","K9","Human","Human" > ,"K9","Human","Human","K9","Human","Human","Human","Human","Human","K9", > "K9","K9","Human","Human","K9","K9","K9","Human","Human","Human","Human" > ,"Human","K9","Human","Human","K9","Human","Human","Human","Human")) > > library(lattice) > > > xyplot(DistanceMeters~Hours, groups=Surveyor, xlab="Time (h)", > ylab="Distace Moved (m)", pch = c(1, 16), col=c("black","black"), > auto.key=T)You need xyplot(DistanceMeters~Hours, groups=Surveyor, [...] , par.settings = list(superpose.symbol = list( pch = c(1, 16), col=c("black","black")), auto.key=TRUE) -Deepayan
Seemingly Similar Threads
- by and by: using two indices in by() or tapply()
- Puzzle
- 2.0beta4 doesn't respond to DONE after untagged FETCH during IDLE
- Probably K9 not Outlook - Re: Outlook 2010 not connecting to secure POP3
- Probably K9 not Outlook - Re: Outlook 2010 not connecting to secure POP3