I need to write infidelity number $\bar{F}=6.82\times 10^{-6}$ inside a plot. I tried using Epilog with TeXForm but could not succeed. It prints $\frac{1}{10^6}$ instead of $10^{-6}$. Any help? Thanks.
3 Answers
$\begingroup$
$\endgroup$
To expand on the other answers, using Inset and MaTeX
<< MaTeX`
LaTeXStuff = MaTeX["\\bar F = 6.45\\times 10^{-6}"];
Plot[Sin[x], {x, 0, 2 Pi}, Epilog -> Inset[LaTeXStuff, {4, .5}]]
$\begingroup$
$\endgroup$
You can use Inset like this:
f = 6.82*^-6;
inset = Inset[
Style[StringForm["F = ``", ScientificForm[f]], 14],
Scaled[{.65, .75}], Scaled[{.5, .5}], Scaled[.3]
];
Plot[Sin[x], {x, 0, 2 Pi}, Epilog -> inset]
Kind regards,
David
$\begingroup$
$\endgroup$
Method 1:
- Type in a string such as
"x". - Select the
xonly. Convert to TraditionalForm (on macOS, Command-Shift-T) - Press Left-Arrow, then delete the x and start typing: F Ctrl-7 _ Right-Arrow 6.82 Esc * Esc 10 Ctrl-6 -6 Right-Arrow
Method 2:
TraditionalForm@HoldForm[OverBar[F] == 6.45*^-6]
Method 3:
Use MaTeX.
<< MaTeX`
MaTeX["\\bar F = 6.45\\times 10^{-6}"]


TeXForm, but what you want can be done as simple as:Plot[Sin[x],{x,0,1}, Epilog -> Text[Row[{OverBar[F], "\[ThinSpace]=\[ThinSpace]", 6.82/10^6}],{0.5,0.5}]]. $\endgroup$\times, but not $\times$. It is unclear what you mean. Do you want to display TeX code? TeXForm produces TeX code. Or do you want to display formatted math? I wrote my answer with the latter in mind, assuming that your question is about how to format the result, not about how to useEpilogorText. $\endgroup$