How to show legends in matplotLib in accuracy graph?

how can I display the legends for accuracy training vs validation history ? thanks.

Hi, welcome to the community :wink:
If understood well, you want to put training and validation accuracy labels inside the chart, correct?
You can do so by putting the below code before
plt.legend(["First plotted Accuracy (e.g. Training)", "Second plotted Accuracy (e.g.Validation)"], loc ="lower right")

Please let me know if you meant something else.

1 Like

Hi there,

if you want to create a plot like this:

Feel free to check out this source.


1 Like

thank you Mahdi and Christian!
it works smoothly.