Subplot 'super' legend
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ziv Kassner
el 1 de Oct. de 2015
Is there any new function that allows you to create a legend for all subplots?
0 comentarios
Respuesta aceptada
Luffy
el 1 de Oct. de 2015
Editada: Luffy
el 1 de Oct. de 2015
Have a look at this similar query.You just need to hard code the position of the legend.
2 comentarios
Adam Danz
el 26 de Abr. de 2021
Actually, Matlab does support a global legend in recent releases.
Another answer on that same page provides a demonstration.
Más respuestas (1)
Victor Castro di Filippo
el 26 de Abr. de 2021
Editada: Victor Castro di Filippo
el 26 de Abr. de 2021
Hi. I find this post looking for the same. I found this and works fantastic. Almost 6 years and a pandemic later i hope this works for you. https://www.mathworks.com/matlabcentral/answers/387391-multiple-plots-with-same-legend#answer_309608
On this part you can put your list of string and thats it
legend('show')
1 comentario
Adam Danz
el 26 de Abr. de 2021
Editada: Adam Danz
el 26 de Abr. de 2021
This only shows object plotted on the current axes. For example, it doesn't work in this example below. However you can add a global legend by following one of the example in the other answer in the link you shared.
figure
subplot(211)
plot(rand(2,5))
subplot(212)
plot(rand(1,5))
legend('show')
Ver también
Categorías
Más información sobre Subplots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!