From: AMK on
Hi,
Is anyone familiar with or have a general function to generate a 1:1 line on a scatterplots?

Thanks,
AMK
From: Walter Roberson on
AMK wrote:

> Is anyone familiar with or have a general function to generate a 1:1 line on a scatterplots?

XL = get(gca, 'XLim');
YL = get(gca, 'YLim');
line( max(XL(1),YL(1)), min(XL(2),YL(2)), ':');
From: sscnekro on
> line( max(XL(1),YL(1)), min(XL(2),YL(2)), ':');

Strange, this yields:
??? Error using ==> line
String argument is an unknown option.

PS I remember from a course (not my idea) that you can plot(x,x, ...) with x one of your data...
From: Walter Roberson on
sscnekro wrote:
>> line( max(XL(1),YL(1)), min(XL(2),YL(2)), ':');
>
> Strange, this yields:
> ??? Error using ==> line
> String argument is an unknown option.
>
> PS I remember from a course (not my idea) that you can plot(x,x, ...)
> with x one of your data...

Yeh, originally I coded plot() and then I changed it to line() before
sending.

And you are right, what I coded doesn't promise a slope of 1.


p0 = max(XL(1),YL(1));
p1 = min(XL(2),YL(2));
if p0 < p1
line( [p0 p1], [p0 p1], 'LineStyle', ':');
else
%line is off the screen
end
From: Jos (10584) on
AMK <kennaster(a)gmail.com> wrote in message <1805638926.314517.1276200904267.JavaMail.root(a)gallium.mathforum.org>...
> Hi,
> Is anyone familiar with or have a general function to generate a 1:1 line on a scatterplots?
>
> Thanks,
> AMK

help refline

Jos
 | 
Pages: 1
Prev: GUI
Next: Slider min and max in GUIDE