MATLAB: Position of scatter points problem

position of scatter points

I have a set of scatter points (A), with unit of 'meter'. Then I plot them using:
f = figure(1)
scatter(A(:,1), A(:,2), 3, 'k', 'filled')
but what I noticed is that, the default Units of a figure is 'Pixel', so my question is: is there anyway to know what are the positions of these scatter points in figure?
Thanks!
Yu

Best Answer

https://www.mathworks.com/help/images/ref/axes2pix.html can give you pixels relative to the axes position. You can
ax = gca;
oldunits = get(ax, 'Units');
set(ax, 'Units', 'pixels');
axpos = get(ax, 'Position');
set(ax, 'Units', oldunits);
and now axpos will be in pixels relative to the figure, to which you could add the results of axes2pix.
I seem to remember there being a more direct internal routine, but I do not remember the name of it.
Related Question