Making a graph in Igor Pro
Display opens a window on a wave; everything after that names the window.
Function ShowTrace(WAVE y, WAVE x)
DoWindow/K TraceGraph
Display/N=TraceGraph/W=(50, 50, 550, 400) y vs x
AppendToGraph/R y
String traces = TraceNameList("TraceGraph", ";", 1)
Printf "%d traces on %s\r", ItemsInList(traces), WinName(0, 1)
End
How it works
Display y vs xplots one against the other; withoutvsit uses scaling./N=names the window so later commands can find it again.DoWindow/Kcloses an old one first, which makes a script re-runnable.
Keywords and builtins used here
AppendToGraphDisplayDoWindowEndFunctionItemsInListPrintfStringTraceNameListWAVEWinName
The run, in numbers
- Lines
- 9
- Characters to type
- 244
- Tokens
- 59
- Three-star pace
- 80 tpm
At the three-star pace of 80 tokens a minute, this run takes about 44 seconds.
Step 1 of 5 in Making a graph, step 1 of 19 in Graphs & presentation.