Why does the marker size change randomly?
1 view (last 30 days)
I have created a function which generates a random array of 1000 white dots
%generate random points for X and Y coordinates of the points
X1 = rand(1000,1);
Y1 = rand(1000,1);
% Create axes
axes1 = axes('Color',[0 0 0]);
% Create scatter
H = plot(X1,Y1,'MarkerFaceColor',[1 1 1],'MarkerEdgeColor',[1 1 1],...
As you can see, there is no figure created as part of the function. This means that whenever I type "RandomArray" into the command window, the current figure is used. I have found that when I type RandomArray once, twice and then three times, on the third time, the marker size suddenly decreases, and then remains smaller if I continue to repeat the function. This does not occur when a new figure is created each time as part of the function. Please could someone tell me why this might be? Thanks
Supreeth Subbaraya on 6 Aug 2014
This is happening because your renderer is changing from painters to zbuffer. You can check this by putting the following line in your code and debugging.
You can find more information about the renderers here. You can set the renderer by using the command,
You can now see that the marker size would not change randomly.