How do I get the x-axis values of [a, b, c] to show up?
import pandas as pd import matplotlib.pyplot as plt s = pd.Series([1, 2, 10], index=['a', 'b', 'c']) s.plot() plt.show()
You can get your xtick labels to show using plt.xticks:
plt.xticks
import pandas as pd import matplotlib.pyplot as plt s = pd.Series([1, 2, 10], index=['a', 'b', 'c']) s.plot() plt.xticks(np.arange(len(s.index)), s.index) plt.show()
Output:
2.1m questions
2.1m answers
60 comments
57.0k users