Scatter & markersize method
This a is a demo for your marker size idea. However, I don't recommend this method (see note below).
axh = axes('XTick',0:1:10,'YTick',0:1:10);
grid on
axis equal
xlim([0,10])
ylim([0,10])
hold on
originalUnits = axh.Units;
axh.Units = 'Points';
axSizePix = axh.Position(3:4);
axh.Units = originalUnits;
pixPerUnit = axSizePix ./ [range(xlim(axh)),range(ylim(axh))];
scatter(axh, 6.5, 7.5, ceil(max(pixPerUnit))^2, 'b', 'Marker','s','MarkerFaceColor', 'flat')
scatter(axh, 3.5, 3.5, ceil(max(pixPerUnit))^2, 'r', 'Marker','s','MarkerFaceColor', 'flat')
Note that as soon as you resize the figure or axes, you'll lose the fit of each marker to the grid!
For that reason, it may be better to add rectangles that are in data units and will therefore resize with the figure and axes.
Rectangle method
xy = [6.5, 7.5;
3.5, 3.5;
2.5, 7.5];
colors = [1 0 0;
0 1 0;
0 0 1];
axh = axes('XTick',0:1:10,'YTick',0:1:10);
grid on
axis equal
xlim([0,10])
ylim([0,10])
hold on
rh = arrayfun(@(i) rectangle('position',[xy(i,:)-.5, 1, 1], 'FaceColor',colors(i,:),'EdgeColor', 'none'), 1:size(xy,1));
Best Answer