Search code examples
pythontextmatplotlibnotation

How do I get python to display xbar? A line over the letter x


I've been looking at math notation and different packages but have yet to find anything that lets me print xbar (the average x).

I am hoping to use xbar as a label in matplotlib.

Any suggestions?

Thank you. Cheers


Solution

  • If you want to use x bar as a label in matplotlib, you can do it like this:

    plt.ylabel(r'$\bar{x}$')