aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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():