add sign to y axis values python 1

add sign to y axis values python

# For Python 3
# In place of the dollar sign $ put any sign you would need

graph.yaxis.set_major_formatter('${x:1.2f}')

Here is what the above code is Doing:
1. We are setting the major formatter for the y-axis.
2. We are using the ‘${x:1.2f}’ format.
3. The ‘x’ in the format is the value of the tick.
4. The ‘1.2f’ in the format is the number of digits to be displayed after the decimal point.
5. The ‘$’ in the format is the dollar sign.

Similar Posts