From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Plotting max and min
Date: Thu, 18 Feb 2010 19:27:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 39
Message-ID: <hlk4a6$orp$>
References: <hlk24t$3g3$> <>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1266521222 25465 (18 Feb 2010 19:27:03 GMT)
NNTP-Posting-Date: Thu, 18 Feb 2010 19:27:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1337020
Xref: comp.soft-sys.matlab:609414

Sadik and TideMan,
  Thank you both for your inputs.  Both solutions provided were correct and worked very well.  

  That was very crafty to think of defining an abscissa first.  I honestly didn't think of doing that because my script basically takes from a file, searches through it and plots a truth from two user defined points.  I would assume, the starting point that the user defines would be used as a started to plot.  I think I would've thought of Sadiks method before I thought of yours.  I appreciate your method.  Gives me a great direction to think of.

Sadik, can't leave you out.  Thank you for input as well.

Thanks to you both for your swift responses.  

TideMan <> wrote in message <>...
> On Feb 19, 7:50 am, "Julian " <> wrote:
> > Hello all,
> >   I must be going through a long day, because I am stumped on something that I think should be very minute.  However, I am trying to plot multiple plots in my graph with no success.  This is a snippet of my code.  More or less this is the end of my code.
> >
> > data1 = var1-var2
> > lower = min(data1);
> > upper = max(data1);
> > avg = mean(data1);
> >
> > plot(data1,'r*')
> > hold on
> > plot(upper,'m.')
> > plot(lower,'y.')
> > plot(avg,'g.')
> >
> > Now, I plot the first point, plot(data1,'r*') no problem.  And I do realize I can just go to Data statistics to find out the max, min, etc.  But I want this code to be as automatic as I can.  With that said, I have to say, I seem to not seem to know my basics today.  Any help would be appreciated.
> What is the abscissa?
> You need to define one.
> Even x=[1:length(data1)]'; would do.
> Then:
> > plot(x,data1,'r*')
> > hold on
> > plot(x,upper*ones(length(x),1),'m.')
> or
> plot([x(1) x(end)],[upper upper],'m-')
> etc