I believe that the problem here may be in latex mode. Your command \textis the Latex command present in amsmath to set the text as such in the equations. He does not give any flowers.
Without trying it myself in Python, I would suggest you try loading xcolor into Latex:
plt.rcParams['text.latex.preamble']=[r"\usepackage{xcolor}"]
xcolors '\color -command:
plt.xlabel(r'$x=\frac{ \color{red}{red text} }{ \color{blue}{blue text} }$')
, Python, , \text :
plt.xlabel(r'$x=\frac{ \text{\color{red}{red text}} }{ \text{\color{blue}{blue text}} }$')
, .
, !