2
$\begingroup$

I'm trying to label a plot as follows:

Plot[{Re[kai4] /. sol, Im[kai4] /. sol}, {z, 0, 2}, Frame -> True, 
 FrameStyle -> BlackFrame, PlotRange -> All, 
 PlotLabel -> "Numerical Solution" MaTeX@"\chi_4", 
 PlotStyle -> {{Black}, {Black, Dashed}},
 BaseStyle -> {FontFamily -> "Latin Modern Roman"},
 FrameLabel -> MaTeX@{"x_3", "\chi_4"}, 
 PlotLegends -> Placed[MaTeX@{"Re", "Im"}, Below]]

and I have the problem that the MaTeX part of PlotLabel appears at the start. How do I fix this? I want it to appear in the order I typed it.

enter image description here

$\endgroup$
4
  • 1
    $\begingroup$ try PlotLabel -> Row[{ "Numerical Solution", MaTeX@"\chi_4" }]? $\endgroup$
    – kglr
    Commented May 31, 2019 at 12:36
  • $\begingroup$ Yes it worked. Thank you. Submit as answer and I will accept it. $\endgroup$ Commented May 31, 2019 at 12:38
  • $\begingroup$ Or just MaTeX["\\text{Numerical Solution $\\chi_4$}"] $\endgroup$
    – Szabolcs
    Commented May 31, 2019 at 12:58
  • 1
    $\begingroup$ You should know that the code you wrote is invalid (and only works because an accident and Mathematica's sloppiness about error reporting). "\chi" is not valid. You must write "\\chi" $\endgroup$
    – Szabolcs
    Commented May 31, 2019 at 17:40

1 Answer 1

3
$\begingroup$

Use

PlotLabel -> Row[{"Numerical Solution", MaTeX@"\\chi_4" }]

to prevent re-ordering of the two expressions in the label.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.