Re: Plotting functions in IDL [message #5619 is a reply to message #5513] |
Fri, 19 January 1996 00:00   |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <4dgftr$1qr5@rs18.hrz.th-darmstadt.de>, kunstman@pu.informatik.th-darmstadt.de (Thomas Kunstmann) writes:
> 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.
>
I think what he is asking is whether IDL can plot "expressions" or "equations"
which are not known at the time a procedure is written, but rather are
determined at run time.
This is indeed possible in IDL, using the EXECUTE function. Here is an example
of an IDL program which does so, and the output of a session using it.
************************************************************
print, 'Enter expression to be plotted'
expression=''
read, expression
t = execute('plot, '+expression+', title=expression')
end
************************************************************
; IDL Version 4.0.1 (vms alpha)
; Journal File for CARS3::RIVERS
; Working directory: USER_DISK:[RIVERS.IDL]
; Date: Fri Jan 19 16:51:12 1996
.run test_plot
;Enter expression to be plotted
; sin(findgen(100)/10.)
The procedure then draws the plot of the user-entered expression.
____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
|
|
|