Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #matplotlib #change #yticks #number #digit
ADD COMMENT
Topic
Name
9+8 =