Path: news.mathworks.com!not-for-mail
From: "Steve " <steveDEL.bachmeierDEL@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: label points
Date: Sat, 9 Feb 2008 21:54:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <fol7dp$g3v$1@fred.mathworks.com>
References: <fokus2$c5h$1@fred.mathworks.com> <fol08h$l7n$1@canopus.cc.umanitoba.ca> <fol251$qdg$1@fred.mathworks.com> <fol6dm$mts$1@f04n12.cac.psu.edu>
Reply-To: "Steve " <steveDEL.bachmeierDEL@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1202594041 16511 172.30.248.38 (9 Feb 2008 21:54:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 9 Feb 2008 21:54:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1034320
Xref: news.mathworks.com comp.soft-sys.matlab:450371



Perfect, thanks!

dvt <dvt+usenet@psu.edu> wrote in message
<fol6dm$mts$1@f04n12.cac.psu.edu>...
>  >> Steve  <steveDEL.bachmeierDEL@yahoo.com> wrote:
>  >>> Is it possible to label only specific values when using
>  >>> plot() in Matlab?  i.e. I have many data points but want
>  >>> only the maximums and minimums labeled with (x,y_max).
> 
> Steve wrote:
> > Sorry, let me clarify.  The axes are fine, but I'd like to
> > add markers to specific values (not at each data point).  In
> > addition, if possible, I'd like to have the (x,y)
> > coordinates at each of these points of interest labeled
> > right on the plot.  Thanks!
> 
> Try something like this:
> 
> % sample data; you already have x and y plotted
> x = rand(10,1);
> y = rand(10,1);
> plot(x,y,'o')
> 
> % this labels the data point(s) with the largest x and y
values
> % these labels might overlap if one data point has the
maximum x and y
> % of the set
> text(max(x),y(x==max(x)),' \leftarrow max x')
> text(x(y==max(y)),max(y),' \leftarrow max y')