- matplotlib

Datavisualization with Python using pyscript

print("Weight visualization of two persons with matplotlib")
import matplotlib.pyplot as plt fig, ax = plt.subplots() year_1 = [2016, 2017, 2018, 2019, 2020, 2021] weight_1 = [70, 72, 74, 76, 78, 80] year_2 = [2016, 2017, 2018, 2019, 2020, 2021] weight_2 = [80, 82, 80, 80, 75, 72] plt.plot(year_1, weight_1, marker='o', linestyle='--', color='g', label='Person 1') plt.plot(year_2, weight_2, marker='d', linestyle='-', color='r', label='Person 2') plt.xlabel('Year') plt.ylabel('Weight (kg)') plt.title('Year vs Weight') plt.legend(loc='lower right') fig # if you're reading this... How cool is this? /Niklas N