Why does the markers in my plot look different?

2 views (last 30 days)
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'.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 4 Jun 2018
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');

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!