summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-11-13 12:04:31 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2020-11-13 12:04:31 +0100
commitbd4da93dc6a67a94706771bc6845556ecbe64b9e (patch)
tree3c95b1161e249c1cce1c60eb16aa80fb550164ad /bin
parent6c70f64484673a97b8cf5da63262287d76083e46 (diff)
set filename as plot title
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dlog-viewer4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/dlog-viewer b/bin/dlog-viewer
index dd7f555..1e4750d 100755
--- a/bin/dlog-viewer
+++ b/bin/dlog-viewer
@@ -161,6 +161,7 @@ class DLog:
def __init__(self, filename, skip=None, limit=None):
self.skip_duration = skip
self.limit_duration = limit
+ self.filename = filename
self.load_dlog(filename)
def load_dlog(self, filename):
@@ -392,6 +393,7 @@ def show_power_plot(dlog, changepoints=None):
)
plt.legend(handles=handles)
+ plt.title(dlog.filename)
plt.xlabel("Time [s]")
plt.ylabel("Power [W]")
plt.grid(True)
@@ -438,6 +440,7 @@ def show_unit_plot(dlog, metric, changepoints=None):
)
plt.legend(handles=handles)
+ plt.title(dlog.filename)
plt.xlabel("Time [s]")
if unit == "V":
plt.ylabel("Voltage [V]")
@@ -470,6 +473,7 @@ def show_raw_plot(dlog):
handles.append(handle)
plt.legend(handles=handles)
+ plt.title(dlog.filename)
plt.xlabel("Time [s]")
plt.ylabel("Voltage [V] / Current [A] / Power [W]")
plt.grid(True)