Re: iTool Redeux [message #37214 is a reply to message #37208] |
Tue, 25 November 2003 20:01   |
Chris Torrence
Messages: 5 Registered: March 2001
|
Junior Member |
|
|
Hi,
One further point. If you are interested in simply doing things with iTools
from the command line (rather than creating your own iTool), there are some
good examples in the <IDL_DIR>/examples/demo/demosrc directory.
Specifically, I would look at d_icontour, d_icurvefit, and d_iimage. As an
example, here is the code from d_icurvefit:
; Generate a plot line
n = 50
x = (findgen(n) - 25)/2
yerr = 0.1
y = 2 + 0.1*x + 3*exp(-((x - 1)/2)^2) + yerr*randomn(1,n)
yerror = replicate(yerr, n)
IPLOT, x, y, $
COLOR = [255,0,0], $
ERRORBAR_COLOR = [255,0,0], $
THICK = 2, $
LINESTYLE = 6, $
NAME = 'Gaussian+Linear', $
SYM_INDEX = 4, $
XTITLE = 'Angle !9F!X (degrees)', $
YTITLE = 'Area (m!u2!n)', $
YERROR = yerror, $
/NO_SAVEPROMPT
oSys = _IDLitSys_GetSystem()
oTool = oSys->_GetCurrentTool()
void = oTool->DoAction('Operations/Operations/Filter/Curve Fitting')
oWin = oTool->GetCurrentWindow()
oWin->ClearSelections
void = oTool->DoAction('Operations/Insert/Legend')
This example starts up an iPlot, then fires up the Curve Fitting operation,
and then automatically inserts a legend once the user has hit OK on the
Curve Fit dialog.
With the combination of "DoSetProperty" (see previous post) and "DoAction",
you can perform almost any "interactive" operation directly from the command
line.
-Chris
|
|
|