Why does the markers in my plot look different?

조회 수: 2 (최근 30일)
MathWorks Support Team
MathWorks Support Team 2018년 5월 17일
답변: MathWorks Support Team 2018년 6월 4일
When I create the following figure:
>> h = plot(1:5,1:5, 'x')
>> h.MarkerSize = 20
>> h.LineWidth = 5
it results in strange and ugly looking X markers on my Mac machine. However, this does not happen after I changed my renderer to 'Painters'.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2018년 6월 4일
The issue happens because of the older OpenGL version that comes with your Mac machine.
This can be reproducible in a Windows machine if MATLAB is opened using -softwareopengl flag (i.e. using older version of OpenGL renderer):
> matlab -softwareopengl
Markers such as *, x, ^, v, etc. are composed of lines. If your machine comes with a newer version of OpenGL renderer, MATLAB would be able to explicitly define the way the lines are supposed to be drawn. Then, MATLAB would let OpenGL draw the line the way we defined them.
However, if your machine comes with older version of OpenGL, we would not have the ability to tell the renderer how to draw the lines. MATLAB will only tell it to draw lines in its default way. And this default way is the one that makes the markers look strange.
Unfortunately, since we cannot control the version of OpenGL that comes with your machine, the only workaround would be to use the Painters renderer:
>> set(0, 'DefaultFigureRenderer', 'painters');

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by