Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python set xticks to int not float

import matplotlib.ticker as tkr 
#define how we want to change scale
def numfmt(x, pos):
    s = int(x)
    return s
  
yfmt = tkr.FuncFormatter(numfmt)

ax.yaxis.set_major_formatter(yfmt)
 
PREVIOUS NEXT
Tagged: #python #set #xticks #int #float
ADD COMMENT
Topic
Name
9+1 =