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

Home » Public Forums » archive » 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 #5643 is a reply to message #5513] Thu, 18 January 1996 00:00 Go to previous message
korpela is currently offline  korpela
Messages: 59
Registered: September 1993
Member
In article <4dgftr$1qr5@rs18.hrz.th-darmstadt.de>,
Thomas Kunstmann <kunstman@pu.informatik.th-darmstadt.de> wrote:
> What is the best way of plotting a function in IDL? As far as I know,
> it only handles vectors of discrete data and no equations.

First set up a range and then plot the function over the range.
The way I do it is, for example....

IDL> x=range(-3.*!pi,3.*!pi,0.01)
% Compiled module: RANGE.
IDL> plot,x,sin(x*x)

I have a function called range that looks like this.....
------------------------------------------------------------ ------------
Function range,lo,hi,delta

if (n_params(0) lt 2) or (n_params(0) gt 3) then begin
print,'RANGE-- Incorrect number of parameters'
return,-9999.0
endif
if (n_params(0) eq 2) then delta=1.0
number=long((float(hi)-float(lo))/float(delta))
outrange=float(lo)+findgen(number)*float(delta)
return,[outrange,hi]
end
------------------------------------------------------------ ------------

Eric

--
Eric Korpela | An object at rest can never be
korpela@ssl.berkeley.edu | stopped.
<a href=" http://www.cs.indiana.edu/finger/mofo.ssl.berkeley.edu/korpe la/w">
Click here for more info.</a>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL and color table allocation
Next Topic: Need Help Rendering Picture of Earth with Satellites

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

Current Time: Wed Oct 08 19:13:24 PDT 2025

Total time taken to generate the page: 0.00399 seconds