Filter löschen
Filter löschen

Matlab legend with two handles, shows only 1 type of marker

4 Ansichten (letzte 30 Tage)
Luke Skywalker
Luke Skywalker am 12 Okt. 2016
Kommentiert: Luke Skywalker am 12 Okt. 2016
Hi,
I am trying to create a legend to a plot with two point distributions. Each distribution thereby has it's own marker type and can be accessed through a handler.
Now, I created the legend using
legend([handle_1; handle_2],{'bla','blo'});
However, the legend only shows the marker type of the handle_1 for both entries. If I switch handle_1 and handle_2, the legend only shows the marker type of handle_2 for both entries (see picture).
I would like the legend to show both marker types. Does anybody know what I did wrong?
  2 Kommentare
Walter Roberson
Walter Roberson am 12 Okt. 2016
Which MATLAB release are you using? There was a bug along these lines, I think it might have been R2015a.
The alternative explanation is that your handle_1 and handle_2 might be vectors of handles. Try
legend([handle_1(1); handle_2(1)],{'bla','blo'});
Luke Skywalker
Luke Skywalker am 12 Okt. 2016
Yes, that did the trick!! Thanks!
I do have R2015a, but for now this seems to work. Let's see what comes up next... ;)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by