I am trying to convert the log scale in my visuals using the below code. However it is not happening? Any suggestions?
For Example the actual values of 'Population_2011' column are:
states['Population_2011'].head()
State/ UT
State 199581477
State 112372972
State 103804630
State 91347736
State 72597565
Name: Population_2011, dtype: int64
fig, ax = plt.subplots()
for axis in [ax.xaxis, ax.yaxis]:
axis.set_major_formatter(ScalarFormatter())
ax.bar(states['Name'], states['Population_2011'])
ax.set_ylabel("Population")
ax.set_title('Poulation of States')
ax.set_xticklabels(states.Name, rotation = 90)
plt.show()
for axis in [ax.xaxis, ax.yaxis]:
axis.set_major_formatter(ScalarFormatter())
df2.plot(kind='hist', subplots=True, density=True, bins=36)
plt.title('India population distribution (2011)')
plt.show()