in MATLAB 20, the legend command no longer adds a black border. How do you manually add one?
13 次查看(过去 30 天)
显示 更早的评论
Hello,
I have recently updated to the newest release and the black boarder that normally sourrounded the legend is now gone.
I have also noticed that the markers and linestyles are missing when plotting a linear model using fitlm.
How does one add the black boarder to the legend?
This happends with the simple commands
plot(1:3,1:3)
legend('Hi')
4 个评论
dpb
2020-4-10
编辑:dpb
2020-4-10
hLg.EdgeColor = [1.0,1.0,1.0]
would make the box outline white which is what default background is here. So that would definitely make invisible.
What about
hLg.Box='on'; % just to be sure
hLg.EdgeColor='k'; % Set it to black [0 0 0]
If that doesn't show up, that's either a bug or an installation problem re: graphics rendering.
hLg.Box='off';
pause(1)
hLg.Box='on';
should make the surrounding box of the legend go away and return after a second.
Submit bug report if a restart doesn't solve it.
I thought just maybe had managed to somehow get a default property set so the box color default was same as background or something like that.
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!