0

I want to label my y-axis as $\frac{P}{e^{3N}}$. I just know how to put symbols by using the command; [Phi] as an example. I need a precise command to get the latex math.

Jpmg
  • 75
  • 5
  • 2
    Look at the MaTeX package from Szabolcs. – MarcoB Oct 01 '21 at 13:47
  • I have 9.1 version of Mathematica. – Jpmg Oct 01 '21 at 13:54
  • @MarcoB MaTeX requires Mathematica 10.0.2 or later. Actually, there is no 9.1 version, only 9.0.1. – Szabolcs Oct 01 '21 at 14:30
  • @Jpmg Please clarify what you mean by "Latex mathematics". LaTeX is not necessary to typeset formulae in Mathematica. See http://reference.wolfram.com/language/tutorial/TwoDimensionalExpressionInputOverview.html – Szabolcs Oct 01 '21 at 14:31
  • @MarcoB I made use of associations for caching results, and they were added only in 10.0 (back in 2014 or so...) – Szabolcs Oct 01 '21 at 14:32
  • I want to use the math mode of Latex in labeling the axes of my plots. As I mentioned above, I need to write $\frac{P}{e^{3*N}}$ on the y-axis. I have already seen the possible documentation and answers. If I missed one, please point that out here as well. – Jpmg Oct 01 '21 at 14:36

1 Answers1

2

As mentioned in comments, you can already typeset your labels within Mathematica. For instance:

Plot[
 Sin[x], {x, 0, 10},
 Frame -> {{True, False}, {True, False}}, 
 Axes -> False, 
 FrameLabel -> 
  {"", 
   Rotate[
    Style[
     "\!\(\*FractionBox[\(P\), SuperscriptBox[\(e\), \(3  N\)]]\)", 
     Black, 18, FontFamily -> "Times"
    ],
    -90*Degree
   ]
  }
]

simple plot with label

The rather inscrutable portion of the above code ("\!\(\*FractionBox[\(P\), SuperscriptBox[\(e\), \(3 N\)]]\)") was not generated by hand, but instead it was typed in with formatting:

picture of the code that generated the plot above, showing the formatted label as it appears in the notebook

See also this Tutorial on input methods for two-dimensional expressions.

MarcoB
  • 67,153
  • 18
  • 91
  • 189