Matplotlib Latex TextfarbePython

Python-Programme
Anonymous
 Matplotlib Latex Textfarbe

Post by Anonymous »

Ich möchte teilweise einen Latex -Text in meinem Plot unter Verwendung des Befehls \ textColor {} < /code> färben.import matplotlib
matplotlib.use('TKAgg')

from matplotlib import rc
rc('text',usetex=True)
rc('text.latex', preamble=r'\usepackage{color}')
import matplotlib.pyplot as plt

if __name__ == "__main__":
fig = plt.figure()
fig.text(0.5, 0.5, r'black \textcolor{red}{red}')
plt.show()
< /code>
Ändern des Backends in PC, wie es hier getan wird>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post