# Macro Language: Range Commands

`range <AXIS> <min> <max>`

Sets the axis min and max.

`rescale [AXISGROUP]`

Rescales the plot so that every data point is visible.

`upscale <AXISGROUP> [factor]`

Lowers the range of the plot by the given factor (default=10).

`downscale <AXISGROUP> [factor]`

Increase the range of the plot by the given factor (default=10).

# Macro Language: Buffer Commands

`select <BUFFER>`

Select data buffers.

`setcurrent <number>`

Defines the current working buffer.

`invertselection`

Inverts the selection of data buffers.

`hide <BUFFER>`

Hide buffers.

`show <BUFFER>`

Show buffers.

`delete <BUFFER>`

Delete buffers.

`duplicate <BUFFER>`

Duplicate buffers.

`setcomment <BUFFER> <text>`

Set the comment field of buffers.

`addcomment <BUFFER> <text>`

Add text to the comment field of buffers.

`getcomment <buffer> $<var>`

Defines a string variable with the comment field of the buffer.

`setsource <BUFFER> <text>`

Set the source field of buffers.

`addsource <BUFFER> <text>`

Add text to the source field of buffers.

`getsource <buffer> $<var>`

Defines a string variable with the source field of the buffer.

`belongx <BUFFER> <axis>`

Defines if the buffers belong to the 1. (bottom) or the 2. (top) X axis (possible values: 1, 2, bottom, top).

`belongy <BUFFER> <axis>`

Defines if the buffers belong to the 1. (left) or the 2. (right) Y axis (possible values: 1, 2, left, right).

`addvalue <buffer> <x value> <y value> <x error> <y error>`

Add value pair to data buffer.

`setxvalue <buffer> <index> <value>`

Set X value in the data buffer.

`setxerror <buffer> <index> <value>`

Set X error in the data buffer.

`setyvalue <buffer> <index> <value>`

Set the Y value in the data buffer.

`setyerror <buffer> <index> <value>`

Set Y error in the data buffer.

`rmvalue <buffer> <index>`

Delete value from the data buffer.

`newbuffer`

Add a new empty buffer to the document.

`moveup <BUFFER>`

move the buffer up in the drawing order.

`movedown <BUFFER>`

move the buffer down in the drawing order.

# Macro Language: Control Commands

`if <expr> <operator> <expr>`
`else`
`endif`

Executes the commands between `if ...` and `else` if the condition is true. If the condition is false it executes the commands between `else` and `endif`. Possible operators are `==`, `!=`, `>`, `<`, `>=`, `<=` for numerical comparison and `eq`, `ne` for string comparison. It is not possible to define if,else,endif statements inside another `if`, `else`, `endif` statements.

`loop <RANGE>`

Starts a loop for the given range. The running variable for the loop command is `l`. It is not possible to define loops inside another loop.

`bufferloop <BUFFER>`

Starts a loop for the given buffer numbers. The running variable for the loop command is `l`. It is not possible to define buffer loops inside another loop.

`dataloop <buffer>`

Starts a loop for all data points in the given buffer. The running variable for the loop command is `l`, in this case the same as the point number in the buffer. During the loop the variables `lx`, `ly`, `lxe`, `lye` contains the values of the corresponding data point. It is not possible to define data loops inside another loop.

`endloop`

The endpoint of a `loop`, `bufferloop` or `dataloop` command.

`timer <interval> [count]`

Set a timer on the current macro. The macro will be executed every <interval> seconds. With [count] the timer can be stopped after that number of executions. The variable `timercount` contains a counter of executions.

`stoptimer`

Stop a running timer.

`perltimeout <seconds>`

Set the timeout for inline Perl execution in macros. Default is 10 seconds.

# Macro Language: Interactive Commands

`ask <text>`

This command stops the macro, shows an alert box, displays the `text`, and let you choose to stop or continue the macro.

`askoption <text> <button1> <button0>`

This command stops the macro, shows an alert box, displays the `text`, and provide two buttons. The result will be stored in the variable `option` (1 = `button1`, 0 = `button0`).

`browse`

Opens a panel for file selection. The selected filename will be stored in `$file`.

`input [text]`

This command brings up an input panel an let you enter a value. The value will be stored in variables `input` (numerical variable for expressions) and `$input` (string variable).

`print <argument> ...`

Print messages to the console window. The argument will be treated as an expression or a string.

`sleep <seconds>`

Stops the macro execution for the given time in seconds.

`setwarn <BOOL>`

Enable/Disable warnings.

# Macro Language: Calculation Commands

`fg <axis> <min> <max> <steps> <expr>`

Generate a function with the given parameters.
`<axis>`: The target axis (1 = X axis, 2 = Y axis)
`<min>`, `<max>`: The range of the new generated function.
`<steps>`: Number of steps for the function.
`<expr>`: Expression which defines the function.

`bcalc <buffer1> <operator> <buffer2>`

Performs basic calculations between two buffers. This work also for buffers with different X axis and different numbers of data points. Only the overlapping area will be processed and missing points will be interpolated.
`<operator>`: + - * /

`calc <data> <expr> <BUFFER>`

Performs a calculation on the data in the buffers.
`<data>`: The target axis (1 = X values, 2 = Y values, 3 = X error, 4 = Y error)
`<expr>`: Expression which defines the calculation.

`swapxy <BUFFER>`

This function swaps the X and Y values. Error values will also be swapped if available.

`sortx <BUFFER>`

This function sorts the data by X values.

`sorty <BUFFER>`

This function sorts the data by Y values.

`normx <ref1> <ref2> <new1> <new2> <BUFFER>`

This function manipulates the buffers by stretching or shrinking along the X axis. The specified reference points in the data are changed in such a way that the `ref1` value becomes the `new1` value and the `ref2` value becomes the `new2` value.

`normy <ref1> <ref2> <new1> <new2> <BUFFER>`

This function manipulates the buffers by stretching or shrinking along the Y axis. The specified reference points in the data are changed in such a way that the `ref1` value becomes the `new1` value and the `ref2` value becomes the `new2` value.

`movex <from> <to> <BUFFER>`

This function moves the buffers on the X axis.

`movey <from> <to> <BUFFER>`

This function moves the buffers on the Y axis.

`cutoutsidex <min> <max> <BUFFER>`

This function delete all data points in the buffers which are not in the X range between `min` and `max`

`cutinsidex <min> <max> <BUFFER>`

This function delete all data points in the buffers which are in the X range between `min` and `max`

`cutoutsidey <min> <max> <BUFFER>`

This function delete all data points in the buffers which are not in the Y range between `min` and `max`

`cutinsidey <min> <max> <BUFFER>`

This function delete all data points in the buffers which are in the Y range between `min` and `max`

`calcint <min> <max> <BUFFER>`

Integrates the buffers and add the result to the comment field. The result of the last integration is stored in the variable `integral`.

`linreg <min> <max> <BUFFER>`

Perform a linear regression between `min` and `max`. The result of the last regression will be stored in the variables `rega`, `regb` and `regr`.

`logreg <min> <max> <BUFFER>`

Perform a logarithmic regression between `min` and `max`. The result of the last regression will be stored in the variables `rega`, `regb` and `regr`.

`expreg <min> <max> <BUFFER>`

Perform a exponential regression between `min` and `max`. The result of the last regression will be stored in the variables `rega`, `regb` and `regr`

`linbg <a> <b> <BUFFER>`

Perform a linear background subtraction (y=y+a+bx)

`smooth <factor> <BUFFER>`

This function uses `factor` as the effective smooth width and performs a least square smooth to reduce the noise on the buffer.

`fftsmooth <factor> <BUFFER>`

This function uses `factor` as the effective smooth width and performs an FFT based smooth to reduce the noise on the buffer.

`datareduction <n> <BUFFER>`

Sometimes it is useful to reduce a large number of data points which consist mainly of noise to a more practical amount of points. This function takes `n` points, builds the average, and replaces the n points with the new one.

`spline <points> <strength> <BUFFER>`

This function calculates a nonparametric cubic spline interpolation.
`<points>`: Defines the number of points which should be calculated for each interval.
`<strength>`: Defines the strength of the interpolation. 2 is in most cases a good choice.

`fft <windowing> <BUFFER>`

Performs a Fast Fourier Transform and generates a new buffer with the result.
`<windowing>`: 1=none, 2=Hanning, 3=Welch, 4=Parzen

`diff <interval> <BUFFER>`

Differentiate the buffers and generate new buffers with the result data.

`integrate <BUFFER>`

Integrates buffers and generate new buffers with the result data.

`setxval <BUFFER> <index> <value>`

Set the X value at the given index of the buffers.

`setyval <BUFFER> <index> <value>`

Set the Y value at the given index of the buffers.

`setxeval <BUFFER> <index> <value>`

Set the X error value at the given index of the buffers.

`setyeval <BUFFER> <index> <value>`

Set the Y error value at the given index of the buffers.

# Macro Language: Style Commands

`margins <left> <right> <bottom> <top>`

Defines the margins between window and frame.

`windowsize <width> <height>`

Defines the window size.

`drawbg <bool>`

Enable or disable background drawing (possible values: yes/no).

`drawmargin <bool>`

Enable or disable margin background drawing (possible values: yes/no).

`drawframe <bool>`

Enable or disable frame drawing (possible values: yes/no).

`bgcolor <c> <c> <c> [a]`
`bgcolor <COLOR>`

Defines the background color. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With `a` the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`margincolor <c> <c> <c> [a]`
`margincolor <COLOR>`

Defines the margin color. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With `a` the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`framecolor <c> <c> <c> [a]`
`framecolor <COLOR>`

Defines the frame color. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With `a` the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`framewidth <width>`

Defines the frame width.

`framestyle <style>`

Defines the frame style. (0=full frame, 1=line at X and Y axis, 2=draw a cross at 0).

`forceframe <bool>`

If enabled a full frame will always be drawn (possible values: yes/no).

`framearrows <bool>`

If enabled arrow will be drawn for frame style 1 and 2.

`crossarrows <type>`

Set where a cross axis should have arrows (possible values: min/max/both).

`framearrowsize <size>`

Defines the size of frame arrows.

`framearrowtype <type>`

Defines the frame arrow type (0=open, 1=closed, 2=bar).

# Macro Language: Data Style Commands

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

Enable or disable styles for data buffers. All styles can be combined (possible values: yes/no).

`bstyleclear <BUFFER>`

Removes all styles from buffer.

`bstylelines <bool> <BUFFER>`

Add or remove line style (possible values: yes/no).

`bstylesymbols <bool> <BUFFER>`

Add or remove symbol style (possible values: yes/no).

`bstylefill <bool> <BUFFER>`

Add or remove filled area style (possible values: yes/no).

`bstyleybars <bool> <BUFFER>`

Add or remove the Y bar style (possible values: yes/no).

`bstylexbars <bool> <BUFFER>`

Add or remove the X bars style (possible values: yes/no).

`bstyleysticks <bool> <BUFFER>`

Add or remove the Y stick style (possible values: yes/no).

`bstylexsticks <bool> <BUFFER>`

Add or remove the X sticks style (possible values: yes/no).

`bstyledots <bool> <BUFFER>`

Add or remove dot style (possible values: yes/no).

`bstylehist <bool> <BUFFER>`

Add or remove histogram style (possible values: yes/no).

`bstylefhist <bool> <BUFFER>`

Add or remove filled histogram style (possible values: yes/no).

`bcolor <c> <c> <c> <BUFFER> [a]`
`bcolor <COLOR> <BUFFER>`

Defines the color for buffers. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With `a` the alpha value can be defined (default is 1.0).

`bfillcolor <c> <c> <c> <BUFFER> [a]`
`bfillcolor <COLOR> <BUFFER>`

Defines the color for the fill style. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With `a` the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`bbarcolor <c> <c> <c> <BUFFER> [a]`
`bbarcolor <COLOR>`

Defines the color for bars. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With `a` the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`bstickcolor <c> <c> <c> <BUFFER> [a]`
`bstickcolor <COLOR> <BUFFER>`

Defines the stick color. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With `a` the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`blinewidth <linewidth> <BUFFER>`

Defines the line width for buffers.

`blinepattern <pattern> <BUFFER>`

Defines the dash pattern for buffers (0-15).

`bpatternwidth <patternwidth> <BUFFER>`

Defines the width of dash pattern.

`bsymbol <symbol> <BUFFER>`

Define the symbols for buffers (0-15).

`bsymbolsize <symbolsize> <BUFFER>`

Defines the symbol size for buffers.

`bsymbolfill <bool> <BUFFER>`

If true symbols (0-6) will be filled with the fill color instead of the background color.

`bsticksize <sticksize> <BUFFER>` Set the stick size

`bsticksabs <bool> <BUFFER>`

Defines if the stick size should be an absolute value or not (possible values: yes/no).

`bdynsize <BUFFER> [expr]`

Sets an expression which defines the size of symbols or the length of sticks.

`bxerrorval <error> <BUFFER>`

Defines the value for X error bars.

`bxerror <type> <BUFFER>`

Defines the X error bar type (0=off, 1=absolute, 2=relative, 3=form data).

`byerrorval <error> <BUFFER>`

Defines the value for Y error bars.

`byerror <type> <BUFFER>`

Defines the Y error bar type (0=off, 1=absolute, 2=relative, 3=form data).

`berrorlinewidth <linewidth> <BUFFER>`

Defines the line width for error bars.

`berrorcolor <c> <c> <c> <BUFFER> [a]`
`berrorcolor <COLOR>`

Defines the color of error bars. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With `a` the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`dirarrows <bool> <BUFFER>`

Toggle direction arrows. If set the X error value will be drawn as direction arrow (0-360 degree)

`dirarrowsize <size> <BUFFER>`

Defines the size of direction arrow.

`dirarrowlength <length> <BUFFER>`

Defines the width of direction arrow.

`dirarrowtype <type> <BUFFER>`

Defines the direction arrow type (0-15).

`blegend <bool> <BUFFER>`

Toggle automatic legend plotting for buffers.

`bfreex <bool> <BUFFER>`

If set for a buffer, the buffer does not depend to any X axis. Instead the display range can be set with the `bfreexrange` command.

`bfreey <bool> <BUFFER>`

If set for a buffer, the buffer does not depend to any Y axis. Instead the display range can be set with the `bfreeyrange` command.

`bfreexrange <min> <max> <BUFFER>`

Defines the X range for buffers which not belong to an X axis.

`bfreeyrange <min> <max> <BUFFER>`

Defines the Y range for buffers which not belong to an Y axis.

`barytop <bool> <BUFFER>`

If set Y bars will be drawn from the top of the frame.

`barybottom <bool> <BUFFER>`

If set Y bars will be drawn from the bottom of the frame.

`barxleft <bool> <BUFFER>`

If set X bars will be drawn from the left of the frame.

`barxright <bool> <BUFFER>`

If set X bars will be drawn from the right of the frame.

# Macro Language: Axis Style Commands

`setaxis <x axis 1> <y axis 1> <x axis 2> <y axis 2>`

Enable or disable axis drawing (possible values: yes/no)

`ascalstart <AXIS> <start>`

Defines where axis scaling should start.

`ascalend <AXIS> <end>`

Defines where axis scaling should end.

`asetreverse <AXIS> <bool>`

If set the axis will be reverse plotted (possible values: yes/no)

`atickdist <AXIS> <dist>`

Defines the distance between two major ticks. If your axis is a time axis you have to enter `days:hours:minutes:seconds` or `w` (1 week) or `m` (1 month) or `y` (1 year).

`aminsteps <AXIS> <steps>`

Defines the number of minor ticks between two major ticks.

`atimeformat <AXIS> <format>`

Defines the format used for the displaying time values on time axis (time format tokens).

`atrigger <AXIS> <trigger>`

This allows to define a trigger, a number where a tick should appear and all other ticks should depend on.

`ascalexpr <AXIS> <expr>`

This allows scaling of axis numbers without changing the data itself. For example, to display seconds instead of milliseconds enter `v/1000` in this field. v is the variable which represents the axis number.

`aexpoffset <AXIS> <offset>`

Allows you to define the limit, above which numbers are plotted in exponential notation. The number you define is the exponent of the limit.

`adecplaces <AXIS> <n>`

Defines the number of decimal places for axis numbers.

`adecplacesauto <AXIS> <bool>`

If enabled the number of decimal places for axis numbers will be determined automatically (possible values: yes/no).

`aformat <AXIS> <format>`

Defines the axis format (0=linear, 1=logarithmic, 2=time).

`asetsmalllogzero <AXIS> <bool>`

If enabled the smallest value on a logarithmic axis will be replaced with 0 (even if this is not correct) (possible values: yes/no).

`atext <AXIS> <text>`

Defines the axis text label.

`anumfont <AXIS> <font> <size>`

Defines the font for axis numbers.

`anumoffset <AXIS> <offset>`

The distance between numbers and frame.

`anumalign <AXIS> <align>`

Defines the alignment of axis numbers.
`<align>`: The text box alignment.

`anumangle <AXIS> <angle>`

Defines the angle for axis numbers.

`atextfont <AXIS> <font> <size>`

Defines the font for axis text labels.

`atextoffset <AXIS> <offset>`

The distance between text label and frame.

`atextoffsetwindow <AXIS> <bool>`

If defined the axis text offset is the distance from the window frame.

`asetnum <AXIS> <bool>`

Enable or disable axis numbers (possible values: yes/no).

`asettext <AXIS> <bool>`

Enable or disable axis text labels (possible values: yes/no).

`asetfliptext <AXIS> <bool>`

Enable or disable flipped axis text labels (possible values: yes/no).

`atextcolor <AXIS> <c> <c> <c> [a]`
`atextcolor <AXIS> <COLOR>`

Defines the color for axis numbers and text. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With a the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`asetzeroline <AXIS> <bool>`

Enable or disable a line at the value zero (possible values: yes/no).

`azerolinecolor <AXIS> <c> <c> <c> [a]`
`azerolinecolor <AXIS> <COLOR>`

Defines the color for zero lines. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With a the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`aticklength <AXIS> <length>`

Defines the tick length.

`aminticklength <AXIS> <length>`

Defines the minor tick length.

`atickwidth <AXIS> <width>`

Defines the tick width.

`amintickwidth <AXIS> <width>`

Defines the minor tick width.

`asetticks <AXIS> <bool>`

Enable or disable axis ticks (possible values: yes/no).

`asetminticks <AXIS> <bool>`

Enable or disable axis minor ticks (possible values: yes/no).

`asetticksbothsides <AXIS> <bool>`

Enable or disable axis ticks on both sides of the frame (possible values: yes/no).

`asetminticksbothsides <AXIS> <bool>`

Enable or disable axis minor ticks on both sides of the frame (possible values: yes/no).

`atickcolor <AXIS> <c> <c> <c> [a]`
`atickcolor <AXIS> <COLOR>`

Defines the tick color. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With a the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`amintickcolor <AXIS> <c> <c> <c> [a]`
`amintickcolor <AXIS> <COLOR>`

Defines the minor tick color. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With a the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`atickstyle <AXIS> <style>`

Defines the tick style (0=inside, 1=outside, 2=both)

`asetgrid <AXIS> <bool>`

Enable or disable the grid (possible values: yes/no).

`asetmingrid <AXIS> <bool>`

Enable or disable the minor grid (possible values: yes/no).

`agridcolor <AXIS> <c> <c> <c> [a]`
`agridcolor <AXIS> <COLOR>`

Defines the grid color. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With a the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`amingridcolor <AXIS> <c> <c> <c> [a]`
`amingridcolor <AXIS> <COLOR>`

Defines the minor grid color. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With a the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`agridwidth <AXIS> <width>`

Defines the grid width.

`amingridwidth <AXIS> <width>`

Defines the minor grid width.

`agridpattern <AXIS> <pattern>`

Defines the grid dash pattern (0-15).

`amingridpattern <AXIS> <pattern>`

Defines the minor grid pattern (0-15).

`agridfront <AXIS> <bool>`

Defines if the grid should be drawn in front or not (possible values: yes/no).

`amingridfront <AXIS> <bool>`

Defines if the minor grid should be drawn in front or not (possible values: yes/no).

`alabel <AXIS> <number> <replacement>`

Defines an axis number replacement

`aclearlabels <AXIS>`

Delete all axis number replacement

# Macro Language: Legend Commands

`setlegend <bool>`

Enable or disable the legend (possible values: yes/no).

`legendpos <x> <y>`

Defines the legend position.

`setlegendbg <bool>`

Enable or disable legend background (possible values: yes/no).

`setlegendhorizontal <bool>`

If set draw legend entries horizontal.

`legendalign <align>`

Defines the alignment of the legend box

`legendlength <length>`

Defines the length of legend lines.

`legendspace <space>`

Defines the vertical space between two legend entries.

`legendcolor <c> <c> <c> [a]`
`legendcolor <COLOR>`

Defines the color for the legend text. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With a the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`legendbgcolor <c> <c> <c> [a]`
`legendbgcolor <COLOR>`

Defines the legend background color. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command color mode (0=RGB, 1=HSB). With a the alpha value can be defined (default is 1.0). Alternative you can specify the color as hexadecimal string.

`legendfont <font> <font size>`

Defines the legend font.

# Macro Language: Text & Graphic Commands

`text <tag> <x> <y> <font> <font size> <text> [c] [c] [c] [angle] [align] [pos] [offset] [cb] [cb] [cb]`

Adds a text label to the document.
`<tag>`: The `tag` argument should be an integer value which can be used later to address a graphic or text object. Interactively created text or graphic objects always have the tag 0.
`<x>`, `<y>`: the position in screen coordinates of the text.
`<font>`: The font for the text (e.g. Helvetica-Bold)
`<font size>`: The font size of the text.
`[c] [c] [c]`: The color of the text. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB).
`[angle]`: The text angle.
`[align]`: The text alignment (0=left, 1=center, 2=right).
`[pos]`: The position for automatically positioned text label (0=off, 1-21 fixed text positions).
`[offset]`: Offset for automatically positioned text label.
`[cb] [cb] [cb]`: The color of the text background. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB).

`ftext <tag> <COOR> <x> <y> <font> <font size> <text> [c] [c] [c] [angle] [align] [tbalign] [cb] [cb] [cb]`

Adds a floating text label to the document.
`<tag>`: The `tag` argument should be an integer value which can be used later to address a graphic or text object. Interactively created text or graphic objects always have the tag 0.
`<COOR>`: The coordinate system to which the rectangle belongs.
`<x>`, `<y>`: the position of the text in the defined coordinate system.
`<font>`: The font for the text (e.g. Helvetica-Bold)
`<font size>`: The font size of the text.
`[c] [c] [c]`: The color of the text. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB).
`[angle]`: The text angle.
`[align]`: The text alignment (0=left, 1=center, 2=right).
`[tbalign]` : The text box alignment.
`[pos]`: The position for automatically positioned text label (0=off, 1-21 fixed text positions).
`[offset]`: Offset for automatically positioned text label.
`[cb] [cb] [cb]`: The color of the text background. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB).

`qtext <COOR> <x> <y> <text> [angle] [align] [tbalign] [COLOR]`

Adds a text label to the document. This command uses the default color and the default font. The generated text label has the tag 999.
`<COOR>`: The coordinate system to which the rectangle belongs.
`<x>`, `<y>`: the position in screen coordinates of the text.
`[angle]`: The text angle.
`[align]`: The text alignment (0=left, 1=center, 2=right).
`[tbalign]`: The text box alignment.
`[COLOR]`: The text color as hexadecimal string.

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

Adds an auto positioning text label to the document. This command uses the default color and the default font. The generated text label has the tag 998.
`[pos]`: The position for automatically positioned text label (valid values are 1-21).
`[angle]`: The text angle (can be 0, 90, 180 or 270).
`[offset]`: Offset for automatically positioned text label.
`[COLOR]`: The text color as hexadecimal string.

`rect <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [c] [c] [c]`
`rect <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [COLOR]`

Draw a rectangle with the given attributes.
`<tag>`: The `tag` argument should be an integer value which can be used later to address a graphic or text object. Interactively created text or graphic objects always have the tag 0.
`<COOR>`: The coordinate system to which the rectangle belongs.
`<x>`, `<y>`: The position of the rectangle in the defined coordinate system.
`<w>`, `<h>`: The size of the rectangle in the defined coordinate system.
`[linewidth]`: The rectangles line width.
`[dash]`: The dash pattern for the rectangle (0-15).
`[c] [c] [c]`: The color of the rectangle. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB). Alternative you can specify the color as hexadecimal string.

`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]`

Draw a filled rectangle with the given attributes.
`<tag>`: The `tag` argument should be an integer value which can be used later to address a graphic or text object. Interactively created text or graphic objects always have the tag 0.
`<COOR>`: The coordinate system to which the rectangle belongs.
`<x>`, `<y>`: The position of the rectangle in the defined coordinate system.
`<w>`, `<h>`: The size of the rectangle in the defined coordinate system.
`[linewidth]`: The rectangles line width.
`[dash]`: The dash pattern for the rectangle (0-15).
`[c] [c] [c]`: The color of the rectangle. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB). Alternative you can specify the color as hexadecimal string.
`[cf] [cf] [cf]`: The fill color of the rectangle. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB). Alternative you can specify the color as hexadecimal string.

`circle <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [c] [c] [c]`
`circle <tag> <COOR> <x> <y> <w> <h> [linewidth] [dash] [COLOR]`

Draw a circle with the given attributes.
`<tag>`: The `tag` argument should be an integer value which can be used later to address a graphic or text object. Interactively created text or graphic objects always have the tag 0.
`<COOR>`: The coordinate system to which the circle belongs.
`<x>`, `<y>`: The position of the circle in the defined coordinate system.
`<w>`, `<h>`: The size of the circle of the defined coordinate system.
`[linewidth]`: The circles line width.
`[dash]`: The dash pattern for the circle (0-15).
`[c] [c] [c]`: The color of the circle. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB). Alternative you can specify the color as hexadecimal string.

`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]`

Draw a filled circle with the given attributes.
`<tag>`: The `tag` argument should be an integer value which can be used later to address a graphic or text object. Interactively created text or graphic objects always have the tag 0.
`<COOR>`: The coordinate system to which the circle belongs.
`<x>`, `<y>`: The position of the circle in the defined coordinate system.
`<w>`, `<h>`: The size of the circle of the defined coordinate system.
`[linewidth]`: The circles line width.
`[dash]`: The dash pattern for the circle (0-15).
`[c] [c] [c]`: The color of the circle. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB). Alternative you can specify the color as hexadecimal string.
`[cf] [cf] [cf]`: The fill color of the circle. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB). Alternative you can specify the color as hexadecimal string.

`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]`

Draw an arrow with the given attributes.
`<tag>`: The `tag` argument should be an integer value which can be used later to address a graphic or text object. Interactively created text or graphic objects always have the tag 0.
`<COOR>`: The coordinate system to which the arrow belongs.
`<x1>`, `<y1>`, `<x2>`, `<y2>`: The start and end position of the arrow in the defined coordinate system.
`<a1>`, `<a2>`: Draw arrow at line start and/or end (possible values: yes/no)
`<at>`: The arrow type (0=open, 1=closed, 2=triangle, 3=double).
`<as>`: The arrow size.
`[linewidth]`: The arrow line width.
`[dash]`: The dash pattern for the arrow (0-15).
`[c] [c] [c]`: The color of the arrow. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB). Alternative you can specify the color as hexadecimal string.

`line <tag> <COOR> <x1> <y1> <x2> <y2> [linewidth] [dash] [c] [c] [c]`
`line <tag> <COOR> <x1> <y1> <x2> <y2> [linewidth] [dash] [COLOR]`

Draw a line with the given attributes.
`<tag>`: The `tag` argument should be an integer value which can be used later to address a graphic or text object. Interactively created text or graphic objects always have the tag 0.
`<COOR>`: The coordinate system to which the line belongs.
`<x1>`, `<y1>`, `<x2>`, `<y2>`: The start and end position of the line in the defined coordinate system.
`[linewidth]`: The line width.
`[dash]`: The dash pattern for the line (0-15).
`[c] [c] [c]`: The color of the line. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB). Alternative you can specify the color as hexadecimal string.

`bgraphic [tag]`

By default graphic objects will be placed in the foreground of the document. With this command you can send graphic objects to the background.

`rmtext [tag]`

Remove text objects with a given tag or all text objects.

`rmgraphic [tag]`

Remove graphic objects with a given tag or all graphic objects.

`defaultfont <font> <font size>`

Defines a default font for all text and graphic commands.

`defaultcolor <c> <c> <c>`
`defaultcolor <COLOR>`

Defines a default color for all text and graphic commands.
`<c> <c> <c>`: The color of the circle. Dependent on the color mode the three values are RGB or HSB values from 0.0 to 1.0. The color mode can be set with the command `colormode` (0=RGB, 1=HSB). Alternative you can specify the color as hexadecimal string.

# Macro Language: Document Commands

`new`

Opens a new document.

`close`

Close the current document window.

`open <filename>`

Opens the document with the given filename.

`save`

Save the current document.

`saveas <filename>`

Save document to a new file.

`savepng <filename> [resolution]`

Save document as a PNG file. Resolution can be 0 (low), 1 (normal, default) or 2 (high).

`savejpg <filename> [resolution]`

Save document as JPG file. Resolution can be 0 (low), 1 (normal, default) or 2 (high).

`savepdf <filename>`

Save document as PDF file.

`saveeps <filename>`

Save document as EPS file.

`printdoc`

Print the current document.

`export <filename> <mode> <BUFFER>`

Export ASCII data to file.
`<filename>`: Export data to this file.
`<mode>`: Export mode (0=all columns, 1=X,Y,ErrorY, 2=X,Y,ErrorX, 3=X, 4=Y).
`<BUFFER>`: Exported data buffer (Only one data buffer can be exported).

`import <filename> <mode> [separator] [xcol] [noxcol] [comment] [ignore] [comment sequence] [only number lines] [time format] [comma separator] [period separator] [timezone] [white spaces]`

Import an ASCII file
`<mode>`: Import mode (0=multicolumn, 1=error values).
`[separator]`: Defines the field separator for ASCII import.
`[xcol]`: Defines the X column starting with 1 as the first column.
`[noxcol]`: If true all columns will be interpreted as Y values and the X values will be generated as sequence number.
`[comment]`: Overwrites the default comment for the imported buffers.
`[ignore]`: Lines containing this string will be ignored.
`[comment sequence]`: Anything in a line behind this sequence will be ignored for import.
`[only number lines]`: If true import ignores all lines which not begin with a number.
`[no time]`: If true don't try to import time values
`[time format]`: custom time format for x column import.
`[comma separator]`: If true treat comma as field separator
`[period separator]`: If true treat period as field separator.
`[timezone]`: set the timezone for time values.
`[white spaces]`: If true import ignores leading white spaces in lines.

Example:

      import $file \       # filename
           0 \             # mode
           '' \            # separator
           1 \             # x col
           NO \            # no x col
           'comment' \     # comment
           '' \            # ignore
           '' \            # comment sequence
           YES \           # only num lines
           NO \            # notime
           'yyyy-MM-dd' \  # time format
           NO \            # comma separator
           NO \            # period separator
           '' \            # time zone
           NO              # whitespace

`binaryimport <filename> <type> <mode> <swap> <columns> [comment]`

Performs a binary import of data.
`<type>`: Defines the data type (0=double (64bit), 1=float (32bit), 2=integer (32 bit), 3=integer (16 bit)).
`<mode>`: Defines the import mode (0=column mode, 1=block mode).
`<swap>`: Enables or disables byte order swapping.
`<columns>`: The number of columns to import.

`mysqlimport <host> <db> <user> <password> <port> <sql>`

Import data from MySQL database.

`perlimport <filename> [name]`

This executes a Perl import filter for the given file. Look in the perl import section for detailed information.
If no `name` is given the inline Perl block will be used. This is a block in your macro starting with a line containing `PERL` and ending with a line containing `PERL`. The default timeout for Perl scripts is 10 seconds. After this time the Perl job will be killed to prevent never come back jobs. You can set the timeout individual with the `perltimout <sec>` macro command.

`perlfilter <BUFFER> [name]`

This executes a Perl filter for the given buffers. Look in the perl filter section for detailed informations.
If no `name` is given the inline Perl block will be used. This is a block in your macro starting with a line containing `PERL` and ending with a line containing `PERL`. The default timeout for Perl scripts is 10 seconds. After this time the Perl job will be killed to prevent never come back jobs. You can set the timeout individual with the `perltimout <sec>` macro command

`subview <width> <height> <x> <y>`

Add a subview to the document.

`sizeview <width> <height> <x> <y>`

Change the size and position of the current subview

`changeview <subview number>`

Change the current view where 0 ist the main view.

`deleteview <subview number | all>`

Delete one or all subviews

# Macro Language: Miscellaneous Commands

`colormode <mode>`

With this command you can define if colors will be defined as RGB or HSB (0=RGB, 1=HSB).

`list`

List all data buffer on console

`exit`

Stop macro.

`clr`

Clears the console output.

`setvar <var> <expr>`
`<var>=<expr>`

Defines a variable.

`setstring <var> <value>`
`$<var>=<expr>`

Defines a string variable.

`eval <name> <expr>`

Evaluates the expression and defines the result as a string variable.

`format <name> <format> <expr> ... <expr>`

Returns a string created with the given format string. The format can be defined in the usual `printf` notation.

`forecast <lon> <lat> [field]`

Returns a complete set of weather forecast data (10 days) and weather history (14 days). If field is not given all 12 data sets will be loaded. To get a specific data set add one of the following codes:

0 | temperature (°C) | 6 | cloud cover
1 | surface temperature (°C) | 7 | wind direction
2 | dew point (°C) | 8 | wind speed
3 | humidity (%) | 9 | wind gusts (m/s)
4 | pressure (hPa) | 10 | CAPE (J/Kg)
5 | rain (mm) | 11 | KP index