title: Adding label to secondary axis in R
body: <p>I have this code:</p>
  <pre><code># Plotting everything
  plot( p1, col= &quot;lightgreen&quot;, xlim=c(-2.5,4.5), ylim=c(0, 700), main=&quot;Daily Total Precipitation for AR and Oct-May&quot;, xlab=&quot;ln(x)&quot; , ylab=&quot;Frequency&quot;, xaxt = &quot;n&quot;)  # first histogram
  plot( p2, col=&quot;red&quot;, xlim=c(-2.5,4.5), ylim=c(0, 700), xaxt = &quot;n&quot; , add=T)
  # Adding in text labels on top of the bars
  text(x, y, paste(round(percents,2),&quot;%&quot;), cex=0.50, pos=3, offset=0.3, col=&quot;black&quot;)
  axis(side=1, at=breaks)     # new x-axis
  # parameter that needs to be set to add a new graph on top of the other ones
  par(new=T)
  plot(x, percents, xlim=c(-2.5,4.5), type=&quot;l&quot;, col=&quot;yellow&quot;, lwd=3.0, axes=F, ylab=NA, xlab=NA)
  axis(side=4, at=seq(0,100,by=10), col=&quot;yellow&quot;, col.axis=&quot;yellow&quot;)     # additional y-axis
  mtext(&quot;Percent&quot;, side=4, col=&quot;yellow&quot;)
  # legend settings
  legend(&quot;topleft&quot;, c(&quot;AR&quot;, &quot;Oct-May&quot;), lwd=10, col=c(&quot;red&quot;, &quot;lightgreen&quot;))
  </code></pre>
  <p>Which produces this graph:</p>
  <p><img src="https://i.stack.imgur.com/i0RUb.png" alt="enter image description here" /></p>
  <p>And I can't seem to figure out how to get the secondary y-axis label to show up in the correct position.  Any help or suggestions is greatly appreciated.</p>
  <p>Edit:  Using RStudio.</p>