diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2023-06-08 15:43:29 +0100 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2023-06-08 15:43:29 +0100 |
commit | ef1a59c429646f68149ad2ca0bb29b8f34ceffc1 (patch) | |
tree | 555878374573c4d6b86b9fa7aae4ddab88b750dd | |
parent | 34aa84a8b01ede09a2e483a6db1201595c86ec96 (diff) | |
download | SmallYTChannelBot-ef1a59c429646f68149ad2ca0bb29b8f34ceffc1.tar.gz SmallYTChannelBot-ef1a59c429646f68149ad2ca0bb29b8f34ceffc1.zip |
fixed plotter
-rwxr-xr-x | api_plotter.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/api_plotter.py b/api_plotter.py index 83d4f08..ba197e2 100755 --- a/api_plotter.py +++ b/api_plotter.py @@ -32,7 +32,9 @@ for timestamp in timestamps: except KeyError: d[nearest] = 1 +d_sorted = {k: v for k, v in sorted(d.items(), key=lambda x: x[0])} + fig, ax = plt.subplots() -ax.plot(list(d.keys()), list(d.values())) +ax.plot(list(d_sorted.keys()), list(d_sorted.values())) plt.show()
\ No newline at end of file |