"Troels Ring" <tring at mail1.stofanet.dk> writes:
> Dear friends.
>
> I wanted to reproduce a sheet of paper useful for plotting the reciprocal
of some biochemical variable (creatinine) over time (Bleyer Am J Kidney Dis
34:576-578,1999). Time on X axis with units years and months. On Y axis,
1/creatinine, but with the original creatinine value indicated - to make it
easier for people to use it. When using the graph, the linear decrease in 1/crea
over time will be useful for managing patients. Here is what I came up with, but
how do I configure the Y axis with the natural values 40-2000 umol/l alongside
their reciprocal representation, so that 1/crea will be a stright line ?
>
> x <- NA
> y <- NA
> plot(x,y,xlim=c(0,10),ylim=c(40,2000))
> grid(nx=10,ny=10,col="black",lty="solid")
> grid(nx=120,ny=10,col="black",lty="dotted")
Something like this, perhaps:
x<-y<-NA
plot(x,y,xlim=c(0,10),ylim=1/c(2000,40), axes=F)
box()
axis(1)
pretty.y<-c(40,50,60,70,100,200,500,2000)
axis(2,at=1/pretty.y,labels=rev(pretty.y),las=2)
axis(4) # for comparison
(The rev() is necessary in both 0.65.x and my version of 0.90.0 pre, but
it looks like a bug, at= and labels= should match up)
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._