Skip to content
Snippets Groups Projects

Resolve "Add plots"

Merged Leo Bouscarrat requested to merge 5-add-plots-2 into wip_clean_scripts
3 files
+ 12
6
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -12,14 +12,19 @@ class Plotter(object):
:param all_experiment_weights: The weights for the different experiments
:param file path: str, path where the figure will be saved
'''
all_experiment_weights = np.array(list(all_experiment_weights.values()))
n = len(all_experiment_weights)
colors = Plotter.get_colors_from_cmap(n)
fig, ax = plt.subplots()
for weights in all_experiment_weights.values():
pd.Series([weight for weight in weights if weight != 0]).plot.kde(figsize=(15, 10), ax=ax)
for i in range(n):
for weights in all_experiment_weights[i]:
pd.Series([weight for weight in weights if weight != 0]).plot.kde(
figsize=(15, 10), ax=ax, color=colors[i])
legends = ['Experience ' + str(i+1) for i in range(len(all_experiment_weights))]
ax.legend(legends)
ax.set_title('Density weights of the OMP')
fig.savefig(file_path, dpi=fig.dpi)
fig.title('Density weights of the OMP')
plt.close(fig)
@staticmethod
Loading