rdrc

R drc Plot y-axis scale issues


Trying to make a simple plot and there is a large gap between the first and second data points (0 and 10)

hatch <- drm(ha_.~leachate, data=data, fct = LL.3())

plot(hatch,
     xlim=c(0,500),ylim=c(0,100),
     xlab="Leachate Concentration (%)",ylab="Hatch Rate (%)", col = color1)
plot(hatch, type="confidence", col = color1, add=TRUE)

enter image description here

I tried to manually assign tick marks, which worked but did not resolve the gap issue

hatch <- drm(ha_.~leachate, data=data, fct = LL.3())

plot(hatch,
     xlim=c(0,500),ylim=c(0,100),
     xlab="Leachate Concentration (%)",ylab="Hatch Rate (%)", col = color1)
plot(hatch, type="confidence", col = color1, add=TRUE)
axis(1, at = c(25, 50, 75, 100))

enter image description here


Solution

  • According to the package's documentation, the plot method for dose-response curves defaults to putting the x-axis on a log scale. You should be able to get the original axis by adding log = '' to your plot function.

        plot(hatch,
             xlim=c(0,500),ylim=c(0,100),
             xlab="Leachate Concentration (%)",ylab="Hatch Rate (%)",
             col = color1, log = '')