How_To_Linux_Solutions/day_5/h_t.py
2022-08-29 22:35:46 +02:00

26 lines
597 B
Python
Executable file

#!/usr/bin/env python3
import subprocess
import matplotlib.pyplot as plt
# Run the command and get the standard output
h_t = subprocess.run(
"curl -Ls https://gitlab.rlp.net/mobitar/julia_course/-/raw/main/Day_3/resources/fitting_task_data.csv | tail -n +6 | head -n -2 | cut -d ',' -f 1,3",
shell=True,
capture_output=True,
text=True,
).stdout
h_values = []
t_values = []
for line in h_t.strip().split("\n"):
h, t = line.strip().split(",")
h_values.append(h)
t_values.append(t)
plt.plot(h_values, t_values)
plt.xlabel("h")
plt.ylabel("t")
plt.savefig("h_t.pdf")