From 1b4a8bcd57b250fb8cc8944910a086af046423f9 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Thu, 5 Dec 2024 11:08:42 +0100 Subject: [PATCH] added plot title --- luftwiderstand.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/luftwiderstand.py b/luftwiderstand.py index 40347eb..8638a14 100644 --- a/luftwiderstand.py +++ b/luftwiderstand.py @@ -63,14 +63,13 @@ def fd(rho: float, velocity_kmh: float, c_val: float, area: float): return res -plot.figure() - # Fd vs. velocity, param: temperature temps_list = [-20, -10, 0, 10, 20, 30] vel_list = [20, 40, 60, 80, 100, 120, 130, 140, 160] reference = fd(rho(20), 100, c_val_id3, area_id3) temps_list_leg = [f"{t}°C" for t in temps_list] +plot.figure() for temp_degc in temps_list: rho_t = rho(temp_degc) y_fd = [] @@ -80,13 +79,12 @@ for temp_degc in temps_list: plot.plot(vel_list, y_fd) -plot.ylabel("Wind-Widerstand [%]") +plot.title("Windwiderstand vs Geschwindigkeit") +plot.ylabel("Windwiderstand [%]") plot.xlabel("Geschwindigkeit [km/h]") plot.legend(temps_list_leg) plot.grid() -plot.figure() - # Fd vs. velocity, param: car temp = 20 vel_list = [20, 40, 60, 80, 100, 120, 130, 140, 160] @@ -95,6 +93,7 @@ car_list_leg = [f"{t['car']}" for t in car_list] rho_t = rho(temp) reference = fd(rho_t, 100, c_val_id3, area_id3) +plot.figure() for car in car_list: y_fd = [] for vel_kmh in vel_list: @@ -103,8 +102,9 @@ for car in car_list: plot.plot(vel_list, y_fd) -plot.ylabel("Wind-Widerstand [%]") +plot.ylabel("Windwiderstand [%]") plot.xlabel("Geschwindigkeit [km/h]") +plot.title("Windwiderstand vs Geschwindigkeit") plot.legend(car_list_leg) plot.grid() plot.show() \ No newline at end of file