I am building an R package to display Weibull plots (using graphics::plot) in R. The plot has a log-transformed x-axis and a Weibull-transformed y-axis (for lack of a better description). The two-parameter Weibull distribution can thus be represented as a straight line on this plot.

The logarithmic transformation of the x-axis is as simple as adding the log="x" parameter to plot() or curve(). How can I supply the y-axis transformation in an elegant way, so that all graphics-related plotting will work on my axis-transformed plot? To demonstrate what I need, run the following example code:

## initialisation ##
beta     <- 2;eta <- 1000
ticks    <- c(seq(0.01,0.09,0.01),(1:9)/10,seq(0.91,0.99,0.01))
F0inv    <- function (p) log(qweibull(p, 1, 1))
    # this is the transformation function
F0       <- function (q) exp(-exp(q))
    # this is the inverse of the transformation function
weibull  <- function(x)pweibull(x,beta,eta)
    # the curve of this function represents the weibull distribution 
    # as a straight line on weibull paper
weibull2 <- function(x)F0inv(weibull(x))

First an example of a Weibull distribution with beta=2 and eta=1000 on a regular, untransformed plot:

## untransformed axes ##
curve(weibull ,xlim=c(100,1e4),ylim=c(0.01,0.99))
abline(h=ticks,col="lightgray")

plot1

This plot is useless for Weibull analysis. Here is my currently implemented solution that transforms the data with function F0inv() and modifies the y-axis of the plot. Notice that I have to use F0inv() on all y-axis related data.

## transformed axis with F0inv() ##
curve(weibull2,xlim=c(100,1e4),ylim=F0inv(c(0.01,0.99)),log="x",axes=
Edit
Report