Matplotlib tips =============== True TeX labels --------------- The plotting utilities of matplotlib can use the power of a TeX system if one is installed. We just have to tell matplotlib that it should generate the labels with the help of TeX. We then can use anything that is a valid TeX expression we would otherwise write between the dollar signs in a TeX file. The following code presents a small example showing TeX labels in action. NOTE: you may have issues with the following usetex-options in case that latex is bad configured on MacOS or Windows. .. literalinclude:: TutCodes/tex_labels.py :language: python .. plot:: TutCodes/tex_labels.py Note that we have to use so called raw strings, i.e. strings with the character ``r`` as a prefix. Additionally we use the dollar signs inside the strings for delimiting formulas as usual.