Why does my legend font size change when I change another property on my figure by right clicking?

1 view (last 30 days)
Why does my legend font size change when I change another property on my figure by right clicking?
When a line in the figure below is selected and the color changed by right clicking on the line and selecting change color, the font size of the legend changes back to the default size.
x=(1:1:10);
plot(x,x)
lgd=legend('not my size')
set(lgd,'FontSize',6)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
This is a bug in MATLAB that has been forwarded to our development staff to be addressed in a future release of MATLAB.
Currently as a workaround, you can change the color of the line by directly using its handle.
For example:
x=(1:1:10);
hline=plot(x,x)
lgd=legend('not my size')
set(lgd,'FontSize',6)
set(hline, 'color', 'green')
You can also change the color of the line interactively by using the property editor. You can start the property editor by typing the following at the command prompt:
propedit

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!