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$
  • 1
    $\begingroup$ try PlotLabel -> Row[{ "Numerical Solution", MaTeX@"\chi_4" }]? $\endgroup$ – kglr May 31 at 12:36
  • $\begingroup$ Yes it worked. Thank you. Submit as answer and I will accept it. $\endgroup$ – rodger_kicks May 31 at 12:38
  • $\begingroup$ Or just MaTeX["\\text{Numerical Solution $\\chi_4$}"] $\endgroup$ – Szabolcs May 31 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 May 31 at 17:40
2
$\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, privacy policy and cookie policy

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