필터 지우기
필터 지우기

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

조회 수: 4 (최근 30일)
Luke Skywalker
Luke Skywalker 2016년 10월 12일
댓글: Luke Skywalker 2016년 10월 12일
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
Walter Roberson
Walter Roberson 2016년 10월 12일
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 2016년 10월 12일
Yes, that did the trick!! Thanks!
I do have R2015a, but for now this seems to work. Let's see what comes up next... ;)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by