Skip to content
Snippets Groups Projects
Commit dd98507e authored by Klaus Rabbertz's avatar Klaus Rabbertz
Browse files

Fix runtime plot for ALL channel

parent d61efcc9
Branches
Tags
No related merge requests found
...@@ -260,7 +260,10 @@ def plot_elapsed_time(infodict, out_path, out_name, formats): ...@@ -260,7 +260,10 @@ def plot_elapsed_time(infodict, out_path, out_name, formats):
# plot histogram # plot histogram
if len(unique_channels) == 1: if len(unique_channels) > 1 or unique_channels[0] == 'ALL':
n, batches, _ = ax.hist(times, bins=20, color='deepskyblue', edgecolor='black', label='Total CPU time: {0:0.0f} hours'.format(CPUtime))
ax.legend(loc='best', fontsize=20)
else:
plt.text plt.text
# plot each unique number in different color # plot each unique number in different color
for ev_num in set(events): for ev_num in set(events):
...@@ -270,12 +273,7 @@ def plot_elapsed_time(infodict, out_path, out_name, formats): ...@@ -270,12 +273,7 @@ def plot_elapsed_time(infodict, out_path, out_name, formats):
ax.vlines(mean, 0, max(n), colors='red', linestyles='dashed', label=r'Mean: {0:0.1f}$\pm${1:0.1f}'.format(mean, std)) ax.vlines(mean, 0, max(n), colors='red', linestyles='dashed', label=r'Mean: {0:0.1f}$\pm${1:0.1f}'.format(mean, std))
ax.vlines(median, 0, max(n), colors='green', linestyles='dashdot', label=r'Median: {0:0.2f}$\pm${1:0.2f}'.format(median, iqd)) ax.vlines(median, 0, max(n), colors='green', linestyles='dashdot', label=r'Median: {0:0.2f}$\pm${1:0.2f}'.format(median, iqd))
ax.ticklabel_format(axis='x', style='plain', useOffset=False) ax.ticklabel_format(axis='x', style='plain', useOffset=False)
else: ax.legend(title='Total CPU time: {0:0.0f}hours'.format(CPUtime), loc='best', fontsize=20, title_fontsize=20)
n, batches, _ = ax.hist(times, bins=20, color='deepskyblue', edgecolor='black')
ax.set_xscale('log')
# finish and save figure # finish and save figure
chnlabel = channels[0] chnlabel = channels[0]
...@@ -286,9 +284,7 @@ def plot_elapsed_time(infodict, out_path, out_name, formats): ...@@ -286,9 +284,7 @@ def plot_elapsed_time(infodict, out_path, out_name, formats):
ax.set_ylabel('# jobs', horizontalalignment='right', x=1.0, verticalalignment='top', y=1.0, fontsize=20, labelpad=20) ax.set_ylabel('# jobs', horizontalalignment='right', x=1.0, verticalalignment='top', y=1.0, fontsize=20, labelpad=20)
ax.set_yscale('log') ax.set_yscale('log')
ax.tick_params(axis='both', which='major', labelsize=20) ax.tick_params(axis='both', which='major', labelsize=20)
ax.ticklabel_format(axis='x', style='plain', useOffset=False)
ax.legend(title='Total CPU time: {0:0.0f}hours'.format(CPUtime), loc='best', fontsize=20, title_fontsize=20)
ax.grid() ax.grid()
ax.set_axisbelow(True) ax.set_axisbelow(True)
...@@ -368,8 +364,6 @@ def plot_events_per_hour(infodict, out_path, out_name, formats): ...@@ -368,8 +364,6 @@ def plot_events_per_hour(infodict, out_path, out_name, formats):
ax.set_xlim(0.9*ephmin, 1.1*ephmax) ax.set_xlim(0.9*ephmin, 1.1*ephmax)
ax.set_xscale('log') ax.set_xscale('log')
# finish and save figure # finish and save figure
chnlabel = channels[0] chnlabel = channels[0]
if out_name: if out_name:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment