MGL script language

Reference manual for v.1.8

Alexey Balakin, 2007

Contents

  1. Introduction
  2. Graphics setup
  3. Scaling, moving and rotating
  4. Axis functions
  5. Primitive drawing functions
  6. 1d plotting commands
  7. 2d plotting commands
  8. 3d plotting commands
  9. Dual plotting commands
  10. Other plotting function
  11. Program flow commands
  12. Data creation and file I/O
  13. New data extraction (forming)
  14. Data handling
  15. Nonlinear fitting
  16. Color specification
  17. Line style specification
  18. Color scheme specification
  19. Text and font specification
  20. Formulas and functions
  21. Command options
  22. Suffixes for variable

1. Introduction

MathGL library supports (from version 1.3) the simplest scripts for data handling and plotting. These scripts can be used independently (with the help of mgl2png, mgl2eps, mgl2svg programs and others) or in the frame of the library using.

MGL script language is rather simple. Each string is a command. First word of string is the name of command. Other words are command arguments. Command may have up to 1000 arguments (at least for now). Words are separated from each other by space or tabulation symbol. The upper or lower case of words is suficient, i.e. variables a and A are different variables. Symbol # starts the comment (all characters after # will be ignored). The exception is situation when # is a part of some string. Also options can be specified at the end of string (after symbol ';', see Sec. Command options).

If string contain references to external parameters (substrings "$0", "$1" ... "$9") then before execution the values of parameter will be substituted instaed of reference. It allows to use the same MGL script for different parameters (filenames, paths, condition and so on).

Argument can be a string, a variable name or a number.