Scatter plot does not display point 0,0 when double precision
Mostrar comentarios más antiguos
I have the following code which works as intended, plotting 3 points.
x = [0 0; 12 0; 6 6];
scatter(x(:,1), x(:,2), 100, 'fill');
However, when I interject the following line
x = 1.01 * x;
which effectively turns everything into double precision, then the point 0,0 does not display
why is that, and how can I make it so that it also displays?
Thanks in advance!
Respuesta aceptada
Más respuestas (3)
AJ von Alt
el 23 de Abr. de 2014
This looks like an issue with the Painters renderer. Switching to OpenGL resolves the issue on my end.
x = [0 0; 12 0; 6 6];
figure('renderer','OpenGL')
scatter(x(:,1), x(:,2), 100, 'fill');
y = 1.01 * x;
figure('renderer','OpenGL')
scatter(y(:,1), y(:,2), 100, 'fill');
2 comentarios
chris
el 23 de Abr. de 2014
AJ von Alt
el 23 de Abr. de 2014
The renderer is used to draw the plot in the figure. It is defined independently for each figure so you will need to specify it every time you create one.
You can change the renderer of the current figure to "OpenGL" using the command:
set( gcf , 'renderer' , 'OpenGL' )
To read more about renderers see: http://www.mathworks.com/help/releases/R2013b/matlab/ref/figure_props.html#Renderer
chris
el 23 de Abr. de 2014
0 votos
chris
el 23 de Abr. de 2014
0 votos
Categorías
Más información sobre Graphics Performance en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
