Skip to content Skip to sidebar Skip to footer

Unable To Change The Tick Frequency On My Chart

I have seen many questions on changing the tick frequency on SO, and that did help when I am building a line chart, but I have been struggling when its a bar chart. So below are my

Solution 1:

Using Pandas plot function you can do:

import numpy as np
import pandas as pd

df = pd.DataFrame(np.random.randint(1,10,(90,1)),columns=['Values'])
df.plot(kind='bar', xticks=np.arange(0,90,5))

Or better:

df.plot(kind='bar', xticks=list(df.index[0::5]))

Post a Comment for "Unable To Change The Tick Frequency On My Chart"