I have some data similar to this:
>> x = rand(50,1)*10000;
>> y = (rand(50,1)+0.5)*10000;
and i would like to draw an scatter plot, so:
>> scatter(x,y); axis equal; xlim([0 15000]);; ylim([0 15000]);
My simple question:
How could i draw a 1:1 line (diagonal) to visually help the reader to understand the most of my y points are greater than x ones?
I could try to dray 'a lot' of small dots in the diagonal using the scatter itself, but this does not seems very smart… Please, if you have some other idea, just let me know!
Thanks in advance,
DG
one of the solutions
x=sort(rand(1,50));
y=x+.5*(rand(size(x))-.5);
scatter(x,y,'filled');
line([0,1],[0,1],...
'linewidth',2,...
'color',[1,0,0]);
set(gca,...
'xlim',[-.5,1.5],...
'ylim',[-.5,1.5]);
axis square;
us
"us " <u...@neurol.unizh.ch> wrote in message <gooa9p$el1$1...@fred.mathworks.com>...