summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/korad-logger13
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/korad-logger b/bin/korad-logger
index e9d97f5..71e2965 100755
--- a/bin/korad-logger
+++ b/bin/korad-logger
@@ -52,6 +52,8 @@ import time
terminate_measurement = False
+matplotlib_theme = "fast"
+
def running_mean(x: np.ndarray, N: int) -> np.ndarray:
"""
@@ -308,7 +310,7 @@ def measure_data(
if live_view:
import matplotlib.pyplot as plt
- plt.style.use("dark_background")
+ plt.style.use(matplotlib_theme)
timestamps = list()
voltages = list()
@@ -427,6 +429,8 @@ def measure_data(
def plot_data(data, mode):
import matplotlib.pyplot as plt
+ plt.style.use(matplotlib_theme)
+
if mode == "U":
(datahandle,) = plt.plot(data[:, 0], data[:, 1], "b-", label="U", markersize=1)
(meanhandle,) = plt.plot(
@@ -651,6 +655,9 @@ def main():
help="Plot voltage / current / power over time or voltage vs current / current vs voltage",
)
parser.add_argument(
+ "--dark-mode", action="store_true", help="Show plots on a dark background"
+ )
+ parser.add_argument(
"duration", type=int, nargs="?", help="Measurement duration in seconds"
)
@@ -660,6 +667,10 @@ def main():
print("Either --load or duration must be specified", file=sys.stderr)
sys.exit(1)
+ if args.dark_mode:
+ global matplotlib_theme
+ matplotlib_theme = "dark_background"
+
current_range = parse_range(args.current_range)
voltage_range = parse_range(args.voltage_range)