# Macro Reference

## Range Commands

`range <AXIS> <min> <max>`
`rescale [AXISGROUP]`
`upscale <AXISGROUP> [factor]`
`downscale <AXISGROUP> [factor]`

## Buffer Commands

`select <BUFFER>`
`setcurrent <number>`
`invertselection`
`hide <BUFFER>`
`show <BUFFER>`
`delete <BUFFER>`
`duplicate <BUFFER>`
`setcomment <BUFFER> <text>`
`setcomment <BUFFER> <format> <expr1> ... <expr16>`
`addcomment <BUFFER> <text>`
`addcomment <BUFFER> <format> <expr1> ... <expr16>`
`getcomment <BUFFER> $<var>`
`setsource <BUFFER> <text>`
`setsource <BUFFER> <format> <expr1> ... <expr16>`
`addsource <BUFFER> <text>`
`addsource <BUFFER> <format> <expr1> ... <expr16>`
`getsource <BUFFER> $<var>`
`belongx <BUFFER> <axis>`
`belongy <BUFFER> <axis>`
`datamode <col/xy/err>`
`data <value> ...`
`addvalue <BUFFER> <x value> <y value> [x error] [y error]`
`setxvalue <BUFFER> <index> <value>`
`setxerror <BUFFER> <index> <value>`
`setyvalue <BUFFER> <index> <value>`
`setyerror <BUFFER> <index> <value>`
`rmvalue <BUFFER> <index>`
`newbuffer`
`moveup <BUFFER>`
`movedown <BUFFER>`
`movetop <BUFFER>`
`movebottom <BUFFER>`
`ordertop <BUFFER>`
`orderbottom <BUFFER>`

## Control Commands

`if <expr> <operator> <expr>`
`else`
`endif`
`loop <RANGE>`
`bufferloop <BUFFER>`
`dataloop <buffer> [step]`
`endloop`
`strloop <str 1> <str 2> ... [str n]`
`timer <interval> [count]`
`stoptimer`

## Interactive Commands

`ask <text>`
`askoption <text> <button1> <button0>`
`browse`
`input [text]`
`print <argument> ...`
`printf <format> <expr1> ... <expr16>`
`printtofile [path to file]`
`sleep <seconds>`
`setwarn <BOOL>`
`setreplace <BOOL>`
`setshowtag <BOOL>`

## Calculation Commands

`fg <axis> <min> <max> <steps> <expr>`
`bcalc <buffer1> <operator> <buffer2>`
`calc <target> <expr> <BUFFER>`
`swapxy <BUFFER>`
`sortx <BUFFER>`
`sorty <BUFFER>`
`normx <ref1> <ref2> <new1> <new2> <BUFFER>`
`normy <ref1> <ref2> <new1> <new2> <BUFFER>`
`movex <from> <to> <BUFFER>`
`movey <from> <to> <BUFFER>`
`cutoutsidex <min> <max> <BUFFER>`
`cutinsidex <min> <max> <BUFFER>`
`cutoutsidey <min> <max> <BUFFER>`
`cutinsidey <min> <max> <BUFFER>`
`calcint <min> <max> <BUFFER>`
`linreg <min> <max> <BUFFER>`
`logreg <min> <max> <BUFFER>`
`expreg <min> <max> <BUFFER>`
`linbg <a> <b> <BUFFER>`
`smooth <factor> <BUFFER>`
`fftsmooth <factor> <BUFFER>`
`datareduction <n> <BUFFER>`
`spline <points> <strength> <BUFFER>`
`fft <windowing> <BUFFER>`
`diff <interval> <BUFFER>`
`integrate <BUFFER>`
`setxval <BUFFER> <index> <value>`
`setyval <BUFFER> <index> <value>`
`setxeval <BUFFER> <index> <value>`
`setyeval <BUFFER> <index> <value>`

## Curve Fit Commands

`fit`
`fit <n> <function> [A] [B] [C] [D] [E] [weight]`
`fit clr`

## Style Commands

`margins <left> <right> <bottom> <top>`
`marginleft <value>`
`marginright <value>`
`margintop <value>`
`marginbottom <value>`
`windowsize <width> <height>`
`windowpos <x> <y>`
`drawbg <BOOL>`
`drawmargin <BOOL>`
`drawframe <BOOL>`
`bgcolor <c> <c> <c> [a]`
`bgcolor <COLOR>`
`margincolor <c> <c> <c> [a]`
`margincolor <COLOR>`
`framecolor <c> <c> <c> [a]`
`framecolor <COLOR>`
`framewidth <width>`
`framestyle <style>`
`forceframe <BOOL>`
`onlyactiveaxis <BOOL>`
`framearrows <BOOL>`
`crossarrows <type>`
`framearrowsize <size>`
`framearrowtype <type>`

## Data Style Commands

`bstyle <lines> <symblos> <fill> <ybars> <xbar> <ystick> <xstick> <dots> <hist> <fhist> <BUFFER>`

`bstyleclear <BUFFER>`
`bstylelines <BOOL> <BUFFER>`
`bstylesymbols <BOOL> <BUFFER>`
`bstylefill <BOOL> <BUFFER>`
`bstyleybars <BOOL> <BUFFER>`
`bstylexbars <BOOL> <BUFFER>`
`bstyleysticks <BOOL> <BUFFER>`
`bstylexsticks <BOOL> <BUFFER>`
`bstyledots <BOOL> <BUFFER>`
`bstylehist <BOOL> <BUFFER>`
`bstylefhist <BOOL> <BUFFER>`
`bcolor <c> <c> <c> <BUFFER> [a]`
`bcolor <COLOR> <BUFFER>`
`bcolors <COLOR> [COLOR] ...`
`bfillcolor <c> <c> <c> <BUFFER> [a]`
`bfillcolor <COLOR> <BUFFER>`
`bbarcolor <c> <c> <c> <BUFFER> [a]`
`bbarcolor <COLOR>`
`bstickcolor <c> <c> <c> <BUFFER> [a]`
`bstickcolor <COLOR> <BUFFER>`
`blinewidth <linewidth> <BUFFER>`
`blinepattern <pattern> <BUFFER>`
`bpatternwidth <patternwidth> <BUFFER>`
`bsymbol <symbol> <BUFFER>`
`bsymbolsize <symbolsize> <BUFFER>`
`bsymbolfill <BOOL> <BUFFER>`
`bsticksize <sticksize> <BUFFER>`
`bsticksabs <BOOL> <BUFFER>`
`bdynsize <BUFFER> [expr]`
`bxerrorval <error> <BUFFER>`
`bxerror <type> <BUFFER>`
`byerrorval <error> <BUFFER>`
`byerror <type> <BUFFER>`
`berrorlinewidth <linewidth> <BUFFER>`
`berrorcolor <c> <c> <c> <BUFFER> [a]`
`berrorcolor <COLOR>`
`dirarrows <BOOL> <BUFFER>`
`dirarrowsize <size> <BUFFER>`
`dirarrowlength <length> <BUFFER>`
`dirarrowtype <type> <BUFFER>`
`blegend <BOOL> <BUFFER>`
`bfreex <BOOL> <BUFFER>`
`bfreey <BOOL> <BUFFER>`
`bfreexrange <min> <max> <BUFFER>`
`bfreeyrange <min> <max> <BUFFER>`
`barytop <BOOL> <BUFFER>`
`barybottom <BOOL> <BUFFER>`
`barxleft <BOOL> <BUFFER>`
`barxright <BOOL> <BUFFER>`

## Axis Style Commands

`axis <axis> <margin> [axis] [margin] [axis] [margin] [axis] [margin]` `setaxis <x axis 1> <y axis 1> <x axis 2> <y axis 2>`
`ascalstart <AXIS> <start>`
`ascalend <AXIS> <end>`
`asetreverse <AXIS> <BOOL>`
`atickdist <AXIS> <dist>`
`aminsteps <AXIS> <steps>`
`atimeformat <AXIS> <format>`
`atrigger <AXIS> <trigger>`
`ascalexpr <AXIS> <expr>`
`aexpoffset <AXIS> <offset>`
`adecplaces <AXIS> <n>`
`adecplacesauto <AXIS> <BOOL>`
`acuttrailingzeros <AXIS> <BOOL>`
`aformat <AXIS> <AXISFORMAT>`
`anumberformat <AXIS> <NUMBERFORMAT>`
`asetsmalllogzero <AXIS> <BOOL>`
`atext <AXIS> <text>`
`anumfont <AXIS> <font> <size>`
`anumoffset <AXIS> <offset>`
`anumalign <AXIS> <ALIGN>`
`anumangle <AXIS> <angle>`
`atextfont <AXIS> <font> <size>`
`atextoffset <AXIS> <offset>`
`atextoffsetwindow <AXIS> <BOOL>`
`asetnum <AXIS> <BOOL>`
`asettext <AXIS> <BOOL>`
`asetfliptext <AXIS> <BOOL>`
`atextcolor <AXIS> <c> <c> <c> [a]`
`atextcolor <AXIS> <COLOR>`
`asetzeroline <AXIS> <BOOL>`
`azerolinewidth <AXIS> <double>`
`azerolinecolor <AXIS> <c> <c> <c> [a]`
`azerolinecolor <AXIS> <COLOR>`
`aticklength <AXIS> <length>`
`aminticklength <AXIS> <length>`
`atickwidth <AXIS> <width>`
`amintickwidth <AXIS> <width>`
`asetticks <AXIS> <BOOL>`
`asetminticks <AXIS> <BOOL>`
`asetticksbothsides <AXIS> <BOOL>`
`asetminticksbothsides <AXIS> <BOOL>`
`atickcolor <AXIS> <c> <c> <c> [a]`
`atickcolor <AXIS> <COLOR>`
`amintickcolor <AXIS> <c> <c> <c> [a]`
`amintickcolor <AXIS> <COLOR>`
`atickstyle <AXIS> <style>`
`asetgrid <AXIS> <BOOL>`
`asetmingrid <AXIS> <BOOL>`
`agridcolor <AXIS> <c> <c> <c> [a]`
`agridcolor <AXIS> <COLOR>`
`amingridcolor <AXIS> <c> <c> <c> [a]`
`amingridcolor <AXIS> <COLOR>`
`agridwidth <AXIS> <width>`
`amingridwidth <AXIS> <width>`
`agridpattern <AXIS> <pattern>`
`amingridpattern <AXIS> <pattern>`
`agridfront <AXIS> <BOOL>`
`amingridfront <AXIS> <BOOL>`
`alabel <AXIS> <number> <replacement>`
`aclearlabels <AXIS>`

## Legend Commands

`setlegend <BOOL>`
`legendpos <x> <y>`
`setlegendbg <BOOL>`
`setlegendhorizontal <BOOL>`
`legendalign <ALIGN>`
`legendlength <length>`
`legendspace <space>`
`legendcolor <c> <c> <c> [a]`
`legendcolor <COLOR>`
`legendbgcolor <c> <c> <c> [a]`
`legendbgcolor <COLOR>`
`legendfont <font> <font size>`

## Text & Graphic Commands

`text <tag> <x> <y> <font> <font size> <text> [c] [c] [c] [angle] [TEXTALIGN] [pos] [offset] [cb] [cb] [cb]`
`ftext <tag> <COOR> <x> <y> <font> <font size> <text> [c] [c] [c] [angle] [TEXTALIGN] [ALIGN] [cb] [cb] [cb]`
`qtext <COOR> <x> <y> <text> [angle] [TEXTALIGN] [ALIGN] [COLOR]`

`ptext <text> <pos> [angle] [offset] [COLOR]`

`rect <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [c] [c] [c]`
`rect <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [COLOR]`
`frect <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [c] [c] [c] [cf] [cf] [cf]`
`frect <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [COLOR] [COLOR]`
`circle <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [c] [c] [c]`
`circle <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [COLOR]`
`fcircle <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [c] [c] [c] [cf] [cf] [cf]`
`fcircle <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [COLOR] [COLOR]`
`arrow <tag> <COOR> <x1> <y1> <x2> <y2> <a1> <a2> <at> <as> [linewidth] [dash] [c] [c] [c]`
`arrow <tag> <COOR> <x1> <y1> <x2> <y2> <a1> <a2> <at> <as> [linewidth] [dash] [COLOR]`
`line <tag> <COOR> <x1> <y1> <x2> <y2> [linewidth] [dash] [c] [c] [c]`
`line <tag> <COOR> <x1> <y1> <x2> <y2> [linewidth] [dash] [COLOR]`

`bgraphic [tag]`
`rmtext [tag]`
`rmgraphic [tag]`
`defaultfont <font> <font size>`
`defaultcolor <c> <c> <c>`
`defaultcolor <COLOR>`

## Document Commands

`new`
`window <tag>`
`reset`
`fullreset`
`close`
`closeall`
`open <filename>`
`save`
`saveas <filename>`
`savepng <filename> [resolution]`
`savejpg <filename> [resolution]`
`savepdf <filename>`
`saveeps <filename>`
`printdoc`
`export <filename> <mode> <BUFFER>`
`importcommasep <BOOL>`
`importperiodsep <BOOL>`
`importnotime <BOOL>`
`importfirstrowcomment <BOOL>`
`importnoxcol <BOOL>`
`importxcol <column>`

`import <filename> <mode> [separator] [xcol] [noxcol] [comment] [ignore] [comment sequence] [only number lines] [time format] [comma separator] [period separator] [timezone] [white spaces] [first row titles]`
`binaryimport <filename> <type> <mode> <swap> <columns> [comment]`
`mysqlimport <host> <db> <user> <password> <port> <sql>`

`perlimport <filename> [name]`
`perlfilter <BUFFER> [name]`
`perl [name]`
`perlexec [arg1] [arg2] .. [arg32]`
`exec <path to program> [arg1] [arg2] .. [arg32]`
`tasktimeout <sec>`
`subview <width> <height> <x> <y>`
`copydata <subview number> [RANGE]`
`sizeview <width> <height> <x> <y>`
`changeview <subview number>`
`deleteview <subview number | all>`

## Miscellaneous Commands

`colormode <mode>`
`list`
`exit`
`clr`
`clrvar`
`setvar <var> <expr>`
`<var>=<expr>`
`setstring <var> <value>`
`$<var>=<expr>`
`selector <1-4> <pos> <val1> <val2> [val3] .. [val16]`
`slider <1-4> <pos> <min value> <max value> <start value>`
`setutimestring <time> <format> <var>`
`setmtimestrin <time> <format> <var>`
`eval <name> <expr>`
`format <name> <format> <expr1> ... <expr16>`
`forecast <lon> <lat> [field]`