Legend error (does not display 'line' in legend box)
15 views (last 30 days)
Show older comments
Sangmin Lee on 8 Nov 2019
Edited: Star Strider on 2 Oct 2020
If I simply plot using the below code
>> figure; plot(x,sin(x))
>> hold on
>> scatter(x, cos(x))
The figure looks like the below figure. The legend shows no 'line' for the first graph. It shows only circle.
How can I fix this problem?
Star Strider on 8 Nov 2019
seems to be a solution for that problem.
See: Use Software OpenGL for Future Sessions and related topics for details.
Adam Danz on 29 Sep 2020
My Windows 10 system indicates that my currently installed Radeon 540x Series is the best driver for the machine. I didn't have this problem on my 8-year old laptop. 😕
Your solution to use opengl software is a good one but it introduces other problems like jagged edges for some lines. The need to widen line widths is annoyoing but worth mentioning so others are aware of that workaround.
More Answers (0)
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!