How to delete extra legend on the graph using Figure properties

12 次查看(过去 30 天)
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