Label dates every 3 months instead of every month

This commit is contained in:
Tony S Yu
2013-10-12 10:17:55 -05:00
parent 98dcc736e1
commit e93e865198
+1 -1
View File
@@ -121,7 +121,7 @@ fig, ax = plt.subplots(figsize=(7, 5))
n, bins, _ = ax.hist(dates_f, bins=bins, color='blue', alpha=0.6)
ax.xaxis.set_major_formatter(FuncFormatter(date_formatter))
ax.set_xticks(bins[:-1])
ax.set_xticks(bins[2:-1:3]) # Date label every 3 months.
labels = ax.get_xticklabels()
for l in labels: