Re: correct way to use INTERPOLATE function [message #55977 is a reply to message #55976] |
Fri, 21 September 2007 13:26   |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
Ryan. wrote:
>> PLOT, Congrid(smallarray, N_Elements(largearray)), largearray
>
> If I do that I get the same result:
> PLOT, CONGRID(smallarray, N_ELEMENTS(largearray), 1, 1) <- With our
> without the INTERP keyword
>
> I want to *stretch* the small array so that it has the same number of
> elements as the large one so I can plot it and all the new points to
> be interpolated linearly between each point. Evenly spaced points is
> fine for my purposes.
For that purpose, you can also use INTERPOL (rather than INTERPOLATE).
Here's an example:
x=findgen(6)/5
y=[0.,2,2,5,6,10]
;first data set
plot,x,y,psym=-6
x2=findgen(100)/100
z=interpol(y,x,x2)
;the z array is interpolated linearly from the point in y
oplot,x2,z,psym=-4
Is that waht you are trying to do?
Cheers,
Paolo
PS: switching to google groups as it turns out newsgroup server
are not supported at my new institution... at least the RSS feed
can be shown in thunderbird in such a way as to look kind of
similar as it should when using a real newsgroup server... but
I am wondering whether there is a way of using a fixed size font
in the google groups "post message" interface...
>
> Ryan.
|
|
|