Created
August 15, 2015 04:34
-
-
Save dhhagan/38ec70cef573881b3f2a to your computer and use it in GitHub Desktop.
Make pretty x-axis labels for Time series data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fig, ax = plt.subplots(1, 1) | |
| with sns.axes_style('white'): | |
| ax.plot(final.index, final['AFE1_X2-01_degC'], label = 'T RTD-X2-01') | |
| ax.plot(final.index, final['AFE2_X2-01_degC'], label = 'T RTD-X2-01b') | |
| ax.plot(final.index, final['AFE1_X2-02_degC'], label = 'T RTD-X2-02') | |
| ax.plot(final.index, final['AFE2_X2-02_degC'], label = 'T RTD-X2-02b') | |
| ax.set_title("X2-Series RTD Intercomparison") | |
| ax.set_xlabel("Local Time (EST)") | |
| ax.set_ylabel("T degC") | |
| ax.legend(loc = 'best') | |
| ax.xaxis.set_minor_locator(dates.HourLocator(interval = 4)) | |
| ax.xaxis.set_minor_formatter(dates.DateFormatter('%H:%M')) | |
| ax.xaxis.set_major_locator(dates.WeekdayLocator(byweekday=(1), interval=1)) | |
| ax.xaxis.set_major_formatter(dates.DateFormatter('\n%d-%b\n%Y')) | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment