R: Using logarithmic and linear axis scale on one axis

332 views Asked by At

I hit a dead end, finding a solution to my problem:

I want to draw a graph with the y axis being scaled logarithmically. The only problem is, I have one value that is 0. My solution to the problem of not log10(0) not being defined would be to break the y axis into one part that is scaled linear, from, say 0 to 0.001 and a second part that is logarithmic with the following values 0.00001, 0.000001, and 0.000001.

I have searched for almost a day now and couldn't find a Way to do this. Is there a parameter to break.axis or something similar I have missed?

What I have so far is pretty simple stuff:

d <- read.csv2(file="Verdunstungfuergrafik.csv")
plot(d, type="b", xaxt="n", yaxt="n", xlab="ABA-Konzentration in mol/l",     ylab="Verdunstung in g/gFw", col="blue1")
sfsmisc::eaxis(side=1, at=10^c(-6:-4))
sfsmisc::eaxis(side=2)

The imported CSV file looks like this:

Abakonzentration Verdunstung
0e+00      0.5770
1e-06      0.3600
1e-05      0.0800
1e-04      0.0685
1

There are 1 answers

1
stochazesthai On

Try magaxis() in magicaxis R package.