title: ggplot for dose-response curve using drc package
body: <p>I'm trying to plot dose-response curve in ggplot using drc package using below code and have two questions as follows.
  <strong>First</strong>: I need to include 0, 10, 100 etc and omit 4000 label on the x axis, how it can be done?. <strong>Second</strong>: Is it possible to squeeze the graph towards y-axis as the first data point is at 100, much space is taken up before that. I need to arrange several plots side by side so if the plot can start from 100 and how we can avoid the overlap of labels (for example 2000 and 3000 in the image below). Please guide me with this, thanks! <a href="https://i.stack.imgur.com/VEf4x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VEf4x.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/VpgSS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VpgSS.png" alt="enter image description here" /></a></p>
  <pre><code>gi &lt;- as.numeric(c(&quot;0&quot;, &quot;5.24&quot;, &quot;24.2&quot;, 
          &quot;37.2&quot;, &quot;71.9&quot;, &quot;80&quot;, 
          &quot;100&quot;, &quot;100&quot;, &quot;0&quot;, 
          &quot;0&quot;, &quot;15.1&quot;, &quot;42.8&quot;, &quot;61.8&quot;, &quot;73.5&quot;, &quot;97.3&quot;, &quot;100&quot;))
  
  conc &lt;- as.numeric(c(&quot;0&quot;, &quot;100&quot;, &quot;167&quot;, &quot;278.89&quot;, &quot;465.74&quot;, &quot;777.79&quot;, &quot;1298.91&quot;, &quot;2169.19&quot;, &quot;0&quot;, &quot;100&quot;, &quot;167&quot;, &quot;278.89&quot;, &quot;465.74&quot;, &quot;777.79&quot;, &quot;1298.91&quot;, &quot;2169.19&quot; ))
  df &lt;- data.frame(conc, gi)
  library(&quot;drc&quot;)
  library(ggplot2)
  
  Pyr &lt;- drm(gi ~ conc, data = df, fct = LL.4(fixed = c(NA, 0, 100, NA)))
  newdata &lt;- expand.grid(conc=exp(seq(log(0.5), log(3000), length=500)))
  
  # predictions and confidence intervals
  
  pm &lt;- predict(Pyr, newdata=newdata, interval=&quot;confidence&quot;)
  
  # new data with predictions
  
  newdata$p &lt;- pm[,1]
  newdata$pmin &lt;- pm[,2]
  newdata$pmax &lt;- pm[,3]
  
  # need to shift conc == 0 a bit up, otherwise there are problems with coord_trans
  
  df$conc0 &lt;- df$conc
  df$conc0[df$conc0 == 0] &lt;- 0.5
  
  # plotting the curve
  
  ggplot(df, aes(x = conc0, y = gi)) +
    geom_point() +
    geom_ribbon(data=newdata, aes(x=conc, y=p, ymin=pmin, ymax=pmax), alpha=0.2) +
    geom_line(data=newdata, aes(x=conc, y=p)) +
    coord_trans(x=&quot;log&quot;) +
    ggtitle(&quot;Pyridine&quot;) + xlab(&quot;Concentration (mg/l)&quot;) + ylab(&quot;Growth inhibition&quot;)
  </code></pre>