You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LLEPE/docs/Examples/iterative_fitter_monitor.py

38 lines
1.1 KiB

import matplotlib.pyplot as plt
import pandas as pd
go = 'y'
parameters = 'slope,intercept,beta0,beta1,Cphi'.split(',')
while go == 'y':
go = input('continue? ')
plt.close('all')
df = pd.read_csv('outputs/iterative_fitter_output_df.csv')
info_cols = {parameter: [] for parameter in parameters}
for col in df.columns:
for parameter in parameters:
if parameter in col:
info_cols[parameter].append(col)
for parameter in parameters:
mini_df = df[info_cols[parameter]]
fig, ax = plt.subplots()
ax.set_title(parameter)
for col in info_cols[parameter]:
ax.plot(df['iters'].values,
df[col].values,
label=col,
linestyle='-',
marker='o')
ax.set_xlabel('iteration')
ax.set_ylabel('Value')
plt.legend()
plt.show()
fig, ax = plt.subplots()
ax.set_title('best_obj_value')
ax.plot(df['iters'].values,
df['best_obj'].values,
linestyle='-',
marker='o')
ax.set_xlabel('iteration')
ax.set_ylabel('Value')
plt.show()