use same colors for plots
This commit is contained in:
parent
017a94d6b7
commit
9ed83e6765
@ -28,13 +28,16 @@ def plot(filepath, ext='png'):
|
|||||||
|
|
||||||
def prepare_plot(filepath, results_df, ext='png'):
|
def prepare_plot(filepath, results_df, ext='png'):
|
||||||
results_df.Measurement = results_df.Measurement.str.replace('_', '-')
|
results_df.Measurement = results_df.Measurement.str.replace('_', '-')
|
||||||
|
hue_order = sorted(list(results_df.Measurement.unique()))
|
||||||
try:
|
try:
|
||||||
sns.set(rc={'text.usetex': True}, style='whitegrid')
|
sns.set(rc={'text.usetex': True}, style='whitegrid')
|
||||||
sns.lineplot(data=results_df, x='Episode', y='Score', hue='Measurement', ci=95, palette=PALETTE)
|
sns.lineplot(data=results_df, x='Episode', y='Score', hue='Measurement',
|
||||||
|
ci=95, palette=PALETTE, hue_order=hue_order)
|
||||||
plot(filepath, ext=ext) # plot raises errors not lineplot!
|
plot(filepath, ext=ext) # plot raises errors not lineplot!
|
||||||
except (FileNotFoundError, RuntimeError):
|
except (FileNotFoundError, RuntimeError):
|
||||||
print('Struggling to plot Figure using LaTeX - going back to normal.')
|
print('Struggling to plot Figure using LaTeX - going back to normal.')
|
||||||
plt.close('all')
|
plt.close('all')
|
||||||
sns.set(rc={'text.usetex': False}, style='whitegrid')
|
sns.set(rc={'text.usetex': False}, style='whitegrid')
|
||||||
sns.lineplot(data=results_df, x='Episode', y='Score', hue='Measurement', ci=95, palette=PALETTE)
|
sns.lineplot(data=results_df, x='Episode', y='Score', hue='Measurement',
|
||||||
|
ci=95, palette=PALETTE, hue_order=hue_order)
|
||||||
plot(filepath, ext=ext)
|
plot(filepath, ext=ext)
|
||||||
|
2
main.py
2
main.py
@ -55,6 +55,8 @@ if __name__ == '__main__':
|
|||||||
time_stamp = int(time.time())
|
time_stamp = int(time.time())
|
||||||
|
|
||||||
out_path = None
|
out_path = None
|
||||||
|
combine_runs(Path(__file__).parent / 'debug_out'/ 'A2C_1622571986')
|
||||||
|
exit()
|
||||||
|
|
||||||
for modeL_type in [A2C, PPO, DQN]:
|
for modeL_type in [A2C, PPO, DQN]:
|
||||||
for seed in range(5):
|
for seed in range(5):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user