How to delete extra legend on the graph using Figure properties

조회 수: 12 (최근 30일)
John Long Soon
John Long Soon 2018년 9월 23일
댓글: Walter Roberson 2020년 1월 6일
Dear Everyone,
I have a question regarding how to manipulate the graph legends based on the settings from the figure properties. please find the attached files. I would like to know how can I manually delete the extra legend lines for this case.
Thank you, if someone can answer me this question.
Regards, John
  댓글 수: 2
Jitesh Dadich
Jitesh Dadich 2020년 1월 6일
Hey,
Did you find any solution ?
suggest me if you have found some, I am also facing same problem.
Walter Roberson
Walter Roberson 2020년 1월 6일
What happened when you tried using the method I described of changing the String property?
Note: there are methods that are more reliable, if you do not insist on proceeding by using the Property Inspector.

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

답변 (1개)

Walter Roberson
Walter Roberson 2018년 9월 23일
Click on the String property. The legend will expand to a list of raw character vectors without quotes, one per line. Remove appropriate lines that you do not want to appear, understanding that if you delete any in the middle then that line will not be skipped, that the entries will "fall down" in the list to cover earlier lines. Leaving a blank line might or might not work: the next lines might or might not "fall down", and certainly the corresponding line entry will not be omitted from the legend.
It seems semi-reliable to remove entries this way once per legend without using code to change the properties of the legend.
After you have done this once, you will have trouble adding entries back in. The syntax to use for the text box is not at all clear, and if you experiment you will probably wedge the legend to the point where you would need to delete it and recreate it to get legend entries to work properly.
  댓글 수: 2
John Long Soon
John Long Soon 2018년 9월 25일
Hi Walter,
Sorry for the late replying, I tried to search the string property on the Legend properties (please see attachments). However, I cannot found this configuration settings. If you can pointed out me which settings path I can entry the String property, that would be nice.
Thank you Walter
Walter Roberson
Walter Roberson 2018년 9월 25일
Look in the Labels section of the inspector: it is the second main grouping. String is the second property there, below the Autoupdate check box. It is the one that currently says "1x8 cell" in your image.

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

카테고리

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