title: plotting custom confidence intervals around curve fits R
body: <p>Say I have some relationships between <code>x</code> and some outcome variable, for three different groups, <code>A</code>,<code>B</code> and <code>C</code>:</p>
  
  <pre><code>x&lt;-c(0:470)/1000
  #3 groups, each has a different v-max parameter value.
  v.A&lt;-5
  v.B&lt;-4
  v.C&lt;-3
  C&lt;- (v.C*x)/(0.02+x)
  B&lt;- (v.B*x)/(0.02+x)
  A&lt;-(v.A*x)/(0.02+x)
  d.curve&lt;-data.frame(x,A,B,C)
  </code></pre>
  
  <p>The estimates of the <code>v.</code> parameter also have associated errors:</p>
  
  <pre><code>err.A&lt;-0.24
  err.B&lt;-0.22
  err.C&lt;-0.29
  </code></pre>
  
  <p>I'd like to plot these curve fits, as well as shaded error regions around each curve, based on the uncertainty in the <code>v.</code> parameter. So, the shaded region would be +/- one error value. I can generate the plot of the 3 curves easily enough:</p>
  
  <pre><code>limx&lt;-c(0,0.47)
  limy&lt;-c(0,5.5)
  
  plot(A~x,data=d.curve,xlim=limx,ylim=limy,col=NA)
  lines(smooth.spline(d.curve$x,d.curve$A),col='black',lwd=3)
  par(new=T)
  plot(B~x,data=d.curve,xlim=limx,ylim=limy,col=NA,ylab=NA,xlab=NA,axes=F)
  lines(smooth.spline(d.curve$x,d.curve$B),col='black',lwd=3,lty=2)
  par(new=T)
  plot(C~x,data=d.curve,xlim=limx,ylim=limy,col=NA,ylab=NA,xlab=NA,axes=F)
  lines(smooth.spline(d.curve$x,d.curve$C),col='black',lwd=3,lty=3)
  </code></pre>
  
  <p>But how can I added custom shaded regions around them, based on specified error terms?</p>
  
  <p><a href="https://i.stack.imgur.com/JDKe7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JDKe7.jpg" alt="enter image description here"></a></p>