title: Using expression(paste( to insert math notation into a legend
body: <p>I wish to substitute the following (yes, I've written it here in TeX format, just to be clear)<br>
  <code>$P_{M1}(\tilde{z}&gt;z) - P_{M0}(\tilde{z}&gt;z)$</code><br>
  for the green line's legend entry (cptsdtbehavioralm), and<br>
  <code>$P_{M2}(\tilde{z}&gt;z) - P_{M0}(\tilde{z}&gt;z)$</code><br>
  for the blue line's legend entry (fullbehavioralmodel). </p>
  
  <p>Here is the code with which I generated the plot (I am omitting the 10,000-observation dataset and the transforms to generate the functions Fm0, Fm1 and Fm2): </p>
  
  <pre><code>bmp("bias_plot_v4.bmp", width=540, pointsize=10)
  ggplot(data.frame(x=c(0,80)),aes(x) ) +
     stat_function(fun=function(x)((1-Fm1(x)) - (1- Fm0(x))), geom="line", 
  aes(colour="cptsdtbehavioralm"), n=1000) +
     stat_function(fun=function(x)((1-Fm2(x)) - (1- Fm0(x))), geom="line", 
  aes(colour="fullbehavioralmodel"), n=1000) +
   theme_bw() +
     ylab("Probability") +
   xlab(expression(paste("Security breaches per 3-week spear-phishing campaign ", 
  italic( (z) )))) +  
   theme(aspect.ratio=.618) + 
     theme(legend.position=c(0.845,0.8)) +
     theme(legend.key = element_blank()) +
     scale_color_manual(values = c("cptsdtbehavioralm"="green2", 
  "fullbehavioralmodel" = "blue"), name="Bias")
  dev.off()
  </code></pre>
  
  <p>Whenever I try to replace the "cptsdtbehavioralm" and "fullbehavioralmodel" with a math expression -- e.g. to keep it simple, <code>expression(P[{M1}])</code> -- I get the following type of errors:</p>
  
  <pre><code>Error: unexpected '=' in:
  "       theme(legend.key = element_blank()) +
     scale_color_manual(values = c(expression(P[{M1}]))="
  </code></pre>
  
  <p>I'm at my wit's end -- any insight or suggestions would be very, very welcome. </p>