aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2022-05-20 11:10:34 +0200
committerThéo de la Hogue2022-05-20 11:10:34 +0200
commit10e643fab14ee77d86ae7d228eef17092ce8d337 (patch)
treeba1f9600dafaf0f33ce21da3ca355e8f72b6f63d /src
parent145219241449badc2f0da6449b717255e2dd70b2 (diff)
downloadargaze-10e643fab14ee77d86ae7d228eef17092ce8d337.zip
argaze-10e643fab14ee77d86ae7d228eef17092ce8d337.tar.gz
argaze-10e643fab14ee77d86ae7d228eef17092ce8d337.tar.bz2
argaze-10e643fab14ee77d86ae7d228eef17092ce8d337.tar.xz
Adding a pandas dataframe plotting function.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/utils/MiscFeatures.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/argaze/utils/MiscFeatures.py b/src/argaze/utils/MiscFeatures.py
index 56a77bb..ba0b1b6 100644
--- a/src/argaze/utils/MiscFeatures.py
+++ b/src/argaze/utils/MiscFeatures.py
@@ -1,5 +1,8 @@
#!/usr/bin/env python
+import matplotlib.pyplot as mpyplot
+import matplotlib.patches as mpatches
+
# Print iterations progress
def printProgressBar (iteration:int, total:int, prefix:str = '', suffix:str = '', decimals:int = 1, length:int = 100, fill:str = '█', printEnd:str = "\r"):
"""Print iterations progress.
@@ -22,6 +25,14 @@ def printProgressBar (iteration:int, total:int, prefix:str = '', suffix:str = ''
if iteration == total:
print()
+# Plot timestamped dataframe as stem
+def plotTimestampedDataframe(df, name: str, color='#000000'):
+
+ markerline, stemlines, baseline = mpyplot.stem(df.index, df[name])
+ mpyplot.setp(markerline, color=color, linewidth=1, markersize = 1)
+ mpyplot.setp(stemlines, color=color, linewidth=1)
+ mpyplot.setp(baseline, color=color, linewidth=1)
+
# Handle exit event
class ExitSignalHandler():