typestar

Exporting a figure in Igor Pro

SavePICT writes what is on screen; the flags decide the format and the resolution.

Function ExportFigure(String windowName)
    if (!WinType(windowName))
        Print "no window called", windowName
        return -1
    endif

    SavePICT/O/WIN=$windowName/E=-2/B=300 as windowName + ".png"
    SavePICT/O/WIN=$windowName/E=-8 as windowName + ".svg"

    return 0
End

How it works

  1. /E=-2 is PNG, -8 is SVG, -3 is EPS.
  2. /B= sets the resolution in dpi, which matters for a raster format.
  3. /O overwrites and /P= names an Igor symbolic path.

Keywords and builtins used here

The run, in numbers

Lines
11
Characters to type
250
Tokens
52
Three-star pace
90 tpm

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

Type this snippet

Step 2 of 3 in Off the screen, step 17 of 19 in Graphs & presentation.

← Previous Next →