typestar

Style macros in Igor Pro

Igor can write the styling back out as a macro, which is how a house style travels.

Proc PaperStyle() : GraphStyle
    PauseUpdate
    ModifyGraph/Z font="Helvetica", fSize=9, axThick=0.8
    ModifyGraph/Z tick=2, mirror=1, standoff=0
    ModifyGraph/Z lsize=1, gfSize=9
    ModifyGraph/Z margin(left)=40, margin(bottom)=32
    ResumeUpdate
EndMacro

Function ApplyStyle(String windowName)
    DoWindow/F $windowName
    Execute "PaperStyle()"
End

How it works

  1. A style macro is generated from a graph and applied to another.
  2. Execute runs it by name, which is what the Style menu does.
  3. Keeping one in a procedure file makes every figure match.

Keywords and builtins used here

The run, in numbers

Lines
13
Characters to type
331
Tokens
71
Three-star pace
85 tpm

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

Type this snippet

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

← Previous Next →