I can't figure out how to change the format of these x-labels. Ideally, I'd like to call strftime('%Y-%m-%d')
on them. I've tried things like set_major_formatter
but was unsuccessful.
import pandas as pd
import numpy as np
date_range = pd.date_range('2014-01-01', '2015-01-01', freq='MS')
df = pd.DataFrame({'foo': np.random.randint(0, 10, len(date_range))}, index=date_range)
ax = df.plot(kind='bar')
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…