aboutsummaryrefslogtreecommitdiffstats
path: root/api_plotter.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-06-08 15:43:29 +0100
committerjwansek <eddie.atten.ea29@gmail.com>2023-06-08 15:43:29 +0100
commitef1a59c429646f68149ad2ca0bb29b8f34ceffc1 (patch)
tree555878374573c4d6b86b9fa7aae4ddab88b750dd /api_plotter.py
parent34aa84a8b01ede09a2e483a6db1201595c86ec96 (diff)
downloadSmallYTChannelBot-ef1a59c429646f68149ad2ca0bb29b8f34ceffc1.tar.gz
SmallYTChannelBot-ef1a59c429646f68149ad2ca0bb29b8f34ceffc1.zip
fixed plotter
Diffstat (limited to 'api_plotter.py')
-rwxr-xr-xapi_plotter.py4
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