LaTeX command in a R plot
<p>I have problems in writing down some LaTeX expressions in the graph in Rstudio, i already did it using </p>

<p><code>axis(..., label=TeX("x_{min}")</code></p>

<p>The problem arises when I try to put the command <code>\mathcal{M}</code> in that label. Any way to have the M that LaTeX produces with that command in an R plot using <code>axis</code> or <code>mtext</code>? I'd rather use <code>mtext</code> but using it, it doesn't even produce the <code>x_{min}</code> i produced using axis like i wrote before.</p>

<p>Thank you in advance for any help</p>

<p>EDIT: as requested i put here an example of my code</p>

<pre><code>library(latex2exp)
b=7/5
fx &lt;- function (x,b) x^(4*(b-1)/(b+1)) *(1/(b-1)+1/x)
fmin &lt;- optimize(fx, interval=c(0,2), b=7/5)

x &lt;- seq(10^(-4),20, by = 0.01)

y &lt;- fx(x,b)


 plot(x, y, log="xy", ann="FALSE", pch=20, type="l",lwd=2, xlim=c(10^(-3),10), ylim=c(1.5,40), 
 xaxt="n", yaxt="n")

mtext("x", side=1, line=2, cex=1, col="black")
mtext("f(x)", side=2, line=2, cex=1, col="black")

#assex
  axis(1,at=fmin[1], label=TeX("x_{min}"))
  axis(1,at=0.001, label=0.001)
</code></pre>

<p>And other axis lines, I think this code should run. it produces something like the image below, where the blu lines are obviously part of the code i didn't paste here</p>

<p><a href="https://i.stack.imgur.com/kUJRz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kUJRz.png" alt="Plot with that code"></a></p>