Add legend outside figure in plot_train#2164
Conversation
| - fbi: | ||
| thresh: 280 | ||
| - rmse | ||
| - rmse No newline at end of file |
| half_len = (200 - len(plt_fname.suffix)) // 2 | ||
| plt_fname = plt_fname.parent / ( | ||
| plt_fname.name[:half_len] | ||
| + "..." |
There was a problem hiding this comment.
Please avoid .... On Linux systems . and .. are very special and having ... in a path/filename can lead to problems (both on human and system level).
| if (min_val >= max_val) or np.isnan(min_val) or np.isnan(max_val): | ||
| continue | ||
|
|
||
| legend = plt.legend( |
There was a problem hiding this comment.
Why do we have this here if _add_legend() is above?
| """ | ||
| ) | ||
|
|
||
| parser.add_argument( |
There was a problem hiding this comment.
I am missing
parser.add_argument(
"--legend-outside",
default=False,
action="store_true",
help="Legend outside of the plot",
)
or similar here.
|
@shmh40 : Could you have a look at this please |
…d' into shmh40/dev/plot-train-legend
Made changes and tested. Very many labels gives a mess without --legend-outside still, but this is expected. |
clessig
left a comment
There was a problem hiding this comment.
Just two minor comments
| plt.savefig(plt_fname) | ||
| plt.savefig(plt_fname, bbox_inches="tight") | ||
| plt.close() | ||
| continue |
There was a problem hiding this comment.
Why do we need the continue here? It's at the end of all loopes
| plt.xlabel("samples") | ||
| plt.tight_layout() | ||
| legend = _add_legend(legend_str, legend_outside=legend_outside) | ||
| for line in legend.get_lines(): |
There was a problem hiding this comment.
Could we add this to _add_legend()?
Description
Add a legend below figure in plot train.
Not well tested, not quite ready.
Issue Number
Closes #2200
Is this PR a draft? Mark it as draft.
Checklist before asking for review
./scripts/actions.sh lint./scripts/actions.sh unit-test./scripts/actions.sh integration-testlaunch-slurm.py --time 60