| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1.5 FAQ
- The plot does not appear
Check that points of the plot lie inside the bounding box and resize the bounding box by
Axis()function. Check that the data have correct dimensions for selected type of plot. Be sure thatFinish()is called after the plotting functions (or be sure that the plot is saved to file).- I can not find some special kind of plot.
Most of “new” type of plot can be created by using of the existing drawing functions. For example, the surface of curve rotation can be created by special function
Torus()or as parametrically specified surfaceSurf(). See also, Hints and MathGL examples of MathGL. If you can not find some type of plot then e-mail me and this plot will appear in the next version of MathGL library.- Should I know some graphical libraries (like OpenGL) for the using of MathGL library?
No. The MathGL library is self-consistent and does not require the knowledge of external libraries.
- In which language the library is written? For which languages the library has interface?
The core of MathGL library is written on C++. But there are interfaces for pure C, Fortran, Pascal, Forth languages and its own command language MGL. Also there are a large set of interpreter languages support (Python, Java, ALLEGROCL, CHICKEN, Lisp, CFFI, C#, Guile, Lua, Modula 3, Mzscheme, Ocaml, Octave, Perl, PHP, Pike, R, Ruby, Tcl). These interfaces are written via SWIG (both pure C functions and classes) but only interface for Python and Octave is included in autoconf/automake script. The matter that I don't know any other interpreter languages :(. Note, the most of other languages can use (can link) pure C functions.
- I have class Foo and drawing method Foo::draw(mglGraph *gr). How I can use it in FLTK or GLUT window?
The member-functions of classes have hidden parameter (the pointer to a class instance) in C++. So, their direct usage is impossible. The solution is to write interface function:
int foo_draw(mglGraph *gr, void *par) { ((Foo *)foo)->draw(gr); }and to use it in the call of
Window()function:gr->Window(argc,argv,foo_draw,"Title",this);
Alternatively you can inherit yours class from
mglDrawclass and use functions likegr->Window(argc, argv, foo, "Title");.- How can I print in Russia/Spanish/Arabian/Japanese and so on?
The standard way is the using of Unicode encoding for the text output. But MathGL library also has interface for 8-bit (char *) strings with internal conversion to Unicode. This conversion depends on the current locale OS. You may change it by
setlocale()function. For example, for Russian text in CP1251 encoding you may usesetlocale(LC_CTYPE, "ru_RU.cp1251");(under MS Windows the name of locale may differ –setlocale(LC_CTYPE, "russian_russia.1251")). I strongly recommend not to use the constantLC_ALLin conversion. Because it also changes the number format that may lead to mistakes in formulas writing and reading textual data files. For example, the program will await a ‘,’ as a decimal point but the user will enter ‘.’.- How can I exclude a point or a region of plot from the drawing?
There are 3 general ways. First, the point with
NANvalue of one of coordinate will never be plotted. Second, special variables CutMin, CutMax or functionCutOff() define the condition when the points should be omitted (see section Cutting). Last, you may change the transparency of part of the plot by the help of functionsSurfA(),Surf3A()(see section Dual plotting). In last case the transparency is switched on smoothly.- I use VisualStudio, CBuilder or some other compiler (not MinGW/gcc). How can I link MathGL library?
There are 2 ways. First is use the precompiled binary (*.dll). In this case you should make libraries for yours compiler from *.dll and *.def files. The corresponding command may look like
lib.exe /def:libmgl.def. But such way provide you only pure C functions, not C++ classes. The matter is that there is no standard for C++ functions naming in object files. The standard was accepted only for C functions.The second way is to compile the library from sources. MathGL library have some external dependencies (PNG, GSL, JPEG, TIFF, FLTK, GLUT, HDF5), but most of them is optional. Some libraries can be found here. But also you may exclude from the project the corresponding files to disable usage of JPEG, TIFF, FLTK, GLUT, HDF5 libraries. Also you may define
NO_GSLat compilation stage for disabling GSL support. At this some special functions in formulas, Fourier transform and nonlinear fitting will be disabled also.For excluding PNG support just comment the body of functions
mgl_pnga_save(), mgl_png_save()inmgl_export.cpp. After it MathGL library will not depend on any external libraries. But in this case you should redirect the output to some window (as bitmap drawing from mglGraphZB|PS::GetBits() or mglGraphZB|PS::GetRGBA()) and save this bitmap to a file by yourself.Finally! Please do not ask me Windows-specific questions. I do not use Windows. I know nothing about Visual Basic, Visual C++, CBuiled or .NET. Please find the appropriate Usenet discussion group and ask your question there.
- How many people write this library?
The most of the library was written by one person. This is result of near a year of work (mostly in the evening and in holidays): half-year I spent for writing the kernel and half-year or year I spent for extending, improving and documentation writing. This process continues now :). The autoconf/automake script was written mostly by D.Kulagin, and export to IDTF was written mostly by M.Vidassov. Packages to particular platform (RPM or DEB) are prepared by other people (thanks to D. Kulagin, S. Plis, V. Lipatov and N. Troitsky).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
