Skip to content

Instantly share code, notes, and snippets.

@OSHI7
Created October 6, 2020 21:26
Show Gist options
  • Save OSHI7/e464dd565ca184be3faa23c03d341cb5 to your computer and use it in GitHub Desktop.
Save OSHI7/e464dd565ca184be3faa23c03d341cb5 to your computer and use it in GitHub Desktop.
SampleGist-1
a=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(a)
time=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
x=['2017-07-27 11:38:53', '2017-07-27 11:39:00','2017-07-27 11:39:08', '2017-07-27 11:40:02']
x=['2017-07-27 11:38:53', '2017-07-27 11:39:00','2017-07-27 11:39:08', '2017-07-27 11:40:02']
y=[0, 1, 1, 0]
x2 = [datetime.strptime(elem, '%Y-%m-%d %H:%M:%S') for elem in x]
dates=matplotlib.dates.date2num(x2)
plt.plot_date(dates, y)
(fig, ax) = plt.subplots(1, 1)
ax.plot(x, y)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment