typestar

Color from a third wave in Igor Pro

A trace can take its color from data instead of from a constant.

Function ColorByDepth(WAVE y, WAVE depth)
    DoWindow/K DepthView
    Display/N=DepthView y

    ModifyGraph mode=3, marker=19, msize=2.5
    ModifyGraph zColor(y)={depth, *, *, Rainbow, 0}

    ColorScale/A=RC/E/N=depthScale trace=y, "Depth (m)"
    ColorScale/C/N=depthScale fsize=9, width=8
End

How it works

  1. zColor(trace)={wave, low, high, table} colors point by point.
  2. * for a limit means autoscale to the color wave's range.
  3. A ColorScale next to it is what makes the colors mean something.

Keywords and builtins used here

The run, in numbers

Lines
10
Characters to type
274
Tokens
72
Three-star pace
85 tpm

At the three-star pace of 85 tokens a minute, this run takes about 51 seconds.

Type this snippet

Step 6 of 6 in Styling, step 11 of 19 in Graphs & presentation.

← Previous Next →