typestar

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

  1. A repeated wave name gets a #1 suffix, which is the name to use.
  2. RemoveFromGraph takes it away again.
  3. TraceNameList gives you what is actually on the graph.

Keywords and builtins used here

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.

Type this snippet

Step 2 of 5 in Making a graph, step 2 of 19 in Graphs & presentation.

← Previous Next →