legend dynamically updated
Mostrar comentarios más antiguos
Hi, my task would be to have a legend which is update dynamically as I loop over some data extracted from different files and I add them to a same plot, for instance. To put it better, I would like to "append" a label to my legend every time I update my plot. Would you know how to do it?
Chiara
4 comentarios
John Bailey
el 12 de Mayo de 2018
Editada: John Bailey
el 12 de Mayo de 2018
plot(Pss,'DisplayName','desired legend entry')
legend('-DynamicLegend')
Place that after your first plot and it will automically put the name of the plot variable into the legend.
Walter Roberson
el 12 de Mayo de 2018
Note that dynamic legends did not exist at the time the original question was asked in 2011.
Matthew
el 25 de Sept. de 2018
Those were the days.
Moritz Stich
el 31 de Mzo. de 2022
Jon Bailey you are a dynamic legend. Thanks
Respuesta aceptada
Más respuestas (2)
Matt Fig
el 21 de Mzo. de 2011
0 votos
How are you updating the plot? In a loop?
1 comentario
rodolfo reyesbaez
el 21 de Mayo de 2019
I added a hold on before ending the loop
Chiara Modenese
el 21 de Mzo. de 2011
Categorías
Más información sobre Legend en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!