title: Shift geometric object along horizontal axis with ggplot
body: <p>I want to use ggplot to plot three curves, each made with <code>stat_function</code> and with its own parameters.
  This is done with the code below:</p>
  <pre><code>library(ggplot2)
  
  ggplot(data.frame(x = c(0, 25)), aes(x)) +
    stat_function(fun = function(x) plogis(x, location = 5, scale = 2), colour = &quot;red&quot;) +
    stat_function(fun = function(x) plogis(x, location = 9, scale = 3), colour = &quot;blue&quot;) +
    stat_function(fun = function(x) plogis(x, location = 9, scale = 4), colour = &quot;green&quot;)
  </code></pre>
  <p>which gives the figure below:</p>
  <p><a href="https://i.stack.imgur.com/l6If8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l6If8.png" alt="enter image description here" /></a></p>
  <p>What I want to achieve is to shift the blue and green curves, exactly as they are, to the right along the horizontal axis (each by an arbitrary amount).</p>
  <p>I don't know of an explicit way to do it in ggplot, so I tried to specify a different frame for the second and third geometric objects, as below:</p>
  <pre><code>ggplot(data.frame(x = c(0, 25)), aes(x)) +
    stat_function(fun = function(x) plogis(x, location = 5, scale = 2), colour = &quot;red&quot;) +
    stat_function(data = data.frame(x = c(3, 28)), fun = function(x) plogis(x, location = 9, scale = 3), colour = &quot;blue&quot;) +
    stat_function(data = data.frame(x = c(5, 30)), fun = function(x) plogis(x, location = 9, scale = 4), colour = &quot;green&quot;)
  </code></pre>
  <p>But the resulting image is the same as the one above.</p>