[R] lattice panel fine control
maxbre
mbressan at arpa.veneto.it
Thu Jun 2 23:02:09 CEST 2011
ok thanks again for your reply: this is what I worked out so far
#start code
xyplot(ped.avg ~ tv.avg | family,
data=mydata,
strip=strip.custom(bg='white'), col.line=1, main="title",
xlab = expression(paste('tv [ fg/', m^3, ' ]', sep = '')),
ylab = expression(paste('ped [ fg/', m^3, ' ]', sep = '')),
scales= list(x=list(relation="free", log=10),
y=list(relation="free", log=10)
),
as.table=TRUE,
prepanel = function(x, y, ...) {
xlim=list(c(1, 3), c(0.2,2.8), c(1.8,3.8),c(1.8,3))
ylim=list(c(1, 3), c(0.2,2.8), c(1.8,3.8),c(1.8,3))
dx=list(c(1.4,1.8,2.2,2.6), c(0.6,1,1.4,1.8,2.2,2.6), c(2.2,2.6,3,3.4,3.8),
c(2.2,2.6,3))
dy=list(c(1.4,1.8,2.2,2.6), c(0.6,1,1.4,1.8,2.2,2.6), c(2.2,2.6,3,3.4,3.8),
c(2.2,2.6,3))
},
panel = function(x, y,...) {
panel.xyplot(x, y, cex=0.5,...)
panel.abline(a = 0, b = 1, lty = 2, col ="gray")
panel.text(x, y, lab = mydata$name, cex = 0.5, pos=3,
offset=1, srt=90)
},
xscale.components = xscale.components.logpower,
yscale.components = yscale.components.logpower
)
#end code
but still something is not clear at all to me;
I've been reading the help files but I must confesss that are quite obscure
to me; I would say there is a strange behaviour of this bit of code because
I can not properly get a fine control of each panel x and y axis
prepanel = function(x, y, ...) {
xlim=list(c(1, 3), c(0.2,2.8), c(1.8,3.8),c(1.8,3))
ylim=list(c(1, 3), c(0.2,2.8), c(1.8,3.8),c(1.8,3))
dx=list(c(1.4,1.8,2.2,2.6), c(0.6,1,1.4,1.8,2.2,2.6), c(2.2,2.6,3,3.4,3.8),
c(2.2,2.6,3))
dy=list(c(1.4,1.8,2.2,2.6), c(0.6,1,1.4,1.8,2.2,2.6), c(2.2,2.6,3,3.4,3.8),
c(2.2,2.6,3))
},
I would like to have for each panel x and y axis equallly sped and with
equal limits; for some reasons I do not understand at all the aboe code did
not get the wanted result
any help for this?
thank you, this is indeed a good learning session to me
--
View this message in context: http://r.789695.n4.nabble.com/lattice-panel-fine-control-tp3566347p3569380.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list