comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Plotting functions in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Plotting functions in IDL [message #5504] Wed, 17 January 1996 00:00 Go to previous message
M.Reuss is currently offline  M.Reuss
Messages: 4
Registered: January 1996
Junior Member
For plotting, IDL needs a vector of points to plot.
Therefore you evaluate your function at enough points and
then plot this vector.

Suppose the function MYFUNCTION can be evaluated at one point only
in each call and you want to plot it in the range [20,140.], one point
at each integer number being sufficient for you. Then the following should do
the job:

xarr = FINDGEN(121) + 20.
yarr = FLTARR(121)
FOR i = 0,N_ELEMENTS(xarr)-1 DO yarr(i) = MYFUNCTION(xarr(i))

PLOT,xarr,yarr

This will look even more simple if the function code allows to handle
a whole array in one call.

I am afraid I haven't understood what you mean with 'no equations'. You can
code in IDL everything which you can code in FORTRAN, all numerical math
works with IDL (there can be a performance problem, though).
If you mean computer algebra, that's something very different...

Matthias Reuss
[Message index]
 
Read Message
Read Message
Previous Topic: Glitch in TRIGRID using grid spacing
Next Topic: Re: Font Creation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:43:52 PDT 2025

Total time taken to generate the page: 1.21351 seconds