Created
October 6, 2020 21:26
-
-
Save OSHI7/e464dd565ca184be3faa23c03d341cb5 to your computer and use it in GitHub Desktop.
SampleGist-1
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
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