typestar

Graphs inside a window in Igor Pro

A graph can host another graph, which is how a figure becomes one window.

Function TwoUp(WAVE top, WAVE bottom)
    DoWindow/K Composite
    NewPanel/N=Composite/W=(50, 50, 500, 500)

    Display/HOST=Composite/N=upper/W=(0.05, 0.05, 0.95, 0.45) top
    Display/HOST=Composite/N=lower/W=(0.05, 0.55, 0.95, 0.95) bottom

    SetActiveSubwindow Composite#upper
    ModifyGraph rgb=(0, 0, 45000)
    Label left, "Top"

    SetActiveSubwindow Composite#lower
    ModifyGraph rgb=(45000, 0, 0)
    Label left, "Bottom"
End

How it works

  1. Display/HOST= puts a graph inside an existing window.
  2. /W=(l, t, r, b) is a fraction of the host when /FG= is not used.
  3. SetActiveSubwindow decides which one later commands address.

Keywords and builtins used here

The run, in numbers

Lines
15
Characters to type
403
Tokens
102
Three-star pace
80 tpm

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

Type this snippet

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

← Previous Next →