added plot generator to project

This commit is contained in:
janis
2022-05-23 13:56:08 +02:00
parent 65d2694ba9
commit f14957ec65

View File

@@ -1,12 +1,12 @@
"""This Program is CLI only!""" """This Program is CLI only!"""
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np
import csv import csv
import os import os
path = input("Path to csv-file to be plotted: ") path = input("Path to csv-file to be plotted: ")
date = input("Date & time at which the measurement was taken (approx.): ") date = input("Date & time at which the measurement was taken (approx.): ")
group = input("Group-name: ")
saveit = input("Should the graph be saved? (y/n) ").lower() saveit = input("Should the graph be saved? (y/n) ").lower()
imp = open(path, "r") imp = open(path, "r")
@@ -41,7 +41,7 @@ if saveit == "y":
except FileExistsError: except FileExistsError:
pass pass
plt.savefig(save_path) plt.savefig(save_path)
os.rename(f"{save_path}/.png", f"{save_path}/GC-{date}.png") os.rename(f"{save_path}/.png", f"{save_path}/GC-{date}-{group}.png")
print(f"saved images to {save_path}") print(f"saved images to {save_path}")
else: else:
print("didn't save images") print("didn't save images")