in MATLAB 20, the legend command no longer adds a black border. How do you manually add one?

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 comentarios

Haven't installed R2020x as yet so can't test but nothing in documentation indicates and would be very surprising for that to have changed.
What does
figure
plot(1:3,1:3)
hLg=legend('Hi');
hLg.Box
hLg.EdgeColor
return? Default is still listed as 'On' and 0.15*[1 1 1] in the R2020 documentation online and is behavior going back to "since forever" of the new legend object.
plot(1:3,1:3)
>> hLg = legend('hi')
hLg =
Legend (hi) with properties:
String: {'hi'}
Location: 'northeast'
Orientation: 'vertical'
FontSize: 9
Position: [0.7774 0.8532 0.1089 0.0476]
Units: 'normalized'
Show all properties
>> hLg.Box
ans =
OnOffSwitchState enumeration
on
>> hLg.EdgeColor
ans =
0.1500 0.1500 0.1500
Performing
hLg.EdgeColor = [1.0,1.0,1.0]
Does nothing to the legend border.
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.
Setting edgecolor to 'k' did nothing.
box off and on did work but the box outline did not appear. I have made a request to mathworks.
Thank you!
I will keep this open and report back what Mathworks says.

Iniciar sesión para comentar.

 Respuesta aceptada

Problem has been fixed. I reinstalled the program and updated my graphics drivers. MATLAB is now working normally.

Más respuestas (0)

Productos

Versión

R2020a

Etiquetas

Preguntada:

el 10 de Abr. de 2020

Respondida:

el 13 de Abr. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by