From 965dd3066505fdf7b568cd6ff86839a76c586b98 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 6 May 2024 15:19:12 +0200 Subject: [PATCH] Added proper color gradient to position plot --- bettwaage-plotter/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bettwaage-plotter/main.py b/bettwaage-plotter/main.py index 9ca68cb..afc76e8 100644 --- a/bettwaage-plotter/main.py +++ b/bettwaage-plotter/main.py @@ -115,6 +115,7 @@ ax0.legend( # Experiment: Plot position import math +import colorsys segments = 100 seg_length = math.ceil(len(position_over_time) / segments) @@ -125,7 +126,7 @@ for i in range(0, segments): ax1.plot( horizontal[low:high], vertical[low:high], - color=(0.0, 0.5, i / segments), + color=colorsys.hsv_to_rgb(i / segments * 0.5, 1, 0.7), linewidth=0.3, ) ax1.set_xlim((0, bed_size[0]))