필터 지우기
필터 지우기

How to get two legends on one graph?

조회 수: 2 (최근 30일)
Roger Moss
Roger Moss 2015년 7월 30일
댓글: dpb 2015년 7월 30일
I used to be able to create a legend; use copyobj to make a permanent duplicate of it, then redefine the original legend. I see ( R2014b changes to legend ) that copyobj now has to copy the axes as well as the legend.
This is a real nuisance as one then has all the axes children copied with them. The new, copied axes with copies of all my lines sits in front of the gca current axes; when I add points or change the legend, they are hidden behind the copied axes. This is just horrible, terribly inelegant. All I want is one axes with two legends on it (not two axes with the current axes inaccessible behind a copy): it worked fine before and now it is broken.
I have fudged some code that hides all the copies (attached) - is there a neater way of doing this? perhaps legend(h, {'strings'}, 'new') ?
  댓글 수: 1
dpb
dpb 2015년 7월 30일
Submit bug report (or perhaps TMW will see it as WAD but will take it under advisement as enhancement).
And, mayhaps they can/will give a better workaround temporarily.
I agree it's always a pita when they break something with seemingly meaningless and unnecessary changes.

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

답변 (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