# Using latex in a bar x-axis label

A good stack overflow article shows how to use plotly’s latex support to change the color of the axis labels in a bar chart.

The text for one of my labels is: $\color{blue}{ABC} That text comes out blue, but the latex formats it like an equation, so the font now doesn’t match the rest of the plot. I tried this text: $\color{blue}{\text{ABC}} which fixes the equation formatting in an online latex editor (example in link here), but doesn’t work in plotly. In plotly my label becomes extABC, because apparently \text isn’t supported by plotly and is only interpreting the \t part of that as a command (presumably adding a tab I can’t see to the text).

@davidparks21
With these settings:

fig.update_layout( xaxis_title='$\color{blue}{\\text{ABC}}$', font_family='Open-Sherif')


you’ll get the x title displayed in LaTeX, and a uniform font for both ticklabels and xaxis title.