That would depend on the aspect ratio of your figure box, for instance:
h = figure;
pos = get(h,'Position');
ratio = pos(3) / pos(4);
a = plot(rand(10,1));
aH = ancestor(a,'axes');
desiredWidth = 0.6;
desiredHeight = desiredWidth * ratio;
posA = get(aH,'Position');
posA(3) = desiredWidth;
posA(4) = desiredHeight;
set(aH,'Position',posA);
Will give you a square plot. You would need to recalculate every time you resize your figure. Also, the desired width has to be selected such that you do not overstep the boundaries of your figure box. It should work for a subplot as well, you just have to be careful with desiredWidth.
ADD Say you know in advance your xlim and ylim (or you get them afterwards), maybe this is what you are looking for:
xlim = [0 5];
ylim = [0 10];
ratio = diff(xlim)/diff(ylim);
h = plot( 1:10);
aH = ancestor(h,'axes');
axis equal;
set(aH,'PlotBoxAspectRatio',[1 ratio 1])
set(aH,'XLim',xlim,'YLim',ylim);
Best Answer