On Apr 16, 6:32 am, sid <gunvicsi...@gmail.com> wrote:
> Hi,
> I am having a plot, with xaxis varies from 0 to 1023(pixels) and
> yaxis varies from 5000 to 7000(intensity),
> likewise i am having 21 plots, each of this plot having different y
> axis value but same x axis values.
>
> Now I need to find an interval in the xaxis, say suppose from 537 to
> 567 and I need to find the minimum y value in this particular interval
> of x values.
>
> ok that I can find using where command.
>
> But if suppose this minimum y value is occuring at 545th pixel for one
> of the plots out of 21 plots and for the other plot it occurs at 543th
> pixel, then how to make the minimum value of y at the interval 537 to
> 567(x values) fall on one particular pixel for all the 21 plots.
>
> please give some suggesions and tips in this regard.
> regards
> sid
Sounds like a job for min() with a DIMENSION keyword...
Result = MIN( Array [, Min_Subscript] [, /ABSOLUTE] [,
DIMENSION=value] [, MAX=variable] [, /NAN] [,
SUBSCRIPT_MAX=variable])
e.g. for two "plots" :
x=indgen(7); fake x values
y1=[3,2.2,3,3,3,3,4] ; fake plot 1 values
y2=[2,2,2,1,2,2,2]; fake plot 2 values
plot, x, y1, /xstyle
oplot, x, y2
yy=[[y1],[y2]]; concatenate arrays together
mm=min(yy,w, dim=1); get minimum along dim=1 (ie for each column)
print, mm ; the minima
w=array_indices(yy, w)
print, yy[w[0,*],w[1,*]]
oplot, x[w[0,*]], yy[w[0,*],w[1,*]], ps=6, syms=4
|