Why does the markers in my plot look different?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 17 Mai 2018
Réponse apportée : MathWorks Support Team
le 4 Juin 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'.
Réponse acceptée
MathWorks Support Team
le 4 Juin 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Performance dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!