Skip to content
Snippets Groups Projects
Commit 6eb4fede authored by Michael Reuscher's avatar Michael Reuscher
Browse files

New save for Plots update

parent fe9e532c
No related branches found
No related tags found
1 merge request!4Python driver and data analysis part
......@@ -127,8 +127,8 @@ args = parse_arguments()
# Setup all paths and folders
simulation_path = args.sim
data_path = os.path.join(args.data, "output1")
protokoll_path = os.path.join(args.protokoll, "protokoll")
data_path = os.path.join(args.data, "output")
protokoll_path = os.path.join(args.protokoll, "test_data")
stat_path = os.path.join(data_path, "statistics")
os.makedirs(protokoll_path, mode=0o777, exist_ok=True)
os.makedirs(stat_path, mode=0o777, exist_ok=True)
......
......@@ -42,7 +42,7 @@ class SeabornPlotter:
folder = self._make_folder('Various_Events')
x = df['size']
y = df['duration']
title = "Procedure: {}".format(self.name)
title = "Various Procedure: {}".format(self.name)
bins_x, bins_y = self._prepare_bins(df)
f, ax = plt.subplots(figsize=(16, 9))
sns.histplot(x=x, y=y, color="blue", bins=[bins_x, bins_y])
......@@ -57,6 +57,7 @@ class SeabornPlotter:
plt.savefig(os.path.join(folder, f"{title}.svg"))
plt.close()
print(title + "Plot done!")
def plot_histogram_long(self):
df = self.dataframe
......@@ -69,14 +70,16 @@ class SeabornPlotter:
sns.histplot(x=x, y=y, color="blue")
self._add_logo("desy_logo.png", logo_size=0.15, logo_x=1.065, logo_y=1.04)
ax.set_xlabel("Data size [Bytes]")
ax.set_xlabel("Seconds since start")
ax.set_ylabel("Time/Event [s]")
ax.set_yscale('log')
plt.title(title)
plt.grid(True)
plt.xticks(rotation=45)
plt.savefig(os.path.join(folder, f"{title}.svg"))
plt.savefig(os.path.join(folder, f'{title}.svg'))
plt.close()
print(title + " Plot done!")
def plot_statistics(self):
dataframes = self.dataframe
......@@ -84,6 +87,7 @@ class SeabornPlotter:
for df_key, df in dataframes.items():
operations = df['Group'].unique()
num_plots = len(operations)
title = df_key.replace(".dat", "")
rows = 2 # Number of rows in the grid
cols = (num_plots + 1) // rows # Number of columns in the grid
fig, axes = plt.subplots(rows, cols, figsize=(15, 8), constrained_layout=True)
......@@ -103,6 +107,7 @@ class SeabornPlotter:
ax.grid(True)
ax.set_ylim(bottom=global_min_speed, top=global_max_speed) # Set the Y-axis limits
plt.savefig(os.path.join(folder, f"{df_key}.svg"))
plt.savefig(os.path.join(folder, f"{title}.svg"))
plt.close()
print(title + " Plot done!")
......@@ -24,7 +24,7 @@ def main():
s_plotter = SeabornPlotter(s_dataframes, 'statistics', statistics_path)
s_plotter.plot_statistics()
# Plot Data
# Plot Various
for frame in v_dataframes.keys():
if not v_dataframes[frame].empty:
# Setup Plotter
......@@ -33,6 +33,7 @@ def main():
# Plotter run
v_plotter.plot_histogram_various()
# Plot Long
for frame in l_dataframes.keys():
if not v_dataframes[frame].empty:
# Setup Plotter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment