I am using pandas and matplotlib and I am trying to set the label on x axis by the index in Series of panda
import pandas as pd
import matplotlib.pyplot as plt
index = ['apples','oranges','cherries','bananas']
quantity = [20,30,40,50]
s = pd.Series(quantity, index = index)
s.plot()
plt.title("pandas series")
plt.show()
and it displays the output without the label on the x axis, I need fruits name as label on X-axis. Can anyone please help me to resolve this error?
Thanks in advance !