overlapping xtick labels pyplot

Solutions on MaxInterview for overlapping xtick labels pyplot by the best coders in the world

showing results for - "overlapping xtick labels pyplot"
Angela
04 May 2017
1for i, d in enumerate([360, 30, 7, 1]):
2    ax = axes.flatten()[i]
3    earlycut = now - relativedelta(days=d)
4    data = df.loc[df.index>=earlycut, :]
5    ax.plot(data.index, data['value'])
6
7    ax.get_xaxis().set_minor_locator(mpl.ticker.AutoMinorLocator())
8    ax.get_yaxis().set_minor_locator(mpl.ticker.AutoMinorLocator())
9
10    ax.grid(b=True, which='major', color='w', linewidth=1.5)
11    ax.grid(b=True, which='minor', color='w', linewidth=0.75)
12
13    plt.setp(ax.get_xticklabels(), rotation=30, horizontalalignment='right')
14
15fig.tight_layout()
16