Skip to content

Instantly share code, notes, and snippets.

@stefan789
Last active September 11, 2015 09:02
Show Gist options
  • Save stefan789/464f04a2ffd754b70e29 to your computer and use it in GitHub Desktop.
Save stefan789/464f04a2ffd754b70e29 to your computer and use it in GitHub Desktop.
Plot db data with timezones
fig, ax = plt.subplots()
fig.set_size_inches(8,6)
fmt = mdates.DateFormatter("%H:%M", tz=berlin)
ax.xaxis.set_major_formatter(fmt)
ax.plot_date([i.astimezone(berlin) for i in data["Date"]], data["Bz1"], "-", label="y1")
fig.autofmt_xdate()
#ax.set_xlim([dt.datetime(2015,8,7,17,0,0), dt.datetime(2015,8,7,19,0,0)])
#ax.set_ylim([-30,40])
plt.legend(loc='center right',
bbox_to_anchor=(1.16,0.5))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment