How do I write a legend with multiple lines?
24 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Arthur Brigatto
le 27 Mai 2015
Commenté : Star Strider
le 28 Mai 2015
I'm trying to set a legend on the top of a graph that has a lot of data. If I just orientate it horizontally it simply won't fit the screen and I don't want to set it at neither of the sides as I would waste space. So I'm trying to create a multiple line legend with, say, half of the data on one line and the rest of it on the line below. I've looked on the forums and couldn't figure out a way to do so. Is there any way I can do this? I've even tried setting multiple legends but even that won't work.
Thanks!
0 commentaires
Réponse acceptée
Star Strider
le 27 Mai 2015
This works for me:
ts = sprintf('This is a\ntwo-line title');
title(ts)
6 commentaires
Star Strider
le 28 Mai 2015
My pleasure!
That would work, but I was initially thinking of something like this to go near the legend:
text(xtxt, ytxt, 'This is what the yellow area represents', 'BackgroundColor','y')
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Legend dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!