Answers for "matplotlib change he yticks to two number after digit"

0

matplotlib change he yticks to two number after digit

from matplotlib.ticker import StrMethodFormatter
plt.gca().yaxis.set_major_formatter(StrMethodFormatter('{x:,.0f}')) # No decimal places
plt.gca().yaxis.set_major_formatter(StrMethodFormatter('{x:,.2f}')) # 2 decimal places
Posted by: Guest on March-07-2020

Code answers related to "matplotlib change he yticks to two number after digit"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language