[R] Sv:

Troels Ring tring at mail1.stofanet.dk
Sat Nov 20 14:31:58 CET 1999


Thank you to Peter Dalgaard, who provided help for some of this solution.
It is still not ideal since the dots which are equidistant in the x-direction ideally should respect the reciprocal scale in the y-direction.

op <- par("cex"= 0.7)
x<-y<-NA
plot(x,y,xlim=c(0,10),ylim=1/c(2000,70), axes=F)
box()
axis(1)
pretty.y<-c(70,80,90,100,110,120,130,140,150,160,180,200,220,250,300,350,400,500,600,800,1200,2000)
axis(2,at=1/pretty.y,labels=(pretty.y),las=2)
axis(4) # for comparison
abline(h=1/pretty.y)
grid(nx=10,ny=0,col="black",lty="solid")
grid(nx=120,ny=0,col="black",lty="dotted")
par(op)


-----Oprindelig meddelelse-----
Fra: Troels Ring <tring at mail1.stofanet.dk>
Til: R-help <r-help at stat.math.ethz.ch>
Dato: 20. november 1999 12:57


>
>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")
>
>Troels Ring, M.D
>Department of Nephrology
>Aalborg, Denmark
>tring at mail1.stofanet.dk
>
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>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
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list