Why does my legend behave incorrectly in MATLAB 7.0.1 (R14SP1) after I have specified the "Units" property?
1 view (last 30 days)
Show older comments
I create a plot with a legend using:
l = plot(1:10);
L = legend(l, {'a'});
set(L, 'units', 'pixels');
set(L, 'units', 'normalized');
Then, if I try to change its location on the axis using, for example:
set(L, 'Location', 'north');
I expect the location of the legend to move to the upper center of the figure. However, the location does not change from the upper right.
Also, if I try to make the legend invisible using:
set(L, 'visible', 'off');
I find that the legend contents remain visible.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
There is a bug in MATLAB 7.0.1 (R14SP1) in the way the LEGEND function properties are updated after the “Units” property has changed to anything other than “normalized”.
To work around this issue, avoid changing the "Units" property of the legend.
This bug has been fixed in MATLAB 7.1 (R14SP3).
0 Comments
More Answers (0)
See Also
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!