Why does the markers in my plot look different?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 17 de Mayo de 2018
Respondida: MathWorks Support Team
el 4 de Jun. de 2018
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'.
Respuesta aceptada
MathWorks Support Team
el 4 de Jun. de 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');
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Performance en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!