[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.1 Basic usage
MathGL library can be used by several manners. Each has positive and negative sides:
-
Using of MathGL library features for creating graphical window (requires FLTK, Qt or GLUT libraries).
Positive side is the possibility to view the plot at once and to modify it (rotate, zoom or switch on transparency or lighting) by hand or by mouse. Negative sides are: the need of X-terminal and limitation consisting in working with the only one set of data at a time.
-
Direct writing to file in bitmap or vector format without creation of graphical window.
Positive aspects are: batch processing of similar data set (for example, a set of resulting data files for different calculation parameters), running from the console program (including the cluster calculation), fast and automated drawing, saving pictures for further analysis (or demonstration). Negative sides are: the usage of the external program for picture viewing. Also, the data plotting is non-visual. So, you have to imagine the picture (view angles, lighting and so on) before the plotting. I recommend to use graphical window for determining the optimal parameters of plotting on the base of some typical data set. And later use these parameters for batch processing in console program.
-
Drawing in memory with the following displaying by other graphical program.
In this case the programmer has more freedom in selecting the window libraries (not only FLTK, Qt or GLUT), in positioning and surroundings control and so on. I recommend to use such way for “stand alone” programs.
-
Using FLTK or Qt widgets provided by MathGL
Here one can use a set of standard widgets which support export to many file formats, copying to clipboard, handle mouse and so on.
MathGL drawing can be created not only by object oriented languages (like, C++ or Python), but also by pure C or Fortran-like languages. The usage of last one is mostly identical to usage of classes (except the different function names). But there are some differences. C functions must have argument HMGL (for graphics) and/or HMDT (for data arrays) which specifies the object for drawing or manipulating (changing). Fortran users may regard these variables as integer. So, firstly the user has to create this object by function mgl_create_*() and has to delete it after the using by function mgl_delete_*().
Let me consider the aforesaid in more detail.
2.1.1 Using MathGL window | ||
2.1.2 Drawing to file | ||
2.1.3 Animation | ||
2.1.4 Drawing in memory | ||
2.1.5 Using QMathGL | ||
2.1.6 MathGL and PyQt | ||
2.1.7 MathGL and MPI |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on March 21, 2014 using texi2html 5.0.