Feed on
Posts
Comments

let’s say you’ve got a bunch of lines in a matlab plot whose labels live in a vector. to place all of those labels into the same figure legend, you can do the following:

>> vec

vec =

1
2
3
4
5

>> legend([repmat('penalty = ',length(vec),1) num2str(vec)])

the result:

matlab legend


Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

Did I get this wrong? Let me know!

Trackback URI | Comments RSS