How do you make 2 markers share the same label in MatLab Legend?

53 visualizaciones (últimos 30 días)
HaAgain
HaAgain el 1 de Nov. de 2017
Respondida: Nathan Miller el 19 de Oct. de 2021
I am trying to make two markers share the same legend title. In this case I have open and closed symbols each representing different conditions but at the same temperature (see photo). From what I gather, there is no property that allows this and so a custom legend must be made. Has anyone encountered this before or come up with a custom legend function?

Respuestas (2)

David Ding
David Ding el 1 de Nov. de 2017
Hi HaAgain,
I see that you have two symbols for each set of temperature data that you would like to have a common legend label. Assuming in your graph you have 10 plots (5 temperature points x 2 symbols per point), when you invoke the "legend" function on your plot, you would receive 10 different labels. In this case, the only possibility is to create 10 labels, specified, perhaps, as the following:
773K, open
823K, open
....
773K, closed
823K, closed
...
This legend might make the plots more descriptive and to-the-point.
Thanks,
David
  1 comentario
HaAgain
HaAgain el 2 de Nov. de 2017
Hi David,
Yes, but it ends up that the legend takes up too much room on the plot. This format was specified by the publisher.
Thank you, HaAgain

Iniciar sesión para comentar.


Nathan Miller
Nathan Miller el 19 de Oct. de 2021

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by