0

In Jupyter notebook I have labelled plots with latex symbols using the code:

plt.xlabel(r'Probe Bias $(V_p)$')

This works to let me include latex symbols in my x label. However when I try to do the same thing in a print statement:

print(r'$T_c$ = %.3f' %(tc))

The output is simply "$T_c$ = 3.467" with no latex formatting. How can I get latex formatting similar to my xlabel in a string when I also want to print the value of a variable tc?

niallygee
  • 19
  • 3
  • you can't use print, you need notebook specific syntax (see linked duplicate) – mozway Feb 08 '22 at 15:42
  • And for anyone not aware, the reason this question about Jupyter is getting sent to coverage under an answer concerning 'IPython notebook' is that IPython notebook was the immediate precursor of Jupyter development. The ability to use LaTeX and MathJax was already present and mature in IPython notebooks. So for fundamental issues like this, sometimes you may want to research answers concerning IPython notebooks and not simply Jupyter. – Wayne Feb 08 '22 at 17:13

0 Answers0