Added proper color gradient to position plot

This commit is contained in:
Maximilian Giller 2024-05-06 15:19:12 +02:00
parent 9004125dd5
commit 965dd30665

View file

@ -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]))