[R] xyplot with 2 panels and 2 different x-scales
taz9
alienz747 at gmail.com
Fri Jul 31 19:25:04 CEST 2009
Hi All,
I have this data:
type<-c("country","country","country","world","world","world")
place<-c("A","B","C","A","B","C")
rank<-c(1,3,5,512,420,320)
df1<-data.frame(type,place,rank)
and need to produce an xyplot with 2 panels, where the x-values are
labelled:
xyplot(place~rank|type, data=df1,
panel= function(x, y, ..., subscripts)
{
panel.xyplot(x,y,..., subscripts)
require(grid)
panel.grid(h = -1,v = 0, lty="dotted")
grid.text(unit(x,"native"),
unit(y,"native"),
label=x, just="center")
})
Now as you can see, the range of data is very different for the 2 panels.
I'd like to have the x-scales be different in each panel to better visualize
this data.
http://www.nabble.com/file/p24760060/example1.png
--
View this message in context: http://www.nabble.com/xyplot-with-2-panels-and-2-different-x-scales-tp24760060p24760060.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list