|
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')
|