use same colors for plots

This commit is contained in:
romue 2021-06-02 14:01:22 +02:00
parent 017a94d6b7
commit 9ed83e6765
2 changed files with 7 additions and 2 deletions

View File

@ -28,13 +28,16 @@ def plot(filepath, ext='png'):
def prepare_plot(filepath, results_df, ext='png'):
results_df.Measurement = results_df.Measurement.str.replace('_', '-')
hue_order = sorted(list(results_df.Measurement.unique()))
try:
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!
except (FileNotFoundError, RuntimeError):
print('Struggling to plot Figure using LaTeX - going back to normal.')
plt.close('all')
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)

View File

@ -55,6 +55,8 @@ if __name__ == '__main__':
time_stamp = int(time.time())
out_path = None
combine_runs(Path(__file__).parent / 'debug_out'/ 'A2C_1622571986')
exit()
for modeL_type in [A2C, PPO, DQN]:
for seed in range(5):