フィルターのクリア

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 Center および File ExchangeLegend についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by