Search code examples
python-3.xmatplotlibplotgraphmatlab-figure

Adding units in axis


Is there a library in python to include symbols in graphs using matplotlib? I want my y-axis to represent Velocity in micrometer per second, which should have y-axis as V (µm/s). I am not able to insert in my code "micro" symbol. Currently I am plotting as V(um/s).

plt.ylabel('V (um/s)', fontsize = 10)

Solution

  • Try

    plt.ylabel('V (\u03BCm/s)')
    

    Output:

    enter image description here