Several traces in Igor Pro
AppendToGraph adds to the current graph; the trace name is how you address it.
Function StackTraces(WAVE base)
DoWindow/K Stacked
Display/N=Stacked base
Variable i
for (i = 1; i <= 3; i += 1)
Duplicate/O base, $("shifted_" + num2istr(i))
WAVE shifted = $("shifted_" + num2istr(i))
shifted += i * 0.5
AppendToGraph shifted
ModifyGraph rgb($NameOfWave(shifted))=(0, 20000 * i, 40000)
endfor
End
How it works
- A repeated wave name gets a
#1suffix, which is the name to use. RemoveFromGraphtakes it away again.TraceNameListgives you what is actually on the graph.
Keywords and builtins used here
AppendToGraphDisplayDoWindowDuplicateEndFunctionModifyGraphVariableWAVEendforforinum2istr
The run, in numbers
- Lines
- 13
- Characters to type
- 314
- Tokens
- 82
- Three-star pace
- 80 tpm
At the three-star pace of 80 tokens a minute, this run takes about 61 seconds.
Step 2 of 5 in Making a graph, step 2 of 19 in Graphs & presentation.