[R] xyplot lattice fine control of axes limits and thick marks (with log scale)
maxbre
mbressan at arpa.veneto.it
Wed Mar 28 12:21:30 CEST 2012
After a long and winding road (sorry but I'm a novice) I get to a final
result which is quite close to what I need;
nevertheless I would like to tweak a little further the xyplot so that I can
get ***for each single panel defined by variable z*** a finer control over:
-the x and y the limits: I would like to be the same for both axes;
-the number of thick marks: again I would like to be same for both axes;
the (general) code snippet here attached does not get this result;
any help for this ?
thank you
#my example
xyplot(y ~ x | z, data=mydata,
aspect="xy",
scales= list(x=list(relation="free", log=10),
y=list(relation="free", log=10)),
prepanel = function(x, y, subscripts) {
list(xlim = c(min(x,y), max(x,y)))
list(ylim= c(min(x,y), max(x,y)))
},
panel = function(x, y ,subscripts,...) {
#panel.xyplot(x, y, xlim = c(min(x,y), max(x,y)), ylim =
c(min(x,y), max(x,y)),...)
panel.xyplot(x, y, ...)
panel.abline(a = 0, b = 1, lty = 2, col ="gray")
panel.text(x, y, labels=mydata$name[subscripts])
},
subscripts=TRUE,
xscale.components = xscale.components.logpower,
yscale.components = yscale.components.logpower
)
in attachment http://r.789695.n4.nabble.com/file/n4511897/my_example.png
my_example.png
--
View this message in context: http://r.789695.n4.nabble.com/xyplot-lattice-fine-control-of-axes-limits-and-thick-marks-with-log-scale-tp4511897p4511897.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list