Legend error (does not display 'line' in legend box)

조회 수: 3 (최근 30일)
Sangmin Lee
Sangmin Lee 2019년 11월 8일
편집: Star Strider 2020년 10월 2일
If I simply plot using the below code
x=0:0.1:10;
>> figure; plot(x,sin(x))
>> legend('on')
>> 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?
untitled2.png

채택된 답변

Star Strider
Star Strider 2019년 11월 8일
Using:
opengl('save','software')
seems to be a solution for that problem.
See: Use Software OpenGL for Future Sessions and related topics for details.
  댓글 수: 5
Star Strider
Star Strider 2020년 9월 29일
편집: Star Strider 2020년 10월 2일
The actual solution is to upgrade to the latest AMD video card driver.
That option was not available when I wrote this, and is now.
EDIT — (2 Oct 2020 at 19:32)
See this Comment for further details.
Adam Danz
Adam Danz 2020년 9월 29일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by