void mgl_data_hankel(HMDT dat, const char *dir);\r
void mgl_data_sinfft(HMDT dat, const char *dir);\r
void mgl_data_cosfft(HMDT dat, const char *dir);\r
-void mgl_data_fill_sample(HMDT dat, long num, const char *how);\r
+void mgl_data_fill_sample(HMDT dat, const char *how);\r
\r
float mgl_data_spline(HCDT dat, float x,float y,float z);\r
float mgl_data_linear(HCDT dat, float x,float y,float z);\r
void mgl_data_hankel_(uintptr_t *dat, const char *dir,int);\r
void mgl_data_sinfft_(uintptr_t *dat, const char *dir,int);\r
void mgl_data_cosfft_(uintptr_t *dat, const char *dir,int);\r
-void mgl_data_fill_sample_(uintptr_t *dat, int *num, const char *how,int);\r
+void mgl_data_fill_sample_(uintptr_t *dat, const char *how,int);\r
\r
float mgl_data_spline_(uintptr_t *dat, float *x,float *y,float *z);\r
float mgl_data_linear_(uintptr_t *dat, float *x,float *y,float *z);\r
/// Cos-Fourier transform\r
inline void CosFFT(const char *dir) { mgl_data_cosfft(this,dir); }\r
/// Fill data by 'x'/'k' samples for Hankel ('h') or Fourier ('f') transform\r
- inline void FillSample(long n, const char *how)\r
- { mgl_data_fill_sample(this,n,how); }\r
+ inline void FillSample(const char *how)\r
+ { mgl_data_fill_sample(this,how); }\r
\r
/// Interpolate by qubic splain the data to given point x=[0...nx-1], y=[0...ny-1], z=[0...nz-1]\r
inline mreal Spline(mreal x,mreal y=0,mreal z=0) const\r
/// Copy data from other mglData variable\r
inline mglData &operator=(const mglData &d)\r
{ if(this!=&d) Set(d.a,d.nx,d.ny,d.nz); return *this; }\r
- inline mglData &operator=(mreal val)\r
- { for(long i=0;i<nx*ny*nz;i++) a[i]=val; return *this; }\r
+ inline mreal operator=(mreal val)\r
+ { for(long i=0;i<nx*ny*nz;i++) a[i]=val; return val; }\r
/// Multiplicate the data by other one for each element\r
inline void operator*=(const mglData &d) { mgl_data_mul_dat(this,&d); }\r
/// Divide the data by other one for each element\r
uintptr_t mgl_data_stfa_(uintptr_t *re, uintptr_t *im, int *dn, char *dir, int)\r
{ return uintptr_t(mgl_data_stfa(_DA_(re),_DA_(im),*dn,*dir)); }\r
//-----------------------------------------------------------------------------\r
-void mgl_data_fill_sample(HMDT d, long n, const char *how)\r
+void mgl_data_fill_sample(HMDT d, const char *how)\r
{\r
bool xx = strchr(how,'x');\r
- mgl_data_create(d,n,1,1);\r
- register long i;\r
+ register long i,n=d->nx;\r
+ mreal *aa=d->a;\r
if(strchr(how,'h')) // Hankel\r
{\r
#ifndef NO_GSL\r
gsl_dht *dht = gsl_dht_new(n,0,1);\r
for(i=0;i<n;i++)\r
- d->a[i] = xx ? gsl_dht_x_sample(dht, i) : gsl_dht_k_sample(dht, i);\r
+ aa[i] = xx ? gsl_dht_x_sample(dht, i) : gsl_dht_k_sample(dht, i);\r
gsl_dht_free(dht);\r
#endif\r
}\r
else // Fourier\r
{\r
- if(xx) for(i=0;i<n;i++) d->a[i] = mreal(2*i-n)/n;\r
- else for(i=0;i<n;i++) d->a[i] = M_PI*(i<n/2 ? i:i-n);\r
+ if(xx) for(i=0;i<n;i++) aa[i] = mreal(2*i-n)/n;\r
+ else for(i=0;i<n;i++) aa[i] = M_PI*(i<n/2 ? i:i-n);\r
}\r
+ for(i=1;i<d->ny*d->nz;i++) memcpy(aa+i*n,aa,n*sizeof(mreal));\r
}\r
-void mgl_data_fill_sample_(uintptr_t *d, int *num, const char *how,int l)\r
+void mgl_data_fill_sample_(uintptr_t *d, const char *how,int l)\r
{ char *s=new char[l+1]; memcpy(s,how,l); s[l]=0;\r
- mgl_data_fill_sample(_DT_,*num,s); delete []s; }\r
+ mgl_data_fill_sample(_DT_,s); delete []s; }\r
//-----------------------------------------------------------------------------\r
void mgl_data_hankel(HMDT d, const char *dir)\r
{\r
if(k[2]==2 && (k[3]!=3 || a[3].v!=0)) gr->Fill(*(a[0].d), a[2].s.c_str());
else if(k[2]==2) a[0].d->Modify(a[2].s.c_str());
}
- else if(k[0]==1 && k[1]==2)
- {
- a[0].d->Create(1,1,1);
- a[0].d->a[0] = a[1].v;
- }
+ else if(k[0]==1 && k[1]==3) *(a[0].d) = a[1].v;
else return 1;
return 0;
}
mglprintf(out,1024,L"%s.Set(%s);\t%s.Modify(\"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str());
else if(k[0]==1 && k[1]==1)
mglprintf(out,1024,L"%s.Set(%s);", a[0].s.c_str(), a[1].s.c_str());
- else if(k[0]==1 && k[1]==2)
- mglprintf(out,1024,L"%s.Create();\t%s.a[0]=%g;", a[0].s.c_str(), a[0].s.c_str(), a[1].v);
+ else if(k[0]==1 && k[1]==3)
+ mglprintf(out,1024,L"%s = %g;", a[0].s.c_str(), a[1].v);
}
//-----------------------------------------------------------------------------
int mgls_cont(mglGraph *gr, long , mglArg *a, int k[10], const char *opt)
//-----------------------------------------------------------------------------
int mgls_fillsample(mglGraph *, long , mglArg *a, int k[10], const char *)
{
- if(k[0]==1 && k[1]==3 && k[2]==2) a[0].d->FillSample(iint(a[1].v), a[2].s.c_str());
+ if(k[0]==1 && k[1]==2) a[0].d->FillSample(a[1].s.c_str());
else return 1;
return 0;
}
void mglc_fillsample(wchar_t out[1024], long , mglArg *a, int k[10], const char *)
{
- if(k[0]==1 && k[1]==3 && k[2]==2)
- mglprintf(out,1024,L"%s.FillSample(%d, \"%s\");", a[0].s.c_str(), iint(a[1].v), a[2].s.c_str());
+ if(k[0]==1 && k[1]==2)
+ mglprintf(out,1024,L"%s.FillSample(\"%s\");", a[0].s.c_str(), a[1].s.c_str());
}
//-----------------------------------------------------------------------------
int mgls_fog(mglGraph *gr, long , mglArg *a, int k[10], const char *)
if(k[0]==3) mglprintf(out,1024,L"gr->SetTranspType(%d);", iint(a[0].v));
}
//-----------------------------------------------------------------------------
+int mgls_fourier(mglGraph *, long , mglArg *a, int k[10], const char *)
+{
+ if(k[0]==1 && k[1]==1 && k[2]==2)
+ mglFourier(*(a[0].d),*(a[1].d),a[2].s.c_str());
+ else return 1;
+ return 0;
+}
+void mglc_fourier(wchar_t out[1024], long , mglArg *a, int k[10], const char *)
+{
+ if(k[0]==1 && k[1]==1 && k[2]==2)
+ mglprintf(out,1024,L"mglFourier(%s, %s, \"%s\");",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str());
+}
+//-----------------------------------------------------------------------------
int mgls_transform(mglGraph *, long , mglArg *a, int k[10], const char *)
{
if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1)
{"fall","Draw waterfalls","fall Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_fall, mglc_fall,0},
{"fgets","Print string from file","fgets x y z 'fname' [pos=0 'fmt' size]|x y z 'fname' [pos=0 'fmt' size]", mgls_fgets, mglc_fgets,1},
{"fill","Fill data linearly in range [v1, v2]","fill Var v1 v2 ['dir'] | Var 'eq' [Vdat Wdat]", mgls_fill, mglc_fill,3},
- {"fillsample","Fill x-,k-samples for transforms","fillsample Var num 'how'", mgls_fillsample, mglc_fillsample,4},
+ {"fillsample","Fill x-,k-samples for transforms","fillsample Var 'how'", mgls_fillsample, mglc_fillsample,3},
{"fit","Fit data to formula","fit Res A 'eq' 'var' [Ini]|Res X A 'eq' 'var' [Ini]|Res X Y A 'eq' 'var' [Ini]|Res X Y Z A 'eq' 'var' [Ini]", mgls_fit, mglc_fit,4},
{"fits","Fit data to formula","fits Res A S 'eq' 'var' [Ini]|Res X A S 'eq' 'var' [Ini]|Res X Y A S 'eq' 'var' [Ini]|Res X Y Z A S 'eq' 'var' [Ini]", mgls_fits, mglc_fits,4},
{"flow","Draw flow threads for vector field","flow Udat Vdat ['fmt' num]|Xdat Ydat Udat Vdat ['fmt' num]|Udat Vdat Wdat ['fmt' num]|Xdat Ydat Zdat Udat Vdat ['fmt' num]|\
{"fog","Switch on/off fog","fog val [pos]", mgls_fog, mglc_fog,2},
{"font","Setup font","font 'fmt' [size]", mgls_font, mglc_font,2},
{"for","For cycle","for $N v1 v2 [dv] | $N Dat", 0, 0, 6},
+ {"fourier","In-place Fourier transform","fourier ReDat ImDat 'dir'", mgls_fourier, mglc_fourier, 3},
{"fplot","Plot curve by formula","fplot 'y(x)' ['fmt' num]|'x(t)' 'y(t)' 'z(t)' ['fmt' num]", mgls_fplot, mglc_fplot,1},
{"fsurf","Plot surface by formula","fsurf 'z(x,y)' ['fmt' num]|'x(u,v)' 'y(u,v)' 'z(u,v)' ['fmt' num]", mgls_fsurf, mglc_fsurf,1},
{"func","Start function definition and stop execution of main script","func 'name' [narg]", 0, 0, 6},
+++ /dev/null
-
-@c ------------------------------------------------------------------
-@chapter Plotter classes
-@cindex mglGraphAB
-@cindex mglGraphZB
-@cindex mglGraphPS
-@cindex mglGraphGL
-@cindex mglGraphIDTF
-
-The class mglGraph (@pxref{MathGL core}) provide the basic tools for creating scientific graphics but it is abstract class. The matter is that there are several possible way to draw a graphics: in bitmap, in vector file, using OpenGL and so on. As result, user should use some of derived classes to do actual drawing. In principle, it is possible to derive a class exactly from mglGraph (and it was in v.1.6). But I recommend to derive from mglGraphAB class for higher compatibility of produced graphics from different classes. Class mglGraphAB is another abstract class which provide basic coordinates transformation, plotting functions and export to bitmap picture. It still require a functions for drawing lines, triangles and quadrangles. So below a set of ``plotter'' classes with short comments.
-
-@deftp {Class} mglGraphAB
-Abstract class mglGraphAB implements plotting function for 1D, 2D and 3D plots using Z-ordering and provides base functionality for to screen coordinate transformation, bitmap creation and so on. Class is defined in @code{#include <mgl/mgl_ab.h>}.
-@end deftp
-
-@deftp {Class} mglGraphZB
-Class mglGraphZB implements plotting function for 1D, 2D and 3D plots using Z-Buffer. It is useful for off-screen (for console or SSH terminal) programs. Also this class can be used in any other programs which may draw bitmap on the screen (for example, by using FLTK, Qt, wxWidgets libraries and so on). Note that bitmap picture is saved while exporting to EPS format. The produced graphics have better quality but slower in comparison with graphics in the class mglGraphPS. Class is defined in @code{#include <mgl/mgl_zb.h>}.
-@end deftp
-
-@deftp {Class} mglGraphPS
-Class mglGraphPS implements plotting functions for 1D, 2D and 3D plots and exports them to PostScript or SVG file. It is useful for off-screen (for console or SSH terminal) programs. Note that there is no transparency support now and color interpolation and lightning support is limited (not so nice as in class mglGraphZB). As result the plots with transparency (SurfA, Surf3A, CloudP, CloudQ) may look not so good. However the speed of drawing is higher in comparison with one in the class mglGraphZB. Class is defined in @code{#include <mgl/mgl_eps.h>}.
-@end deftp
-
-@deftp {Class} mglGraphGL
-Class mglGraphGL implements plotting function for 1D, 2D and 3D plots under OpenGL. This class can not be used in off-screen applications. Note, that several transparent overlapped surfaces are drawn not so correctly due to OpenGL limitations. Class is defined in @code{#include <mgl/mgl_gl.h>}.
-@end deftp
-
-@deftp {Class} mglGraphIDTF
-Class mglGraphIDTF implements plotting function for 1D, 2D and 3D plots and export it in IDTF format. Later this file can be converted in U3D format. Class is defined in @code{#include <mgl/mgl_idtf.h>}.
-@end deftp
-
-@menu
-* mglGraphAB class::
-@end menu
-
-@c ------------------------------------------------------------------
-@node mglGraphAB class, , , Plotter classes
-@section mglGraphAB class
-@cindex mglGraphAB
-@cindex window
-@c @cindex mglDraw
-
-Generally this class is a bit less abstract class than mglGraph class (@pxref{MathGL core}). It provide many protected methods for handling intermediate data from mglGraph methods and require a few methods to be defined by derived class. The developers of derived classes should look on file @samp{mgl_ab.h} and comments inside it or contact me.
-
-Here I just show main public methods for class mglGraphAB. There are functions returning the created picture (bitmap), its width and height. You may display it by yourself in any graphical library (see also, @ref{Widget classes}) or save in file (see also, @ref{Export to file}).
-
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{const unsigned char *} GetBits ()
-@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} GetRGB (@code{char *}buf, @code{int} size)
-@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} GetBGRN (@code{char *}buf, @code{int} size)
-@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgb (@code{HMGL} gr)
-Gets RGB bitmap of the current state of the image. Format of each element of bits is: @{red, green, blue@}. Number of elements is Width*Height. Position of element @{i,j@} is [3*i + 3*Width*j] (or is [4*i + 4*Width*j] for @code{GetBGRN()}). For Python you have to provide the proper @var{size} of the buffer, @var{buf} i.e. the code should look like
-@verbatim
-from mathgl import *
-gr = mglGraph();
-bits='\t';
-bits=bits.expandtabs(4*gr.GetWidth()*gr.GetHeight());
-gr.GetBGRN(bits, len(bits));
-@end verbatim
-@end deftypefn
-
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{const unsigned char *} GetRGBA ()
-@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} GetRGBA (@code{char *}buf, @code{int} size)
-@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgba (@code{HMGL} gr)
-Gets RGBA bitmap of the current state of the image. Format of each element of bits is: @{red, green, blue, alpha@}. Number of elements is Width*Height. Position of element @{i,j@} is [4*i + 4*Width*j].
-@end deftypefn
-
-@deftypefn {Method on @code{mglGraphAB} (C++, Python)} @code{int} GetWidth ()
-@deftypefnx {Method on @code{mglGraphAB} (C++, Python)} @code{int} GetHeight ()
-@deftypefnx {C function} @code{int} mgl_get_width (@code{HMGL} gr)
-@deftypefnx {C function} @code{int} mgl_get_height (@code{HMGL} gr)
-Gets width and height of the image.
-@end deftypefn
-
-Class mglGraphAB is the base class for ``widget classes''. So there are set of functions for handling window behavior. Most of them are applicable only for ``window'' classes (like mglGraphFLTK and so on, @pxref{Widget classes}). In all other classes these functions just do nothing. You should provide the corresponding interface in derived ``widget'' classes for user convenience.
-
-@deftypemethod mglGraphAB @code{void} Window (@code{int} argc, @code{char **}argv, @code{int (*}draw)(@code{mglGraph *}gr, @code{void *}p), @code{const char *}title, @code{void *}par=@code{NULL}, @code{void (*}reload)(@code{int} next, @code{void *}p)=@code{NULL}, @code{bool} maximize=@code{false})
-This function creates a window for plotting. Parameters @var{argc}, @var{argv} contain OS specific information and should be the same as in function @code{main(int argc,char **argv)}. Parameter @var{draw} sets a pointer (this is the name of function) to drawing function. There is support of a list of plots (frames). So as one can prepare a set of frames at first and redraw it fast later (but it requires more memory). Function should return positive number of frames for the list or zero if it will plot directly. Note, that @var{draw} can be @code{NULL} for displaying static bitmaps only (no animation or slides). Parameter @var{title} sets the title of the window. Parameter @var{par} contains pointer to data for the plotting function @var{draw}. Parameter @var{maximize}=@code{true} open maximized window.
-
-There are some keys handles for manipulating by the plot: 'a', 'd', 'w', 's' for the rotating; ',', '.' for viewing of the previous or next frames in the list; 'r' for the switching of transparency; 'f' for the switching of lightning; 'x' for hiding (closing) the window.
-
-@strong{IMPORTANT!!!} You need to add a call of Rotate() (@pxref{Transformation matrix}) function for having possibility of plot rotation. If plot should be unrotated by default just add @code{Rotate(0,0)} in drawing function.
-@end deftypemethod
-
-@deftypemethod mglGraphAB @code{void} Window (@code{int} argc, @code{char **}argv, @code{mglDraw *}draw, @code{const char *}title, @code{bool} maximize=@code{false})
-This function is mostly the same as previous one. The only difference is that the drawing function and function for data reloading are specified as methods on a class inherited from class @code{mglDraw}. This class is defined in @code{#include <mgl/mgl_define.h>} and have only 2 methods:
-@verbatim
-class mglDraw
-{
-public:
- virtual int Draw(mglGraph *) { return 0; };
- virtual void Reload(int) {};
-};
-@end verbatim
-You should inherit yours class from @code{mglDraw} and reimplement one or both functions for using this function.
-@end deftypemethod
-
-
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} ToggleAlpha ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_alpha (@code{HMGL} gr)
-Switch on/off transparency but do not overwrite switches in user drawing function.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} ToggleLight ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_light (@code{HMGL} gr)
-Switch on/off lighting but do not overwrite switches in user drawing function.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} ToggleZoom ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_zoom (@code{HMGL} gr)
-Switch on/off zooming by mouse as region selection.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} ToggleRotate ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_rotate (@code{HMGL} gr)
-Switch on/off rotation by mouse. Usually, left button is used for rotation, middle button for shift, right button for zoom/perspective.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} ToggleNo ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_no (@code{HMGL} gr)
-Switch off all zooming and rotation and restore initial state.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} Update ()
-@deftypefnx {C function} @code{int} mgl_wnd_update (@code{HMGL} gr)
-Update window contents.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} ReLoad (@code{bool} o)
-@deftypefnx {C function} @code{int} mgl_wnd_reload (@code{HMGL} gr, @code{int} val)
-Reload user data and update picture.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} Adjust ()
-@deftypefnx {C function} @code{int} mgl_wnd_adjust (@code{HMGL} gr)
-Adjust size of bitmap to window size.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} NextFrame ()
-@deftypefnx {C function} @code{int} mgl_wnd_next_frame (@code{HMGL} gr)
-Show next frame if one.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} PrevFrame ()
-@deftypefnx {C function} @code{int} mgl_wnd_prev_frame (@code{HMGL} gr)
-Show previous frame if one.
-@end deftypefn
-@deftypefn {Method on @code{mglGraphAB} (C++)} @code{void} Animation ()
-@deftypefnx {C function} @code{int} mgl_wnd_animation (@code{HMGL} gr)
-Run/stop slideshow (animation) of frames.
-@end deftypefn
-
-@deftypefn {C function} @code{int} mgl_wnd_set_auto_clf (@code{HMGL} gr, @code{int} val)
-@end deftypefn
-@deftypecv {Widget option} mglGraphAB @code{bool} AutoClf
-Clear canvas between drawing. You may switch it off for accumulate previous drawing (for example some points or parts of a picture).
-@end deftypecv
-
-@deftypefn {C function} @code{int} mgl_wnd_set_delay (@code{HMGL} gr, @code{int} val)
-@end deftypefn
-@deftypecv {Widget option} mglGraphAB @code{float} Delay
-Delay for animation in seconds. Default value is 1 sec.
-@end deftypecv
-
-@deftypefn {Method on @code{mglGraphAB} (C++, Python)} @code{mglPoint} CalcXYZ (@code{int} xs, @code{int} ys)
-@deftypefnx {C function} @code{void} mgl_calc_xyz (@code{HMGL} gr, @code{int} xs, @code{int} ys, @code{float *}x, @code{float *}y, @code{float *}z)
-Calculate 3D coordinate @{x,y,z@} for screen point @{xs,ys@}. At this moment it ignore perspective and transformation formulas (curvilinear coordinates). The calculation are done for the last used InPlot (@pxref{Transformation matrix}).
-@end deftypefn
-
-@deftypefn {Method on @code{mglGraphAB} (C++, Python)} @code{mglPoint} CalcScr (@code{mglPoint} p)
-@deftypefnx {Method on @code{mglGraphAB} (C++)} @code{void} CalcScr (@code{mglPoint} p, @code{int *}xs, @code{int *}ys)
-@deftypefnx {C function} @code{void} mgl_calc_scr (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{int *}xs, @code{int *}ys)
-Calculate screen point @{xs,ys@} for 3D coordinate @{x,y,z@}. The calculation are done for the last used InPlot (@pxref{Transformation matrix}).
-@end deftypefn
-
-@deftypefn {C function} @code{int} mgl_wnd_set_show_mouse_pos (@code{HMGL} gr, @code{int} val)
-@end deftypefn
-@deftypecv {Widget option} mglGraphAB @code{float} ShowMousePos
-Switch to show or not in the widget the last mouse click position.
-@end deftypecv
-
-@deftypecv {Widget option} mglGraphAB @code{mglPoint} LastMousePos
-Last position of mouse click.
-@end deftypecv
-
+++ /dev/null
-
-@c ------------------------------------------------------------------
-@chapter Классы для отрисовки
-@cindex mglGraphAB
-@cindex mglGraphZB
-@cindex mglGraphPS
-@cindex mglGraphGL
-@cindex mglGraphIDTF
-
-Класс mglGraph (@pxref{MathGL core}) обеспечивает базовые функции для создания научной графики, но это абстрактный класс. Причина в том, что существует несколько возможностей вывода/отображения получившегося рисунка: в растровый или в векторный файлы, используя OpenGL и т.д. В результате, для конечной отрисовки необходимо использовать производные классы. В принципе, можно наследовать непосредственно mglGraph (и так было до версии 1.6). Однако, я рекомендую использовать в качестве базового класс mglGraphAB для большего единообразия получающейся графики в различных классах. Класс mglGraphAB -- другой абстрактный класс, обеспечивающий преобразование координат, базовые функции рисования и сохранения в растровое изображение. Он требует доопределения функций рисования линий, треугольников и четырехугольников. Ниже приведены классы ``отрисовки'' с короткими комментариями.
-
-@deftp {Класс} mglGraphAB
-Абстрактный класс, обеспечивающий отрисовку по глубине, преобразование к экранным координатам, сохранение в растровое изображение и т.д. Класс определен в @code{#include <mgl/mgl_ab.h>}.
-@end deftp
-
-@deftp {Класс} mglGraphZB
-Реализует растровую отрисовку изображения используя Z-Buffer. Можно использовать для рисования в памяти (или в консоли/SSH терминале). Также этот класс используется как базовый для рисования в окне (например, используя FLTK, Qt, wxWidgets библиотеки и пр.). При экспорте в EPS формат сохраняется растровая картинка. Получающийся рисунок лучшего качества, но рисуется медленнее чем в классе mglGraphPS. Класс определен в @code{#include <mgl/mgl_zb.h>}.
-@end deftp
-
-@deftp {Класс} mglGraphPS
-Реализует векторную отрисовку изображения с возможностью сохранения в векторный PostScript или SVG файл. Можно использовать для рисования в памяти (или в консоли/SSH терминале). Замечу, что сглаживание цвета не поддерживается, а при экспорте в EPS не поддерживается и прозрачность (в силу ограничения формата). В результате рисунок получается быстрее, но более низкого качества чем в классе mglGraphZB. Класс определен в @code{#include <mgl/mgl_eps.h>}.
-@end deftp
-
-@deftp {Класс} mglGraphGL
-Реализует векторную графику с использованием OpenGL. Класс не может быть использован для рисования в консоли. В силу ограничения OpenGL возможна проблема корректного отображения нескольких перекрывающихся поверхностей. Класс определен в @code{#include <mgl/mgl_gl.h>}.
-@end deftp
-
-@deftp {Класс} mglGraphIDTF
-Реализует экспорт графики в IDTF формате, который затем можно преобразовать в формат U3D. Класс определен в @code{#include <mgl/mgl_idtf.h>}.
-@end deftp
-
-@menu
-* mglGraphAB class::
-@end menu
-
-@c ------------------------------------------------------------------
-@node mglGraphAB class, , , Plotter classes
-@section Класс mglGraphAB
-@cindex mglGraphAB
-@cindex window
-@cindex mglDraw
-
-Вообще говоря это чуть ``менее абстрактный'' класс чем mglGraph (@pxref{MathGL core}). Он предоставляет много методов для обработки промежуточных данных и требует в производных классах определения только нескольких методов для отрисовки примитивов. Разработчикам, наследующим этот класс, следует посмотреть файл @samp{mgl_ab.h} и комментарии в нем или обратиться к автору.
-
-Ниже я только перечислю основные общедоступные методы класса mglGraphAB. В первую очередь это функции, возвращающие созданный растровый рисунок, его ширину и высоту. В дальнейшем его можно использовать в любой графической библиотеке (см. также, @ref{Widget classes}) или сохранить в файл (см. также, @ref{Export to file}).
-
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{const unsigned char *} GetBits ()
-@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} GetRGB (@code{char *}buf, @code{int} size)
-@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} GetBGRN (@code{char *}buf, @code{int} size)
-@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgb (@code{HMGL} gr)
-Возвращает растровое изображение в формате RGB для текущего кадра. Формат каждого элемента (пикселя): @{red, green, blue@}. Число элементов Width*Height. Положение элемента @{i,j@} есть [3*i + 3*Width*j] (или [4*i + 4*Width*j] для @code{GetBGRN()}). В Python вы должны предоставить буфер @var{buf} достаточного размера @var{size}, т.е. код должен выглядеть следующим образом
-@verbatim
-from mathgl import *
-gr = mglGraph();
-bits='\t';
-bits=bits.expandtabs(4*gr.GetWidth()*gr.GetHeight());
-gr.GetBGRN(bits, len(bits));
-@end verbatim
-@end deftypefn
-
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{const unsigned char *} GetRGBA ()
-@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} GetRGBA (@code{char *}buf, @code{int} size)
-@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgba (@code{HMGL} gr)
-Возвращает растровое изображение в формате RGBA для текущего кадра. Формат каждого элемента (пикселя): @{red, green, blue, alpha@}. Число элементов Width*Height. Положение элемента @{i,j@} есть [4*i + 4*Width*j].
-@end deftypefn
-
-@deftypefn {Метод класса @code{mglGraphAB} (C++, Python)} @code{int} GetWidth ()
-@deftypefnx {Метод класса @code{mglGraphAB} (C++, Python)} @code{int} GetHeight ()
-@deftypefnx {C function} @code{int} mgl_get_width (@code{HMGL} gr)
-@deftypefnx {C function} @code{int} mgl_get_height (@code{HMGL} gr)
-Возвращает ширину и высоту изображения.
-@end deftypefn
-
-Класс mglGraphAB -- базовый класс для ``оконных классов''. Поэтому он содержит набор функций для создания и управления окном. Большинство из них применимо только в ``оконных классах'' (типа mglGraphFLTK и др, @pxref{Widget classes}). В остальных случаях функции ничего не делают. Если вы создаете оконный класс, то Вам следует предоставить такой же интерфейс для удобства пользователя.
-
-@deftypemethod mglGraphAB @code{void} Window (@code{int} argc, @code{char **}argv, @code{int (*}draw)(@code{mglGraph *}gr, @code{void *}p), @code{const char *}title, @code{void *}par=@code{NULL}, @code{void (*}reload)(@code{int} next, @code{void *}p)=@code{NULL}, @code{bool} maximize=@code{false})
-Создает окно для вывода графика. Параметры @var{argc}, @var{argv} содержат информацию операционной системы и их слеудет передать в эту функцию из функции @code{main(int argc,char **argv)} (хотя они и могут быть равны @code{NULL}). Параметр @var{draw} -- указатель (имя) функции рисования. Есть возможность создания нескольких кадров вначале (требует больше памяти) и их быстрая анимации в дальнейшем. В этом случае функция @var{draw} должна возвращать число кадров или ноль для рисования по запросу. Замечу, что @var{draw} может быть равна @code{NULL} для отображения статической (текущей) картинки. Параметр @var{title} задает заголовок окна. Параметр @var{par} содержит указатель на данные, передаваемые функции рисования @var{draw}. Параметр @var{maximize}=@code{true} открывает окно раскрытым на весь экран.
-
-В окне просмотра можно использовать клавиши: 'a', 'd', 'w', 's' для вращения; ',', '.' для просмотра предыдущего и следующего кадров; 'r' для переключения прозрачности; 'f' для переключения оспещенности; 'x' для закрытия окна.
-
-@strong{ВАЖНО!!!} Вам не следует вызывать функцию Rotate() (@pxref{Transformation matrix}) если Вы хотите вращать график.
-@end deftypemethod
-
-@deftypemethod mglGraphAB @code{void} Window (@code{int} argc, @code{char **}argv, @code{mglDraw *}draw, @code{const char *}title, @code{bool} maximize=@code{false})
-В основном аналогична предыдущей. Основное отличие в том, что функции рисования и обновления данных определены в классе наследнике класса @code{mglDraw}. Этот класс определен в @code{#include <mgl/mgl_define.h>} и имеет только 2 метода:
-@verbatim
-class mglDraw
-{
-public:
- virtual int Draw(mglGraph *) { return 0; };
- virtual void Reload(int) {};
-};
-@end verbatim
-Вы можете создать класс-наследник @code{mglDraw} и переопределить один или оба метода для использования с данной функцией.
-@end deftypemethod
-
-
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} ToggleAlpha ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_alpha (@code{HMGL} gr)
-Включает/выключает прозрачность, но не перезаписывает настройки пользовательской функции рисования.
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} ToggleLight ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_light (@code{HMGL} gr)
-Включает/выключает освещение, но не перезаписывает настройки пользовательской функции рисования.
-Switch on/off lighting but do not overwrite switches in user drawing function.
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} ToggleZoom ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_zoom (@code{HMGL} gr)
-Включает/выключает приближение выбранного мышью области рисунка.
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} ToggleRotate ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_rotate (@code{HMGL} gr)
-Включает/выключает режим вращения мышью. Обычно левая кнопка вращает график, средняя сдвигает, правая приближает и меняет перспективу.
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} ToggleNo ()
-@deftypefnx {C function} @code{int} mgl_wnd_toggle_no (@code{HMGL} gr)
-Выключает режим приближения/вращения и восстанавливает вид по умолчанию.
-Switch off all zooming and rotation and restore initial state.
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} Update ()
-@deftypefnx {C function} @code{int} mgl_wnd_update (@code{HMGL} gr)
-Обновляет содержимое окна.
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} ReLoad (@code{bool} o)
-@deftypefnx {C function} @code{int} mgl_wnd_reload (@code{HMGL} gr, @code{int} val)
-Перезагружает данные пользователя и обновляет картинку.
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} Adjust ()
-@deftypefnx {C function} @code{int} mgl_wnd_adjust (@code{HMGL} gr)
-Подгоняет размер картинки под размер окна (виджета).
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} NextFrame ()
-@deftypefnx {C function} @code{int} mgl_wnd_next_frame (@code{HMGL} gr)
-Показывает следующий кадр.
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} PrevFrame ()
-@deftypefnx {C function} @code{int} mgl_wnd_prev_frame (@code{HMGL} gr)
-Показывает предыдущий кадр.
-Show previous frame if one.
-@end deftypefn
-@deftypefn {Метод класса @code{mglGraphAB} (C++)} @code{void} Animation ()
-@deftypefnx {C function} @code{int} mgl_wnd_animation (@code{HMGL} gr)
-Запускает/останавливает слайд-шоу (анимацию) кадров.
-@end deftypefn
-
-@deftypefn {C function} @code{int} mgl_wnd_set_auto_clf (@code{HMGL} gr, @code{int} val)
-@end deftypefn
-@deftypecv {Widget option} mglGraphAB @code{bool} AutoClf
-Включает/выключает автоматическую очистку рисунка между перерисовкой. Выключение полезно для рисования с накоплением (например, результатов/точек расчета).
-@end deftypecv
-
-@deftypefn {C function} @code{int} mgl_wnd_set_delay (@code{HMGL} gr, @code{int} val)
-@end deftypefn
-@deftypecv {Widget option} mglGraphAB @code{float} Delay
-Задержка анимации в секундах. По умолчанию равно 1 секунде.
-@end deftypecv
-
-@deftypefn {Метод класса @code{mglGraphAB} (C++, Python)} @code{mglPoint} CalcXYZ (@code{int} xs, @code{int} ys)
-@deftypefnx {C function} @code{void} mgl_calc_xyz (@code{HMGL} gr, @code{int} xs, @code{int} ys, @code{float *}x, @code{float *}y, @code{float *}z)
-Вычисляет 3D координаты @{x,y,z@} для экранной точки @{xs,ys@}. В данный момент игнорируется перспектива графика и формулы перехода в криволинейные координаты. Вычисления производятся для последнего использованного InPlot (@pxref{Transformation matrix}).
-@end deftypefn
-
-@deftypefn {Метод класса @code{mglGraphAB} (C++, Python)} @code{mglPoint} CalcScr (@code{mglPoint} p)
-@deftypefnx {Метод класса @code{mglGraphAB} (C++)} @code{void} CalcScr (@code{mglPoint} p, @code{int *}xs, @code{int *}ys)
-@deftypefnx {C function} @code{void} mgl_calc_scr (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{int *}xs, @code{int *}ys)
-Вычисляет экранные координаты @{xs,ys@} для 3D координат @{x,y,z@}. Вычисления производятся для последнего использованного InPlot (@pxref{Transformation matrix}).
-@end deftypefn
-
-@deftypefn {C function} @code{int} mgl_wnd_set_show_mouse_pos (@code{HMGL} gr, @code{int} val)
-@end deftypefn
-@deftypecv {Widget option} mglGraphAB @code{float} ShowMousePos
-Включает/выключает показ координат последнего нажатия кнопки мыши на рисунке.
-@end deftypecv
-
-@deftypecv {Widget option} mglGraphAB @code{mglPoint} LastMousePos
-Последнее положение нажатия кнопки мыши.
-@end deftypecv
-
In addition to the general concepts I want to comment on some non-trivial or less commonly used general ideas -- plot positioning, axis specification and curvilinear coordinates, styles for lines, text and color scheme.
+@ifclear UDAV
@menu
* Coordinate axes::
* Color styles::
* Command options::
* Interfaces::
@end menu
+@end ifclear
+
+@ifset UDAV
+@menu
+* Coordinate axes::
+* Color styles::
+* Line styles::
+* Color scheme::
+* Font styles::
+* Textual formulas::
+* Command options::
+@end menu
+@end ifset
@c ------------------------------------------------------------------
@node Coordinate axes, Color styles, , General concepts
+@ifclear UDAV
+
@node Interfaces, , Command options, General concepts
@section Interfaces
Some of the languages listed above support classes (like C++ or Python). The name of functions for them is the same as in C++ (see @ref{MathGL core} and @ref{Data processing}) and marked like [Method on mglGraph].
-Finally, a special command language MGL (see @ref{MGL scripts}) was written for a faster access to plotting functions. Corresponding scripts can be executed separately (by UDAV, mglconv, mglview and so on)
-@ifclear UDAV
- or from the C/C++/Python/... code (@pxref{mglParse class}).
-@end ifclear
+Finally, a special command language MGL (see @ref{MGL scripts}) was written for a faster access to plotting functions. Corresponding scripts can be executed separately (by UDAV, mglconv, mglview and so on) or from the C/C++/Python/... code (@pxref{mglParse class}).
-@ifclear UDAV
@menu
* C interface::
* C++ interface::
@end menu
-@end ifclear
@node C interface, C++ interface, , Interfaces
@subsection C/Fortran interface
a.WritePNG("test.png")
@end verbatim
This becomes useful if you create many @code{mglData} objects, for example.
+
+@end ifclear
\ No newline at end of file
@deftypefn {Method on @code{mglData}} @code{float} GetVal (@code{long} i)
@deftypefnx {Method on @code{mglData}} @code{void} SetVal (@code{float} val, @code{long} i)
-@deftypefnx {Method on @code{mglData}} @code{float} vthr (@code{long} i)
Gets or sets the value in by "flat" index @var{i} without border checking. Index @var{i} should be in range [0, nx*ny*nz].
@end deftypefn
Gets the x-, y-, z-size of the data.
@end deftypefn
-@deftypefn {Method on @code{mglData}} @code{float} v (@code{long} i, @code{long} j=@code{0}, @code{long} k=@code{0})
-@deftypefnx {C function} @code{float} mgl_data_get_value (@code{HCDT} dat, @code{int} i, @code{int} j, @code{int} k)
+@deftypefn {C function} @code{float} mgl_data_get_value (@code{HCDT} dat, @code{int} i, @code{int} j, @code{int} k)
@deftypefnx {C function} @code{float *} mgl_data_value (@code{HMDT} dat, @code{int} i, @code{int} j, @code{int} k)
@deftypefnx {C function} @code{void} mgl_data_set_value (@code{HMDT} dat, @code{float} v, @code{int} i, @code{int} j, @code{int} k)
Gets or sets the value in specified cell of the data with border checking.
@deftypefn {C function} @code{const float *} mgl_data_data (@code{HCDT} dat)
Returns pointer to internal data array.
@end deftypefn
-
-@deftypefn {Method on @code{mglData}} @code{float} dvx (@code{long} i, @code{long} j=@code{0}, @code{long} k=@code{0})
-@deftypefnx {Method on @code{mglData}} @code{float} dvy (@code{long} i, @code{long} j=@code{0}, @code{long} k=@code{0})
-@deftypefnx {Method on @code{mglData}} @code{float} dvz (@code{long} i, @code{long} j=@code{0}, @code{long} k=@code{0})
-Returns numerical derivate along x-, y- or z-direction.
-@end deftypefn
@end ifclear
@c ------------------------------------------------------------------
@deftypefnx {MGL command} {} copy @sc{dat} @code{val}
@ifclear UDAV
@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{const mglData &}dat2)
-@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{const mglData *}dat2)
@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{const mglDataA *}dat2)
@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{int} size, @code{const float *}dat2)
@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{int} size, @code{int} cols, @code{const float *}dat2)
Delete @var{num} slices along @var{dir}-direction at position @var{pos}.
@end deftypefn
+@anchor{sort}
+@deftypefn {MGL command} {} sort dat @code{idx [idy=-1]}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} Sort (@code{lond} idx, @code{long} idy=@code{-1})
+@deftypefnx {C function} @code{void} mgl_data_sort (@code{HMDT} dat, @code{lond} idx, @code{long} idy)
+@end ifclear
+Sort data rows (or slices in 3D case) by values of specified column @var{idx} (or cell @{@var{idx},@var{idy}@} for 3D case). Note, this function is not thread safe!
+@end deftypefn
+
+
+
@c ------------------------------------------------------------------
@node Data filling, File I/O, Data resizing, Data processing
@section Data filling
Allocates memory and copies the data from the @code{gsl_matrix *} structure.
@end deftypefn
@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const mglData &}from)
+@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{HCDT} from)
@deftypefnx {C function} @code{void} mgl_data_set (@code{HMDT} dat, @code{HCDT} from)
-Copies the data from mglData instance @var{from}.
+Copies the data from @code{mglData} (or @code{mglDataA}) instance @var{from}.
@end deftypefn
@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const std::vector<int> &}d)
The same as previous ones but coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in range [0,1]. If @var{dim}>0 is specified then modification will be fulfilled only for slices >=@var{dim}.
@end deftypefn
+@anchor{fillsample}
+@deftypefn {MGL command} {} fillsample dat 'how'
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} FillSample (@code{const char *}how)
+@deftypefnx mglData @code{void} mgl_data_fill_sample (@code{HMDT} a, @code{const char *}how)
+@end ifclear
+Fills data by 'x' or 'k' samples for Hankel ('h') or Fourier ('f') transform.
+@end deftypefn
+
+
@anchor{put}
@deftypefn {MGL command} {} put dat @code{val [i=: j=: k=:]}
@ifclear UDAV
Gets zero-momentum (energy, @math{I=\sum dat_i}) and write first momentum (median, @math{a = \sum \xi_i dat_i/I}), second momentum (width, @math{w^2 = \sum (\xi_i-a)^2 dat_i/I}), third momentum (skewness, @math{s = \sum (\xi_i-a)^3 dat_i/ I w^3}) and fourth momentum (kurtosis, @math{k = \sum (\xi_i-a)^4 dat_i / 3 I w^4}) to variables. Here @math{\xi} is corresponding coordinate if @var{dir} is @samp{'x'}, @samp{'y'} or @samp{'z'}. Otherwise median is @math{a = \sum dat_i/N}, width is @math{w^2 = \sum (dat_i-a)^2/N} and so on.
@end deftypefn
+@anchor{.fst}
+@deftypefn {MGL suffix} {(dat)} .fst
@ifclear UDAV
@cindex Find
-@deftypefn {Method on @code{mglData}} @code{float} Find (@code{const char *}cond, @code{int} &i, @code{int} &j, @code{int} &k) @code{const}
+@deftypefnx {Method on @code{mglData}} @code{float} Find (@code{const char *}cond, @code{int} &i, @code{int} &j, @code{int} &k) @code{const}
@deftypefnx {C function} @code{float} mgl_data_first (@code{HCDT} dat, @code{const char *}cond, @code{int} *i, @code{int} *j, @code{int} *k)
+@end ifclear
Find position (after specified in @var{i}, @var{j}, @var{k}) of first nonzero value of formula @var{cond}. Function return the data value at found position.
@end deftypefn
+
+@anchor{.lst}
+@deftypefn {MGL suffix} {(dat)} .lst
+@ifclear UDAV
@cindex Last
-@deftypefn {Method on @code{mglData}} @code{float} Last (@code{const char *}cond, @code{int} &i, @code{int} &j, @code{int} &k) @code{const}
+@deftypefnx {Method on @code{mglData}} @code{float} Last (@code{const char *}cond, @code{int} &i, @code{int} &j, @code{int} &k) @code{const}
@deftypefnx {C function} @code{float} mgl_data_last (@code{HCDT} dat, @code{const char *}cond, @code{int} *i, @code{int} *j, @code{int} *k)
+@end ifclear
Find position (before specified in @var{i}, @var{j}, @var{k}) of last nonzero value of formula @var{cond}. Function return the data value at found position.
@end deftypefn
+
+@ifclear UDAV
@deftypefn {Method on @code{mglData}} @code{int} Find (@code{const char *}cond, @code{char} dir, @code{int} i=@code{0}, @code{int} j=@code{0}, @code{int} k=@code{0}) @code{const}
@deftypefnx {C function} @code{float} mgl_data_find (@code{HCDT} dat, @code{const char *}cond, @code{int} i, @code{int} j, @code{int} k)
Return position of first in direction @var{dir} nonzero value of formula @var{cond}. The search is started from point @{i,j,k@}.
@end deftypefn
@end ifclear
-@anchor{.a} @anchor{.fst} @anchor{.lst}
+@anchor{.a}
@deftypefn {MGL suffix} {(dat)} .a
-@deftypefnx {MGL suffix} {(dat)} .fst
-@deftypefnx {MGL suffix} {(dat)} .lst
-Give first (for @code{.a}, i.e. @code{dat->a[0]}), first nonzero (for @code{.fst}) or last nonzero (for @code{.lst}) value of data array.
+Give first (for @code{.a}, i.e. @code{dat->a[0]}).
@end deftypefn
@node Operators, Global functions, Data information, Data processing
@section Operators
+@anchor{copy}
@deftypefn {MGL command} {} copy @sc{dat} dat2 ['eq'='']
@ifclear UDAV
@deftypefnx {Method on @code{mglData}} @code{void} operator= (@code{const mglData &}d)
Copies data from other variable.
@end deftypefn
+@deftypefn {MGL command} {} copy dat [val]
+@ifclear UDAV
+@deftypefnx {Method on @code{float}} @code{void} operator= (@code{float} val)
+@end ifclear
+Set all data values equal to @var{val}.
+@end deftypefn
+
@anchor{multo}
@deftypefn {MGL command} {} multo dat dat2
@ifclear UDAV
@deftypefnx {Global function} @code{mglData} mglTransform (@code{const mglData &}real, @code{const mglData &}imag, @code{const char *}type)
@deftypefnx {C function} @code{HMDT} mgl_transform (@code{HCDT} real, @code{HCDT} imag, @code{const char *}type)
@end ifclear
-Do integral transformation of complex data @var{real}, @var{imag} on specified direction. The order of transformations is specified in string @var{type}: first character for x-dimension, second one for y-dimension, third one for z-dimension. The possible character are: @samp{f} is forward Fourier transformation, @samp{i} is inverse Fourier transformation, @samp{s} is Sine transform, @samp{c} is Cosine transform, @samp{h} is Hankel transform, @samp{n} or @samp{ } is no transformation.
+Does integral transformation of complex data @var{real}, @var{imag} on specified direction. The order of transformations is specified in string @var{type}: first character for x-dimension, second one for y-dimension, third one for z-dimension. The possible character are: @samp{f} is forward Fourier transformation, @samp{i} is inverse Fourier transformation, @samp{s} is Sine transform, @samp{c} is Cosine transform, @samp{h} is Hankel transform, @samp{n} or @samp{ } is no transformation.
@end deftypefn
@anchor{transforma}
The same as previous but with specified amplitude @var{ampl} and phase @var{phase} of complex numbers.
@end deftypefn
+@anchor{fourier}
+@deftypefn {MGL command} {} fourier reDat imDat 'dir'
+@ifclear UDAV
+@deftypefnx {Global function} @code{void} mglFourier @code{const mglData &}re, @code{const mglData &}im, @code{const char *}dir)
+@deftypefnx {C function} @code{void} mgl_data_fourier @code{HCDT} re, @code{HCDT} im, @code{const char *}dir)
+@end ifclear
+Does Fourier transform of complex data @var{re}+i*@var{im} in directions @var{dir}. Result is placed back into @var{re} and @var{im} data arrays.
+@end deftypefn
+
@anchor{stfad}
@deftypefn {MGL command} {} stfad @sc{res} real imag @code{dn} ['dir'='x']
@ifclear UDAV
@node MathGL core, Widget classes, General concepts, Top
@include core_en.texi
-@node Widget classes, Data handling, MathGL core, Top
+@node Widget classes, Data processing, MathGL core, Top
@include widget_en.texi
@node Data processing, MGL scripts, Widget classes, Top
+++ /dev/null
-@c ------------------------------------------------------------------
-@chapter MGL language
-
-MathGL library supports the simplest scripts for data handling and plotting. These scripts can be used independently (with the help of UDAV, mgl2png, mgl2eps, mgl2svg programs and others, @pxref{Utilities}) or in the frame of the library using.
-
-@menu
-* MGL basics::
-@ifset UDAV
-* General concepts::
-@end ifset
-* Graphics setup @MGL{}::
-* Axis settings @MGL{}::
-* Transformation matrix @MGL{}::
-* Export to file @MGL{}::
-* Primitives drawing @MGL{}::
-* Text printing @MGL{}::
-* Axis and Colorbar @MGL{}::
-* Legend @MGL{}::
-* 1D plotting @MGL{}::
-* 2D plotting @MGL{}::
-* 3D plotting @MGL{}::
-* Dual plotting @MGL{}::
-* Vector fields @MGL{}::
-* Other plotting @MGL{}::
-* Nonlinear fitting @MGL{}::
-* Data create @MGL{}::
-* Data filling @MGL{}::
-* Rearrange data @MGL{}::
-* File I/O @MGL{}::
-* Make another data @MGL{}::
-* Change data @MGL{}::
-* Operators @MGL{}::
-* Program flow @MGL{}::
-* Command options @MGL{}::
-* Suffixes::
-* Utilities::
-@end menu
-
-@c ##################################################################
-@ifset UDAV
-@node MGL basics, General concepts, , MGL interface
-@end ifset
-@ifclear UDAV
-@node MGL basics, Graphics setup @MGL{}, , MGL interface
-@end ifclear
-
-@section MGL basics
-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 sufficient, i.e. variables @var{a} and @var{A} are different variables. Symbol @samp{#} starts the comment (all characters after # will be ignored). The exception is situation when @samp{#} is a part of some string. Also options can be specified after symbol @samp{;} (@pxref{Command options @MGL{}}). Symbol @samp{:} starts new command (like new line character) if it is not placed inside a string or inside brackets.
-
-If string contain references to external parameters (substrings @samp{$0}, @samp{$1} ... @samp{$9}) or definitions (substrings @samp{$a}, @samp{$b} ... @samp{$z}) then before execution the values of parameter/definition will be substituted instead 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.
-@itemize @bullet
-@item
-The string is any symbols between ordinary marks @samp{'}.
-
-@item
-Usually variable have a name which is arbitrary combination of symbols (except spaces and @samp{'}) started from a letter and with length less than 64. A temporary array can be used as variable:
-@itemize @bullet
-@item
-sub-arrays (like in @ref{subdata} command) as command argument. For example, @code{a(1)} or @code{a(1,:)} or @code{a(1,:,:)} is second row, @code{a(:,2)} or @code{a(:,2,:)} is third column, @code{a(:,:,0)} is first slice and so on. Also you can extract a part of array from m-th to n-th element by code @code{a(m:n,:,:)} or just @code{a(m:n)}.
-
-@item
-any column combinations defined by formulas, like @code{a('n*w^2/exp(t)')} if names for data columns was specified (by @ref{idset} command or in the file at string started with @code{##}).
-
-@item
-any expression (without spaces) of existed variables produce temporary variable. For example, @samp{sqrt(dat(:,5)+1)} will produce temporary variable with data values equal to @code{tmp[i,j] = sqrt(dat[i,5,j]+1)}.
-
-@item
-temporary variable of higher dimensions by help of []. For example, @samp{[1,2,3]} will produce a temporary vector of 3 elements @{1, 2, 3@}; @samp{[[11,12],[21,22]]} will produce matrix 2*2 and so on. Here you can join even an arrays of the same dimensions by construction like @samp{[v1,v2,...,vn]}.
-
-@item
-result of code for making new data (@pxref{Make another data @MGL{}}) inside @{@}. For example, @samp{@{sum dat 'x'@}} produce temporary variable which contain result of summation of @var{dat} along direction 'x'. This is the same array @var{tmp} as produced by command @samp{sum tmp dat 'x'}. You can use nested constructions, like @samp{@{sum @{max dat 'z'@} 'x'@}}.
-@end itemize
-Temporary variables can not be used as 1st argument for commands which create (return) the data (like @samp{new}, @samp{read}, @samp{hist} and so on).
-
-@item
-Special names @code{nan=#QNAN, pi=3.1415926..., on=1, off=0, :=-1} are treated as number if they were not redefined by user. Variables with suffixes are treated as numbers (@pxref{Suffixes}). Names defined by @ref{define} command are treated as number. Also results of formulas with sizes 1x1x1 are treated as number (for example, @samp{pi/dat.nx}).
-@end itemize
-Before the first using all variables must be defined with the help of commands, like, @ref{new}, @ref{var}, @ref{list}, @ref{copy}, @ref{read}, @ref{hist}, @ref{sum} and so on (@pxref{Data create @MGL{}} and @ref{Make another data @MGL{}}).
-
-Command may have several set of possible arguments (for example, @code{plot ydat} and @code{plot xdat ydat}). All command arguments for a selected set must be specified. However, some arguments can have default values. These argument are printed in [], like @code{plot ydat ['stl'='' zval=nan]}. At this, the record @code{[arg1 arg2 arg3 ...]} means @code{[arg1 [arg2 [arg3 ...]]]}, i.e. you can omit only tailing arguments if you agree with its default values. For example, @code{plot ydat '' 1} or @code{plot ydat ''} is correct, but @code{plot ydat 1} is incorrect (argument @code{'stl'} is missed).
-
-All MGL commands can be divided on several groups. I will use the following notation for a command description: command names are bold, strings are denoted by commas, variable names are italic, numbers are typewriter. Optional arguments are placed in square brackets and default values for them are shown. Detailed description of color, line styles (@pxref{Line styles}), color schemes (@pxref{Color scheme}), font types, TeX-like symbols (@pxref{Font styles}) and formulas (@pxref{Textual formulas}) can be found in corresponding section.
-
-
-@c ##################################################################
-@ifset UDAV
-@node General concepts, Graphics setup @MGL{}, MGL basics, MGL interface
-@section General concepts
-
-The set of MathGL features is rather rich -- just the number of basic graphics types is larger than 40. Also there are functions for data handling, plot setup and so on. In spite of it I tried to keep a similar style in command names and in the order of arguments. Mostly it is used for different drawing functions.
-
-There are 4 most general (base) concepts:
-@enumerate
-@item
-@strong{Every plot settings (style of lines, font, color scheme) are specified by a string.} It provides convenience for user/programmer -- short string with parameters is more comprehensible than a large set of parameters. Also it provides portability -- the strings are the same in any OS so that it is not necessary to think about argument types.
-@item
-@strong{All commands have ``simplified'' and ``advanced'' forms.} It is done for user</samp>’s convenience. One needs to specify only one data array in the ``simplified'' form in order to see the result. But one may set parametric dependence of coordinates and produce rather complex curves and surfaces in the ``advanced'' form. In both cases the order of function arguments is the same: first data arrays, second the string with plot parameters, and later optional arguments for plot tuning.
-@item
-@strong{All plots are vector plots.} The MathGL library is intended for handling scientific data which have vector nature (lines, faces, matrices and so on). As a result, vector representation is used in all cases! In addition, the vector representation allows one to scale the plot easily -- change the canvas size by a factor of 2, and the picture will be proportionally scaled.
-@item
-@strong{New drawing never clears things drawn already.} This, in some sense, unexpected, idea allows to create a lot of ``combined'' graphics. For example, to make a surface with contour lines one needs to call the function for surface plotting and the function for contour lines plotting (in any order). Thus the special functions for making this ``combined'' plots (as it is done in Matlab and some other plotting systems) are superfluous. Many more examples of such plots can be found in section @ref{Hints} and in home site (@uref{http://mathgl.sf.net/index.html}).
-@end enumerate
-
-In addition to the general concepts I want to comment on some non-trivial or less commonly used general ideas -- plot positioning, axis specification and curvilinear coordinates, styles for lines, text and color scheme.
-
-@menu
-* Coordinate axes::
-* Line styles::
-* Color scheme::
-* Font styles::
-* Textual formulas::
-@end menu
-
-@include concept_en.texi
-
-@node Graphics setup @MGL{}, Axis settings @MGL{}, General concepts, MGL interface
-@end ifset
-@ifclear UDAV
-
-@c ##################################################################
-@node Graphics setup @MGL{}, Axis settings @MGL{}, MGL basics, MGL interface
-@end ifclear
-@section Graphics setup @MGL{}
-
-Coomands in this group influences on overall graphics appearance. So all of them should be placed @emph{before} any actual plotting commands.
-
-@menu
-* Transparency @MGL{}::
-* Lighting @MGL{}::
-* Fog @MGL{}::
-* Default sizes @MGL{}::
-* Zooming @MGL{}::
-* Cutting @MGL{}::
-* Other settings @MGL{}::
-@end menu
-
-@c ==================================================================
-@node Transparency @MGL{}, Lighting @MGL{}, , Graphics setup @MGL{}
-@subsection Transparency @MGL{}
-
-There are several commands for setup transparency. The general command is @ref{alpha} which switch on/off the transparency for overall plot. It influence only for graphics which created after @ref{alpha} call. Command @ref{alphadef} specify the default value of alpha-channel. You may switch off transparency of selected plot by command @ref{transparent}. Finally, command @ref{transptype} set the kind of transparency. @sref{Transparent surface sample}
-
-@cindex alpha
-@anchor{alpha}
-@deftypefn {MGL command} {} alpha @code{[val=on]}
-Sets the transparency on/off. It is recommended to call this command before any plotting command. Default value is @code{off}. Use @code{transparent off} in particular plot to disable its transparency.
-@end deftypefn
-@cindex alphadef
-@anchor{alphadef}
-@deftypefn {MGL command} {} alphadef @code{val}
-Default value of alpha channel (transparency) for all plotting commands. Initial value is 0.5.
-@end deftypefn
-@cindex transparent
-@anchor{transparent}
-@deftypefn {MGL command} {} transparent @code{val}
-Temporary switches transparency on/off for the plot.
-@end deftypefn
-@cindex transptype
-@anchor{transptype}
-@deftypefn {MGL command} {} transptype @code{val}
-This command set the transparency type. Normal transparency (@samp{0}) -- below things is less visible than upper ones. Glass-like transparency (@samp{1}) -- below and upper things are commutable and just decrease intensity of light by RGB channel. Lamp-like transparency (@samp{2}) -- below and upper things are commutable and are the source of some additional light. I recommend to set @code{alphadef 0.3} or less for lamp-like transparency. @xref{Normal transparency}, @ref{Glass-like transparency}, @ref{Lamp-like transparency}.
-@end deftypefn
-
-@c ==================================================================
-@node Lighting @MGL{}, Fog @MGL{}, Transparency @MGL{}, Graphics setup @MGL{}
-@subsection Lighting @MGL{}
-
-There are several commands for setup lighting. The general command is @ref{light} which switch on/off the lighting for overall plot. Generally MathGL support up to 10 independent light sources. The position, color, brightness of each light source can be set separately. By default only one light source is active. It is source number @code{0} with white color, located at top of the plot.
-
-@cindex light
-@anchor{light}
-@deftypefn {MGL command} {} light @code{[val=on]}
-Sets the using of light on/off for overall plot. It is recommended to call this command before any plotting command. Default value is lightning off.
-@end deftypefn
-@deftypefn {MGL command} {} light @code{num val}
-Switch on/off @var{num}-th light source separately.
-@end deftypefn
-
-@deftypefn {MGL command} {} light @code{num xpos ypos zpos} ['col'='w' @code{br=0.5}]
-The command adds a light source with identification @var{num} at position @{@var{xpos}, @var{ypos}, @var{zpos}@}. The color of light is @var{col} (white by default). The brightness of light is @var{br} which must be in range [0,1].
-@end deftypefn
-
-@cindex ambient
-@anchor{ambient}
-@deftypefn {MGL command} {} ambient @code{val}
-Sets the brightness of ambient light. The value should be in range [0,1]. Initial value is 0.5.
-@end deftypefn
-
-@c ==================================================================
-@node Fog @MGL{}, Default sizes @MGL{}, Lighting @MGL{}, Graphics setup @MGL{}
-@subsection Fog @MGL{}
-
-@cindex fog
-@anchor{fog}
-@deftypefn {MGL command} {} fog @code{val [dz=0.25]}
-Command imitate a fog in the plot. Fog start from relative distance @var{dz} from view point and its density growths exponentially in depth. So that the fog influence is determined by law ~@math{1-exp(-d*z)}. Here @emph{z} is normalized to 1 depth of the plot. If value @var{val}=@code{0} then the fog is absent. @sref{Surface in fog sample}
-@end deftypefn
-
-@c ==================================================================
-@node Default sizes @MGL{}, Zooming @MGL{}, Fog @MGL{}, Graphics setup @MGL{}
-@subsection Default sizes @MGL{}
-
-These commands control the default (initial) values for most graphics parameters including sizes of markers, arrows, linewidth and so on. As any other settings these ones will influence only on plots created after the settings change.
-
-@cindex barwidth
-@anchor{barwidth}
-@deftypefn {MGL command} {} barwidth @code{val}
-Sets relative width of rectangles in @code{bars, barh, boxplot}. Default value is @code{0.7}.
-@end deftypefn
-
-@cindex marksize
-@anchor{marksize}
-@deftypefn {MGL command} {} marksize @code{val}
-The size of marks. Default value is @code{1}.
-@end deftypefn
-
-@cindex arrowsize
-@anchor{arrowsize}
-@deftypefn {MGL command} {} arrowsize @code{val}
-The size of arrows for lines and curves. Default value is @code{1}.
-@end deftypefn
-
-@cindex linewidth
-@anchor{linewidth}
-@deftypefn {MGL command} {} linewidth @code{val}
-The variable define the base width for all lines. The value <1 is ignored. Increase of this variables is actual for large bitmap pictures. Default value is @code{1}.
-@end deftypefn
-
-@cindex ticklen
-@anchor{ticklen}
-@deftypefn {MGL command} {} ticklen @code{val} [@code{stt=1}]
-The relative length of axis ticks. Default value is @code{0.1}. Parameter @var{stt}>0 set relative length of subticks which is in @code{sqrt(1+stt)} times smaller.
-@end deftypefn
-
-@cindex tickstl
-@anchor{tickstl}
-@deftypefn {MGL command} {} tickstl 'stl' ['sub'='']
-The line style of axis ticks (@var{stl}) and subticks (@var{sub}). If @var{stl}='' then default style is used (@samp{k} or @samp{w} depending on transparency type). If @var{sub}='' then ticks style is used (i.e. @var{stl}).
-@end deftypefn
-
-@c ==================================================================
-@node Zooming @MGL{}, Cutting @MGL{}, Default sizes @MGL{}, Graphics setup @MGL{}
-@subsection Zooming @MGL{}
-
-These commands control the overall zooming of the picture or the sub-picture. Normally you can use these variables and commands for removing ``white'' spaces around a plot.
-
-@cindex plotfactor
-@anchor{plotfactor}
-@deftypefn {MGL command} {} plotfactor @code{val}
-The factor of plot size. It is not recommended to set it lower then 1.6. This is some analogue of command @ref{zoom} but applied not to overall image but for each @ref{inplot}. Use negative value to enable automatic @ref{plotfactor} selection.
-@end deftypefn
-
-@cindex zoom
-@anchor{zoom}
-@deftypefn {MGL command} {} zoom @code{x1 y1 x2 y2}
-The command changes the scale of graphics that correspond to zoom in/out of the picture. After command call the current plot will be cleared and further the picture will contain plotting from its part [x1,x2]*[y1,y2]. Here picture coordinates @var{x1}, @var{x2}, @var{y1}, @var{y2} changes from 0 to 1. Use @code{zoom 0 0 1 1} to return default view.
-@end deftypefn
-
-@c ==================================================================
-@node Cutting @MGL{}, Other settings @MGL{}, Zooming @MGL{}, Graphics setup @MGL{}
-@subsection Cutting @MGL{}
-
-These commands set the condition when the points are excluded (cutted) from the drawing. Note, that a point with @code{nan} value(s) of coordinate or amplitude will be automatically excluded from the drawing.
-
-@cindex cut
-@anchor{cut}
-@deftypefn {MGL command} {} cut @code{val}
-Determines how points outside bounding box are drawn. If it is @code{on} then points are excluded from plot (it is default) otherwise the points are projected to edges of bounding box.
-@end deftypefn
-
-@deftypefn {MGL command} {} cut @code{x1 y1 z1 x2 y2 z2}
-Lower and upper edge of the box in which never points are drawn. If both edges are the same (the variables are equal) then the cutting box is empty. @sref{CutMinMax sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} cut 'cond'
-Command set the cutting off condition by formula @var{cond}. This condition determine will point be plotted or not. If value of formula is nonzero then point is omitted, otherwise it plotted. Set argument as @code{''} to disable cutting off condition. @sref{CutOff sample}
-@end deftypefn
-
-@c ==================================================================
-@node Other settings @MGL{}, , Cutting @MGL{}, Graphics setup @MGL{}
-@subsection Other settings @MGL{}
-
-@cindex font
-@anchor{font}
-@deftypefn {MGL command} {} font 'fnt' [@code{val=6}]
-Font style for text and labels (see text). Initial style is 'fnt'='rC' give Roman font with centering. Parameter @code{val} sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. For more detail, @pxref{Font styles}.
-@end deftypefn
-
-@cindex rotatetext
-@anchor{rotatetext}
-@deftypefn {MGL command} {} rotatetext @code{val}
-Set to use or not text rotation along axis. Initial value is @code{on}.
-@end deftypefn
-
-@cindex palette
-@anchor{palette}
-@deftypefn {MGL command} {} palette 'colors'
-Set the palette as selected colors. Default value is @code{'Hbgrcmyhlnqeup'}. The palette is used mostly in 1D plots for curves which styles are not specified.
-@end deftypefn
-
-@cindex meshnum
-@anchor{meshnum}
-@deftypefn {MGL command} {} meshnum @code{num}
-Sets approximate number of lines in @ref{mesh}, @ref{fall}, @ref{grid} and also the number of hachures in @ref{vect}, @ref{vectc}, @ref{dew} and the number of cells in @ref{cloud}. By default (=0) it draws all lines/hachures/cells.
-@end deftypefn
-
-@cindex axialdir
-@anchor{axialdir}
-@deftypefn {MGL command} {} axialdir 'dir'
-Set direction around which curve rotated in @ref{axial}, @ref{torus}. Default value is 'z'.
-@end deftypefn
-
-@c ==================================================================
-@node Axis settings @MGL{}, Transformation matrix @MGL{}, Graphics setup @MGL{}, MGL interface
-@section Axis settings @MGL{}
-
-These large set of commands control how the axis and ticks will be drawn. Note that there is 3-step transformation of data coordinates are performed. Firstly, coordinates are projected and cutting is applied (@pxref{Cutting @MGL{}}), after it transformation formulas are applied, and finally the data was normalized in bounding box.
-
-@cindex axis
-@anchor{axis}
-@deftypefn {MGL command} {} axis @code{x1 y1 x2 y2}
-@deftypefnx {MGL command} {} axis @code{x1 y1 z1 x2 y2 z2}
-@cindex ranges
-@anchor{ranges}
-@deftypefnx {MGL command} {} ranges @code{x1 x2 y1 y2 [z1=0 z2=0]}
-Sets the ranges of coordinates changing. Also it sets the range for coloring (analogous to @code{caxis z1 z2}). Initial ranges are [-1, 1].
-@end deftypefn
-
-@deftypefn {MGL command} {} axis 'fx' 'fy' ['fz'='' 'fa'='']
-Sets the transformation formulas for curvilinear coordinates. Each string should contain mathematical expression for real coordinate depending on internal coordinates @samp{x}, @samp{y}, @samp{z} and @samp{a} or @samp{c} for colorbar. For example, the cylindrical coordinates are introduced as @code{axis 'x*cos(y)' 'x*sin(y)' 'z'}. For removing of formulas the corresponding parameter should be @code{''}. The using of transformation formulas will slightly slowing the program, i.e. @code{axis '' '' ''} is faster than @code{axis '1*x' '1*y' '1*z'}. Initially all formulas are absent (Cartesian coordinates are used). For more details about functions and formulas, @pxref{Textual formulas}.
-@end deftypefn
-
-@deftypefn {MGL command} {} axis @code{how}
-Sets one of the predefined transformation formulas for curvilinear coordinate. Paramater @var{how} define the coordinates: @samp{0} -- Cartesian coordinates (no transformation); @samp{1} -- Polar coordiantes @math{x_n=x*cos(y),y_n=x*sin(y), z_n=z}; @samp{2} -- Spherical coordinates @math{x_n=x*sin(y)*cos(z), y_n=x*sin(y)*sin(z), z_n=x*cos(y)}; @samp{3} -- Parabolic coordinates @math{x_n=x*y, y_n=(x*x-y*y)/2, z_n=z}; @samp{4} -- Paraboloidal coordinates @math{x_n=(x*x-y*y)*cos(z)/2, y_n=(x*x-y*y)*sin(z)/2, z_n=x*y}; @samp{5} -- Oblate coordinates @math{x_n=cosh(x)*cos(y)*cos(z), y_n=cosh(x)*cos(y)*sin(z), z_n=sinh(x)*sin(y)}; @samp{6} -- Prolate coordinates @math{x_n=sinh(x)*sin(y)*cos(z), y_n=sinh(x)*sin(y)*sin(z), z_n=cosh(x)*cos(y)}; @samp{7} -- Elliptic coordinates @math{x_n=cosh(x)*cos(y), y_n=sinh(x)*sin(y), z_n=z}; @samp{8} -- Toroidal coordinates @math{x_n=sinh(x)*cos(z)/(cosh(x)-cos(y)), y_n=sinh(x)*sin(z)/(cosh(x)-cos(y)), z_n=sin(y)/(cosh(x)-cos(y))}; @samp{9} -- Bispherical coordinates @math{x_n=sin(y)*cos(z)/(cosh(x)-cos(y)), y_n=sin(y)*sin(z)/(cosh(x)-cos(y)), z_n=sinh(x)/(cosh(x)-cos(y))}; @samp{10} -- Bipolar coordinates @math{x_n=sinh(x)/(cosh(x)-cos(y)), y_n=sin(y)/(cosh(x)-cos(y)), z_n=z}.
-@end deftypefn
-
-@cindex caxis
-@anchor{caxis}
-@deftypefn {MGL command} {} caxis @code{z1 z2}
-Sets the range for surface coloring. Initial range is [-1, 1].
-@end deftypefn
-
-@cindex origin
-@anchor{origin}
-@deftypefn {MGL command} {} origin @code{x0 y0 [z0=nan]}
-Center of axis cross section. If one of values is @code{nan} then MathGL library try to select optimal axis position.
-@end deftypefn
-
-@cindex ternary
-@anchor{ternary}
-@deftypefn {MGL command} {} ternary @code{val}
-The command sets to draws Ternary plot. This special plot is for 3 dependent coordinates (components) @var{a}, @var{b}, @var{c} so that @var{a}+@var{b}+@var{c}=1. MathGL uses only 2 independent coordinates @var{a}=x and @var{b}=y since it is enough to plot everything. At this third coordinate z act as another parameter to produce contour lines, surfaces and so on. @sref{Ternary plot sample}
-@end deftypefn
-
-@cindex xrange
-@anchor{xrange}
-@deftypefn {MGL command} {} xrange dat [@code{add=off fact=0}]
-@cindex yrange
-@anchor{yrange}
-@deftypefnx {MGL command} {} yrange dat [@code{add=off fact=0}]
-@cindex zrange
-@anchor{zrange}
-@deftypefnx {MGL command} {} zrange dat [@code{add=off fact=0}]
-@cindex crange
-@anchor{crange}
-@deftypefnx {MGL command} {} crange dat [@code{add=off fact=0}]
-Sets the range for x-,y-,z- coordinate or coloring as minimal and maximal values of data @var{dat}. Parameter @code{add=on} shows that the new range will be joined to existed one (nut will not replace it). Parameter @var{fact} add additional range increase on value (@var{Max}-@var{Min})*@var{fact}.
-@end deftypefn
-
-@deftypefn {MGL command} {} xrange @code{x1 x2}
-@deftypefnx {MGL command} {} yrange @code{x1 x2}
-@deftypefnx {MGL command} {} zrange @code{x1 x2}
-@deftypefnx {MGL command} {} crange @code{x1 x2}
-Sets the range for x-,y-,z- coordinate or coloring. See also @ref{axis}.
-@end deftypefn
-
-@cindex xtick
-@anchor{xtick}
-@deftypefn {MGL command} {} xtick @code{val [sub=0 org=nan]}
-@cindex ytick
-@anchor{ytick}
-@deftypefnx {MGL command} {} ytick @code{val [sub=0 org=nan]}
-@cindex ztick
-@anchor{ztick}
-@deftypefnx {MGL command} {} ztick @code{val [sub=0 org=nan]}
-@cindex ctick
-@anchor{ctick}
-@deftypefnx {MGL command} {} ctick @code{val}
-Sets step for x-, y-, z-axis ticks or colorbar ticks (if @var{val}>0) or it's number (if @var{val}<0) in corresponding direction. Zero value @var{val}=0 sets logarithmic ticks. Parameter @var{sub} sets the number of sub-ticks. Parameter @var{org} set the starting points for ticks. If not @code{org=nan} then the value from @ref{origin} is used.
-@end deftypefn
-
-@deftypefn {MGL command} {} xtick 'templ'
-@deftypefnx {MGL command} {} ytick 'templ'
-@deftypefnx {MGL command} {} ztick 'templ'
-@deftypefnx {MGL command} {} ctick 'templ'
-Sets the template for x-, y-, z-axis ticks or colorbar ticks. It may contain TeX symbols also. If @var{templ}=@code{''} then default template is used (in simplest case it is @samp{%.2g}) with automatic detaching of common multiplier or common component.
-@end deftypefn
-
-@deftypefn {MGL command} {} xtick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...]
-@deftypefnx {MGL command} {} ytick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...]
-@deftypefnx {MGL command} {} ztick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...]
-Sets manual positions @var{val1},@var{val2},... and labels @var{lbl1},@var{lbl2},... for ticks along x-, y-, z-axis. Labels may contain TeX symbols also.
-@end deftypefn
-
-@cindex adjust
-@anchor{adjust}
-@deftypefn {MGL command} {} adjust ['dir'='xyzc']
-Set the ticks step, number of sub-ticks and initial ticks position to be the most human readable for the axis along direction(s) @var{dir}.
-@end deftypefn
-
-
-@c ##################################################################
-@node Transformation matrix @MGL{}, Export to file @MGL{}, Axis settings @MGL{}, MGL interface
-@section Transformation matrix @MGL{}
-
-These commands control how and where further plotting will be placed. There is a curtain order of calling of these commands for the better plot view. First one should be @ref{subplot} or @ref{inplot} for specifying the place. After it a @ref{rotate} and @ref{aspect}. And finally any other plotting commands may be called. Alternatevely you can use @ref{columnplot} for position plots in the column one by another without gap between plot axis (bounding boxes).
-
-@cindex subplot
-@anchor{subplot}
-@deftypefn {MGL command} {} subplot @code{nx ny m [dx=0 dy=0]}
-Puts further plotting in a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This command set off any aspects or rotations. So it should be used first for creating the subplot. From the aesthetical point of view it is not recommended to use this command with different matrices in the same frame. The position of the cell can be shifted from its default position by relative size @var{dx}, @var{dy}.
-@end deftypefn
-
-@deftypefn {MGL command} {} subplot @code{nx ny m} 'style'
-The same as previous but space reserved for axis/colorbar is saved only if @var{style} contain: @samp{L} or @samp{<} -- at left side, @samp{R} or @samp{>} -- at right side, @samp{A} or @samp{^} -- at top side, @samp{U} or @samp{_} -- at bottom side.
-@end deftypefn
-
-@cindex inplot
-@anchor{inplot}
-@deftypefn {MGL command} {} inplot @code{x1 x2 y1 y2 [rel=off]}
-Puts further plotting in some region of the whole frame surface. This command allows one to create a plot in arbitrary place of the screen. The position is defined by rectangular coordinates [@var{x1}, @var{x2}]*[@var{y1}, @var{y2}]. The coordinates @var{x1}, @var{x2}, @var{y1}, @var{y2} are normalized to interval [0, 1]. If parameter @var{rel}=@code{on} then the relative position to current @ref{subplot} is used. This command set off any aspects or rotations. So it should be used first for creating subplot.
-@end deftypefn
-
-@cindex columnplot
-@anchor{columnplot}
-@deftypefn {MGL command} {} columnplot @code{num ind [d=0]}
-Puts further plotting in @var{ind}-th cell of column with @var{num} cells. The position is relative to previous @ref{subplot} call (or @ref{inplot} with @code{rel=off}). Parameter @var{d} set extra gap between cells.
-@end deftypefn
-
-@cindex stickplot
-@anchor{stickplot}
-@deftypefn {MGL command} {} stickplot @code{num ind tet phi}
-Puts further plotting in @var{ind}-th cell of stick with @var{num} cells. At this, stick is rotated on angles @var{tet}, @var{phi}. The position is relative to previous @ref{subplot} call (or @ref{inplot} with @code{rel=off}).
-@end deftypefn
-
-@cindex rotate
-@anchor{rotate}
-@deftypefn {MGL command} {} rotate @code{tetz tetx [tety=0]}
-Rotates a further plotting relative to each axis (x, z, y) consecutively on angles @var{tetx}, @var{tetz}, @var{tety}.
-@end deftypefn
-
-@deftypefn {MGL command} {} rotate @code{tet x y z}
-Rotates a further plotting around vector @{x,y,z@} on angle @var{tet}.
-@end deftypefn
-
-@cindex aspect
-@anchor{aspect}
-@deftypefn {MGL command} {} aspect @code{ax ay [az=1]}
-Defines aspect ratio for the plot. The viewable axes will be related one to another as the ratio @var{ax:ay:az}. For the best effect it should be used after @ref{rotate} command.
-@end deftypefn
-
-@cindex perspective
-@anchor{perspective}
-@deftypefn {MGL command} {} perspective @code{val}
-Add (switch on) the perspective to plot. The parameter @math{val ~ 1/z_@{eff@} \in [0,1)}. By default (@code{val=0}) the perspective is off.
-@end deftypefn
-
-@c ##################################################################
-@node Export to file @MGL{}, Primitives drawing @MGL{}, Transformation matrix @MGL{}, MGL interface
-@section Export to file @MGL{}
-
-@cindex write
-@anchor{write}
-@deftypefn {MGL command} {} write 'fname' [@code{solid=off}]
-Exports current picture/frame to file 'fname' (file type is determined by extension). Solid (usually white) background will be used if @code{solid=on}. If 'fname'='' then the file @samp{frameNNNN.jpg} is used, where @samp{NNNN} is current frame id.
-@end deftypefn
-
-@cindex setsize
-@anchor{setsize}
-@deftypefn {MGL command} {} setsize @code{w h}
-Sets size of picture in pixels. This function call @strong{must be} placed before any plotting command because it completely remove picture content. In some program the call of this function is forbidden.
-@end deftypefn
-
-
-@c ##################################################################
-@node Primitives drawing @MGL{}, Text printing @MGL{}, Export to file @MGL{}, MGL interface
-@section Primitives drawing
-
-These commands draw some simple objects like line, point, sphere, drop, cone and so on.
-
-@cindex clf
-@anchor{clf}
-@deftypefn {MGL command} {} clf
-Clear the picture by removes all drawing from it. Does not change transformation matrix.
-@end deftypefn
-
-@cindex ball
-@anchor{ball}
-@deftypefn {MGL command} {} ball @code{x y} ['col'='r']
-@deftypefnx {MGL command} {} ball @code{x y z} ['col'='r']
-Draws a point (ball) at position @{@var{x}, @var{y}, @var{z}@} with color defined by string @var{col}.
-@end deftypefn
-
-@cindex line
-@anchor{line}
-@deftypefn {MGL command} {} line @code{x1 y1 x2 y2} ['stl'='']
-@deftypefnx {MGL command} {} line @code{x1 y1 z1 x2 y2 z2} ['stl'='']
-Draws a geodesic line (straight line in Cartesian coordinates) from point @{@var{x1},@var{y1},@var{z1}@} to @{@var{x2},@var{y2},@var{z2}@} using line style @var{stl}.
-@end deftypefn
-
-@cindex curve
-@anchor{curve}
-@deftypefn {MGL command} {} curve @code{x1 y1 dx1 dy1 x2 y2 dx2 dy2} ['stl'='']
-@deftypefnx {MGL command} {} curve @code{x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2} ['stl'='']
-Draws Bezier-like curve from point @{@var{x1},@var{y1},@var{z1}@} to @{@var{x2},@var{y2},@var{z2}@} using line style @var{stl}. At this tangent is co-directed with @{@var{dx1},@var{dy1},@var{dz1}@}, @{@var{dx2},@var{dy2},@var{dz2}@} and proportional to its amplitude.
-@end deftypefn
-
-@cindex facex
-@anchor{facex}
-@deftypefn {MGL command} {} facex @code{x0 y0 z0 wy wz} ['stl'='' @code{d1=0 d2=0}]
-@cindex facey
-@anchor{facey}
-@deftypefnx {MGL command} {} facey @code{x0 y0 z0 wx wz} ['stl'='' @code{d1=0 d2=0}]
-@cindex facez
-@anchor{facez}
-@deftypefnx {MGL command} {} facez @code{x0 y0 z0 wx wy} ['stl'='' @code{d1=0 d2=0}]
-Draws the solid rectangle (face) perpendicular to [x,y,z]-axis correspondingly at position @{@var{x0}, @var{y0}, @var{z0}@} with color @var{stl} and with widths @var{wx}, @var{wy}, @var{wz} along corresponding directions. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. Parameters @var{d1}!=0, @var{d2}!=0 set additional shift of the last vertex (i.e. to draw quadrangle).
-@end deftypefn
-
-@cindex sphere
-@anchor{sphere}
-@deftypefn {MGL command} {} sphere @code{x0 y0 r} ['col'='r']
-@deftypefnx {MGL command} {} sphere @code{x0 y0 z0 r} ['col'='r']
-Draw the sphere with radius @var{r} and center at point @{@var{x0}, @var{y0}, @var{z0}@} and color @var{stl}.
-@end deftypefn
-
-@cindex drop
-@anchor{drop}
-@deftypefn {MGL command} {} drop @code{x0 y0 dx dy r} ['col'='b' @code{sh=1 asp=1}]
-@deftypefnx {MGL command} {} drop @code{x0 y0 z0 dx dy dz r} ['col'='b' @code{sh=1 asp=1}]
-Draw the drop with radius @var{r} at point @{@var{x0},@var{y0},@var{z0}@} elongated in direction @{@var{dx},@var{dy},@var{dz}@} and with color @var{col}. Parameter @var{sh} set the degree of drop oblongness: @samp{0} is sphere, @samp{1} is maximally oblongness drop. Parameter @var{asp} set relative width of the drop (this is analogue of ``ellipticity'' for the sphere). @sref{Drops sample}
-@end deftypefn
-
-@cindex cone
-@anchor{cone}
-@deftypefn {MGL command} {} cone @code{x1 y1 z1 x2 y2 z2 r1} [@code{r2=-1} 'stl'='' @code{edge=off}]
-Draw tube (or truncated cone if @var{edge}=@code{off}) between points @{@var{x1},@var{y1},@var{z1}@}, @{@var{x2},@var{y2},@var{z2}@} with radiuses at the edges @var{r1}, @var{r2}. If @var{r2}<0 then it is supposed that @var{r2}=@var{r1}. The cone color is defined by string @var{stl}.
-@end deftypefn
-
-@cindex rect
-@anchor{rect}
-@deftypefn {MGL command} {} rect @code{x1 y1 x2 y2} ['st'='']
-@deftypefnx {MGL command} {} rect @code{x1 y1 z1 x2 y2 z2} ['st'='']
-Draw rectangle from point @{@var{x1},@var{y1},@var{z1}@} to point @{@var{x2},@var{y2},@var{z2}@} using colors @var{stl}. If @var{stl} have 4 or more colors then it defines colors for each rectangle vertex (useful for making gradients, like @samp{wwrr}) else first color is used for whole rectangle.
-@end deftypefn
-
-@c ##################################################################
-@node Text printing @MGL{}, Axis and Colorbar @MGL{}, Primitives drawing @MGL{}, MGL interface
-@section Text printing @MGL{}
-
-These commands draw the text. There are commands for drawing text in arbitrary place, in arbitrary direction and along arbitrary curve. It is possible to use arbitrary font-faces and parse many TeX commands. The Unicode text is supported. So sometimes you need to specify locale. The @code{size} argument control the size of text: if positive it give the value, if negative it give the value relative to defined by @code{font} command. @xref{Font styles}.
-
-@cindex text
-@anchor{text}
-@deftypefn {MGL command} {} text @code{x y} 'text' ['fnt'='' @code{size=-1.4}]
-@deftypefnx {MGL command} {} text @code{x y z} 'text' ['fnt'='' @code{size=-1.4}]
-Draws unrotated text string @var{text} at position @{@var{x},@var{y},@var{z}@} with specified style @var{fnt} and @var{size}. By default parameters from @code{font} command are used.
-@end deftypefn
-
-@deftypefn {MGL command} {} text @code{x y dx dy} 'text' [@code{size=-1.4}]
-@deftypefnx {MGL command} {} text @code{x y z dx dy dz} 'text' [@code{size=-1.4}]
-The command plots the string @var{text} at position @{@var{x},@var{y},@var{z}@} along direction @{@var{dx},@var{dy},@var{dz}@} with specified style @var{fnt} and @var{size}. By default parameters from @code{font} command are used.
-@end deftypefn
-
-@deftypefn {MGL command} {} text ydat 'text' ['fnt'='' @code{size=-1 zval=nan}]
-@deftypefnx {MGL command} {} text xdat ydat 'text' ['fnt'='' @code{size=-1 zval=nan}]
-@deftypefnx {MGL command} {} text xdat ydat zdat 'text' ['fnt'='' @code{size=-1}]
-The command draws @var{text} along the curve between points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} by font style @var{fnt} and with size @var{size}. The string @var{fnt} may contain symbols @samp{t} for printing the text under the curve (default), or @samp{T} for printing the text above the curve. The sizes of 1st dimension must be equal for all arrays @var{xdat.nx=ydat.nx=zdat.nx}. If array @var{xdat} is not specified then its an automatic array is used with values equidistantly distributed along x. If array @var{zdat} is not specified then @var{z}[i] = @var{zval} is used. @sref{Text sample}
-@end deftypefn
-
-@cindex title
-@anchor{title}
-@deftypefn {MGL command} {} title 'text' ['fnt'='' @code{size=-2}]
-Print string @var{text} as title of the picture (at the top of the picture). Can be used at any place (even inside @ref{subplot}).
-@end deftypefn
-
-@cindex fgets
-@anchor{fgets}
-@deftypefn {MGL command} {} fgets @code{x y} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}]
-@deftypefnx {MGL command} {} fgets @code{x y z} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}]
-Draws unrotated @var{n}-th line of file @var{fname} at position @{@var{x},@var{y},@var{z}@} with specified @var{size}. By default parameters from @ref{font} command are used.
-@end deftypefn
-
-
-@c ##################################################################
-@node Axis and Colorbar @MGL{}, Legend @MGL{}, Text printing @MGL{}, MGL interface
-@section Axis and Colorbar @MGL{}
-
-These commands draw the ``things for measuring'', like axis with ticks, colorbar with ticks, grid along axis, bounding box and labels for axis. For more information @pxref{Axis settings @MGL{}}.
-
-@cindex axis
-@c @anchor{}
-@deftypefn {MGL command} {} axis ['dir'='xyz' @code{adjust=off}]
-Draws axes with ticks (@pxref{Axis settings @MGL{}}) in directions determined by string parameter @var{dir}.If string contain the symbol @samp{_} then tick labels are not printed. Font for ticks labels is determined by command @ref{font}. Ticks will be automatically adjusted if @var{adjust}=@code{on} (by call of @code{adjust 'dir'}).
-@end deftypefn
-
-@cindex colorbar
-@anchor{colorbar}
-@deftypefn {MGL command} {} colorbar ['sch'='' @code{pos=0}]
-Draws colorbar with color scheme @var{sch} (current scheme if @code{sch=''}) at edge of plot. Parameter @var{pos} specifies the position of colorbar: @samp{0} - at right (default), @samp{1} - at left, @samp{2} - at top, @samp{3} - at bottom. If string @var{sch} contains @samp{<>^_} then the parameter @var{pos} is defined as: @code{pos=0} for @samp{>} (right), @code{pos=1} for @samp{<} (left), @code{pos=2} for @samp{^} (top), @code{pos=3} for @samp{_} (bottom). If string have @samp{A} then absolute (relative to picture) coordinates is used. @sref{Dens sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} colorbar vdat ['sch'='' @code{pos=0}]
-The same as previous but with sharp colors @var{sch} (current palette if @code{sch=""}) for values @var{v}. @sref{ContD sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} colorbar 'sch' @code{pos x y w h}
-The same as first one but at arbitrary position of subplot @{@var{x}, @var{y}@} (supposed to be in range [0,1]). Parameters @var{w}, @var{h} set the relative width and height of the colorbar.
-@end deftypefn
-
-@cindex grid
-@anchor{grid}
-@deftypefn {MGL command} {} grid ['dir'='xyz' 'pen'='B']
-Draws grid lines perpendicular to direction determined by string parameter @var{dir}. The step of grid lines is the same as tick step for an @code{axis}. The style of lines is determined by @var{pen} parameter.
-@end deftypefn
-
-@cindex box
-@anchor{box}
-@deftypefn {MGL command} {} box ['stl'='k' @code{ticks=on}]
-Draws bounding box outside the plotting volume with line style 'stl'. If @code{ticks=on} then ticks are drawn with current axis setting.
-@end deftypefn
-
-@cindex xlabel
-@anchor{xlabel}
-@deftypefn {MGL command} {} xlabel 'text' [@code{pos=0 size=-1.4 shift=0}]
-@cindex ylabel
-@anchor{ylabel}
-@deftypefnx {MGL command} {} ylabel 'text' [@code{pos=0 size=-1.4 shift=0}]
-@cindex zlabel
-@anchor{zlabel}
-@deftypefnx {MGL command} {} zlabel 'text' [@code{pos=0 size=-1.4 shift=0}]
-@cindex tlabel
-@anchor{tlabel}
-@deftypefnx {MGL command} {} tlabel 'text' [@code{pos=0 size=-1.4 shift=0}]
-Prints the label @var{text} for x-,y-,z-,t-axis (here @samp{t} is ``ternary'' axis @math{t=1-x-y}). The position of label is determined by @var{pos} parameter. If @var{pos}=0 then label is printed at the center of axis. If @var{pos}>0 then label is printed at the maximum of axis (default). If @var{pos}<0 then label is printed at the minimum of axis. The font size is 1.4 times larger than the one for ticks @code{font}. Parameter @code{shift} specify additional shifting of the label. @xref{Text printing @MGL{}}.
-@end deftypefn
-
-@c ##################################################################
-@node Legend @MGL{}, 1D plotting @MGL{}, Axis and Colorbar @MGL{}, MGL interface
-@section Legend @MGL{}
-
-These commands draw legend to the graph (useful for @ref{1D plotting @MGL{}}). Legend entry is a pair of strings: one for style of the line, another one with description text (with included LaTeX parsing). The array of string are accumulated first to the internal arrays (by command @ref{addlegend}) and are plotted later. The position of the legend can be selected automatic or manually. Parameters @var{fnt} and @var{size} specify the font style and size. Parameter @var{llen} set the relative width of the line sample and the text indent (default value is 0.1). If line style string for entry is empty then the corresponding text is printed without indent. If string contains @samp{A} then legend coordinates set position in the picture. @sref{Legend sample}
-
-@cindex legend
-@anchor{legend}
-@deftypefn {MGL command} {} legend [@code{pos=3} 'fnt'='rL' @code{size=-1 llen=0.1}]
-Draws legend of accumulated legend entries by font @var{fnt} with specified @var{size}. Parameter @var{pos} sets the position of the legend: @samp{0} is bottom left corner, @samp{1} is bottom right corner, @samp{2} is top left corner, @samp{3} is top right corner (is default).
-@end deftypefn
-
-@deftypefn {MGL command} {} legend @code{x y} ['fnt'='rL' @code{size=-1 llen=0.1}]
-Draws legend of accumulated legend entries by font @var{fnt} with @var{size}. Position of legend in the current subplot is determined by parameter @var{x}, @var{y} which supposed to be normalized to interval [0,1].
-@end deftypefn
-
-@cindex addlegend
-@anchor{addlegend}
-@deftypefn {MGL command} {} addlegend 'text' 'stl'
-Adds string @var{text} to internal legend accumulator. The style of described line and mark is specified in string @var{stl} (@pxref{Line styles}). Maximal number of entries is 100.
-@end deftypefn
-
-@cindex clearlegend
-@anchor{clearlegend}
-@deftypefn {MGL command} {} clearlegend
-Clears saved legend strings.
-@end deftypefn
-
-@cindex legendbox
-@anchor{legendbox}
-@deftypefn {MGL command} {} legendbox @code{val}
-Switches on/off the drawing of a box near legend. By default, the box is drawn.
-@end deftypefn
-
-@cindex legendmarks
-@anchor{legendmarks}
-@deftypefn {MGL command} {} legendmarks @code{val}
-Set the number of marks in the legend. By default 1 mark is used.
-@end deftypefn
-
-@c ##################################################################
-@node 1D plotting @MGL{}, 2D plotting @MGL{}, Legend @MGL{}, MGL interface
-@section 1D plotting @MGL{}
-
-These commands perform plotting of 1D data. 1D means that data depended from only 1 parameter like parametric curve @{x(i),y(i),z(i)@}, i=1...n. There are 5 generally different types of data representations: simple line plot (@ref{plot}), line plot with filling under it (@ref{area}), stairs plot (@ref{step}), bar plot (@ref{bars}, @ref{barh}) and vertical lines (@ref{stem}). Each type of plotting has similar interface. Most of plotting type has similar interface. There are 3D version and two 2D versions. One of last requires single array. The parameters of line and marks are specified by the string argument. If the string parameter is NULL then solid line with color from palette is used (@pxref{Line styles}). Also there are some special 1d plots having slightly different interface: surface of curve rotation (@ref{torus}), chart (@ref{chart}) and error boxes (@ref{error}), marks with variable size (@ref{mark}), tubes (@ref{tube}) and so on. @sref{1D plot sample}
-
-The plots are drawn for each row if one of the data is the matrix. By any case the sizes of 1st dimension @strong{must be equal} for all arrays @var{xdat.nx=ydat.nx=zdat.nx}. If array @var{xdat} is not specified then its an automatic array is used with values equidistantly distributed along x. If array @var{zdat} is not specified then @var{zdat}[i] = @var{zval} is used (the default is at the bottom of the bounding box). String @var{stl} specifies the color and style of line and marks (@pxref{Line styles}). By default (@code{stl=''}) solid line with color from palette is used (@pxref{Line styles}).
-
-@cindex plot
-@anchor{plot}
-@deftypefn {MGL command} {} plot ydat ['stl'='']
-@deftypefnx {MGL command} {} plot xdat ydat ['stl'='']
-@deftypefnx {MGL command} {} plot xdat ydat zdat ['stl'='']
-Draws continuous lines between points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. See also @ref{area}, @ref{step}, @ref{stem}, @ref{tube}, @ref{mark}, @ref{error}, @ref{belt}, @ref{tens}. @sref{Plot sample}
-@end deftypefn
-
-
-@cindex radar
-@anchor{radar}
-@deftypefn {MGL command} {} radar adat ['stl'='' @code{r=-1}]
-Draws radar chart which is continuous lines between points located on an radial lines (like plot in Polar coordinates). The plots are drawn for each row if one of the data is the matrix. Parameter @var{r} set the additional shift of data (i.e. the data @var{adat}+@var{r} is used instead of @var{adat}). If @code{r<0} then @code{r=max(0, -min(adat)}. String @var{pen} specifies the color and style of line and marks (@pxref{Line styles}). By default (@code{stl=""}) solid line with color from palette is used (@pxref{Line styles}). If @var{pen} containt @samp{#} symbol then "grid" (radial lines and circle for @var{r}) is drawn See also @ref{plot}. @sref{Radar sample}
-@end deftypefn
-
-@cindex tens
-@anchor{tens}
-@deftypefn {MGL command} {} tens ydat cdat ['stl'='']
-@deftypefnx {MGL command} {} tens xdat ydat cdat ['stl'='']
-@deftypefnx {MGL command} {} tens xdat ydat zdat cdat ['stl'='']
-Draws continuous lines between points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} with color defined by @var{cdat}[i] (look like tension plot). See also @ref{plot}, @ref{mesh}, @ref{fall}. @sref{Tens sample}
-@end deftypefn
-
-@cindex area
-@anchor{area}
-@deftypefn {MGL command} {} area ydat ['stl'='']
-@deftypefnx {MGL command} {} area xdat ydat ['stl'='']
-@deftypefnx {MGL command} {} area xdat ydat zdat ['stl'='']
-Draws continuous lines between points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} and fills it down to axis (to axis plane in 3D). You can use gradient filling if number of specified colors is equal to 2*number of curves. If string contain symbol @samp{a} then lines are drawn one above another (like summation). See also @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{Area sample}
-@end deftypefn
-
-@cindex region
-@anchor{region}
-@deftypefn {MGL command} {} region fdat gdat ['stl'='' @code{inside=off}]
-@deftypefnx {MGL command} {} region xdat fdat gdat ['stl'='' @code{inside=off}]
-Fills area between curves @{@var{xdat}[i], @var{fdat}[i]@} and @{@var{xdat}[i], @var{gdat}[i]@}. Parameter @code{inside=off} set to fill are with y1<y<y2 else the area with y2<y<y1 will be also filled. You can use gradient filling if number of specified colors is equal to 2*number of curves. See also @ref{area}, @ref{bars}, @ref{stem}. @sref{Region sample}
-@end deftypefn
-
-@cindex stem
-@anchor{stem}
-@deftypefn {MGL command} {} stem ydat ['stl'='']
-@deftypefnx {MGL command} {} stem xdat ydat ['stl'='']
-@deftypefnx {MGL command} {} stem xdat ydat zdat ['stl'='']
-Draws vertical lines from points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} to axis (to axis plane in 3D). See also @ref{area}, @ref{bars}, @ref{plot}, @ref{mark}. @sref{Stem sample}
-@end deftypefn
-
-@cindex bars
-@anchor{bars}
-@deftypefn {MGL command} {} bars ydat ['stl'='']
-@deftypefnx {MGL command} {} bars xdat ydat ['stl'='']
-@deftypefnx {MGL command} {} bars xdat ydat zdat ['stl'='']
-Draws vertical bars from points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} to axis (to axis plane in 3D). If style contain symbol @samp{a} then lines are drawn one above another. If string contain symbol @samp{f} then waterfall chart is drawn for determining the cumulative effect of sequentially introduced positive or negative values. You can different colors for positive and negative values if number of specified colors is equal to 2*number of curves. See also @ref{barh}, @ref{area}, @ref{stem}, @ref{chart}. @sref{Bars sample}
-@end deftypefn
-
-@cindex barh
-@anchor{barh}
-@deftypefn {MGL command} {} barh vdat ['stl'='']
-@deftypefnx {MGL command} {} barh ydat vdat ['stl'='']
-Draws horizontal bars from points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} to y-axis. If array @var{ydat} is not specified then its an automatic array is used with values equidistantly distributed along y. Marks at data points are not drawn. If style contain symbol @samp{a} then lines are drawn one above another. If string contain symbol @samp{f} then waterfall chart is drawn for determining the cumulative effect of sequentially introduced positive or negative values. You can different colors for positive and negative values if number of specified colors is equal to 2*number of curves.
-See also @ref{bars}. @sref{Barh sample}
-@end deftypefn
-
-@cindex chart
-@anchor{chart}
-@deftypefn {MGL command} {} chart adat ['col'='']
-The command draws colored stripes (boxes) for data in array @var{adat}. The number of stripes is equal to the number of rows in @var{adat} (equal to @var{a.ny}). The color of each next stripe is cyclically changed from colors specified in string @var{col} or in palette. Spaces in colors denote transparent ``color'', i.e. if @var{col} contain space(s) then corresponding stripe(s) are not drawn. The stripe width is proportional to value of element in @var{a}. Chart is plotted only for data with non-negative elements. If string @var{col} have symbol @samp{#} then black border lines are drawn. The most nice form the chart have in 3d (after rotation of coordinates) or in cylindrical coordinates (becomes so called Pie chart). @sref{Chart sample}
-@end deftypefn
-
-@cindex step
-@anchor{step}
-@deftypefn {MGL command} {} step ydat ['stl'='']
-@deftypefnx {MGL command} {} step xdat ydat ['stl'='']
-@deftypefnx {MGL command} {} step xdat ydat zdat ['stl'='']
-Draws continuous stairs for points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. See also @ref{plot}, @ref{stem}, @ref{tile}, @ref{boxs}. @sref{Step sample}
-@end deftypefn
-
-@cindex torus
-@anchor{torus}
-@deftypefn {MGL command} {} torus zdat ['stl'='']
-@deftypefnx {MGL command} {} torus rdat zdat ['stl'='']
-Draws surface which is result of curve @{@var{rdat}[i], @var{zdat}[i], @var{zdat}[i]@} rotation around @ref{axialdir} axis. If array @var{rdat} is not specified then its an automatic array is used with values equidistantly distributed along x. See also @ref{plot}, @ref{axial}. @sref{Torus sample}
-@end deftypefn
-
-@cindex tube
-@anchor{tube}
-@deftypefn {MGL command} {} tube ydat rdat ['stl'='']
-@deftypefnx {MGL command} {} tube ydat @code{rval} ['stl'='']
-@deftypefnx {MGL command} {} tube xdat ydat rdat ['stl'='']
-@deftypefnx {MGL command} {} tube xdat ydat @code{rval} ['stl'='']
-@deftypefnx {MGL command} {} tube xdat ydat zdat rdat ['stl'='']
-@deftypefnx {MGL command} {} tube xdat ydat zdat @code{rval} ['stl'='']
-Draws tube with variable radius @var{rdat}[i] (or @var{rval}) at points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. See also @ref{plot}. @sref{Tube sample}
-@end deftypefn
-
-@cindex mark
-@anchor{mark}
-@deftypefn {MGL command} {} mark ydat rdat ['stl'='']
-@deftypefnx {MGL command} {} mark xdat ydat rdat ['stl'='']
-@deftypefnx {MGL command} {} mark xdat ydat zdat rdat ['stl'='']
-Draws marks with size @var{rdat}[i]*@code{marksize} at points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. See also @ref{plot}, @ref{textmark}, @ref{stem}, @ref{error}. @sref{Mark sample}
-@end deftypefn
-
-@cindex textmark
-@anchor{textmark}
-@deftypefn {MGL command} {} textmark ydat 'txt' ['stl'='']
-@deftypefnx {MGL command} {} textmark ydat rdat 'txt' ['stl'='']
-@deftypefnx {MGL command} {} textmark xdat ydat rdat 'txt' ['stl'='']
-@deftypefnx {MGL command} {} textmark xdat ydat zdat rdat 'txt' ['stl'='']
-Draws string @var{txt} as marks with size @var{rdat}[i]*@code{marksize} at points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. If array @var{rdat} is not specified then @var{rdat}[i] = 1. See also @ref{plot}, @ref{mark}, @ref{stem}. @sref{Error sample}
-@end deftypefn
-
-@cindex error
-@anchor{error}
-@deftypefn {MGL command} {} error ydat yerr ['stl'='']
-@deftypefnx {MGL command} {} error xdat ydat yerr ['stl'='']
-@deftypefnx {MGL command} {} error xdat ydat xerr yerr ['stl'='']
-Draws error boxes @{@var{xerr}[i], @var{yerr}[i]@} at points @{@var{xdat}[i], @var{ydat}[i], @var{zval}@}. See also @ref{plot}. @sref{TextMark sample}
-@end deftypefn
-
-@cindex boxplot
-@anchor{boxplot}
-@deftypefn {MGL command} {} boxplot adat ['stl'='']
-@deftypefnx {MGL command} {} boxplot xdat adat ['stl'='']
-Draws boxplot (also known as a box-and-whisker diagram) at points @var{xdat} in plane z=@code{zval} (by default is at the bottom of the bounding box). This is five-number summaries of data <em>adat</em> (minimum, lower quartile (Q1), median (Q2), upper quartile (Q3) and maximum) along second (j-th) direction. See also @ref{plot}, @ref{error}, @ref{bars}. @sref{BoxPlot sample}
-@end deftypefn
-
-@c ##################################################################
-@node 2D plotting @MGL{}, 3D plotting @MGL{}, 1D plotting @MGL{}, MGL interface
-@section 2D plotting @MGL{}
-
-These commands perform plotting of 2D data. 2D means that data depend from 2 independent parameters like matrix @math{f(x_i,y_j), i=1...n, j=1...m}. There are 6 generally different types of data representations: simple mesh lines plot (@ref{mesh}), surface plot (@ref{surf}), surface plot by boxes (@ref{boxs}), surface plot by tiles (@ref{tile}), waterfall-like plot (@ref{fall}), belt plot (@ref{belt}), density plot (@ref{dens}), contour lines plot (@ref{cont}), solid contours plot (@ref{contf}) and its rotational figure (@ref{axial}). Commands @ref{cont}, @ref{contf} and @ref{axial} have variants for automatic and manual selection of level values for contours. Also there are commands for plotting data grid lines according to the data format (@ref{grid}) for enhancing density or contour plots. Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. @sref{2D plot sample}
-
-String parameter @var{sch} sets the color scheme (@pxref{Color scheme}). Previous color scheme is used by default. The minor dimensions of arrays @var{xdat}, @var{ydat}, @var{zdat} should be equal @code{xdat.nx=zdat.nx && ydat.nx=zdat.ny} or @code{xdat.nx=ydat.nx=zdat.nx && xdat.ny=ydat.ny=zdat.ny}. Arrays @var{xdat} and @var{ydat} can be vectors (not matrices as @var{zdat}). If array @var{xdat}, @var{ydat} is not specified then its an automatic arrays are used with values equidistantly distributed along x, y. Graphics are plotted for each z-slice of the data.
-
-@cindex surf
-@anchor{surf}
-@deftypefn {MGL command} {} surf zdat ['sch'='']
-@deftypefnx {MGL command} {} surf xdat ydat zdat ['sch'='']
-Draws surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. See also @ref{mesh}, @ref{dens}, @ref{belt}, @ref{tile}, @ref{boxs}, @ref{surfc}, @ref{surfa}. @sref{Surf sample}
-@end deftypefn
-
-@cindex mesh
-@anchor{mesh}
-@deftypefn {MGL command} {} mesh zdat ['sch'='']
-@deftypefnx {MGL command} {} mesh xdat ydat zdat ['sch'='']
-Draws mesh lines for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. See also @ref{surf}, @ref{fall}, @ref{meshnum}, @ref{cont}, @ref{tens}. @sref{Mesh sample}
-@end deftypefn
-
-@cindex fall
-@anchor{fall}
-@deftypefn {MGL command} {} fall zdat ['sch'='']
-@deftypefnx {MGL command} {} fall xdat ydat zdat ['sch'='']
-Draws fall lines for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. If @var{sch} contain @samp{x} then lines are drawn along x-direction else (by default) lines are drawn along y-direction. See also @ref{belt}, @ref{mesh}, @ref{tens}, @ref{meshnum}. @sref{Fall sample}
-@end deftypefn
-
-@cindex belt
-@anchor{belt}
-@deftypefn {MGL command} {} belt zdat ['sch'='']
-@deftypefnx {MGL command} {} belt xdat ydat zdat ['sch'='']
-Draws belts for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. If @var{sch} contain @samp{x} then belts are drawn along x-direction else (by default) lines are drawn along y-direction. See also @ref{fall}, @ref{surf}, @ref{plot}, @ref{meshnum}. @sref{Belt sample}
-@end deftypefn
-
-@cindex boxs
-@anchor{boxs}
-@deftypefn {MGL command} {} boxs zdat ['sch'='']
-@deftypefnx {MGL command} {} boxs xdat ydat zdat ['sch'='']
-Draws vertical boxes for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. See also @ref{surf}, @ref{dens}, @ref{tile}, @ref{step}. @sref{Boxs sample}
-@end deftypefn
-
-@cindex tile
-@anchor{tile}
-@deftypefn {MGL command} {} tile zdat ['sch'='']
-@deftypefnx {MGL command} {} tile xdat ydat zdat ['sch'='']
-Draws horizontal tiles for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. Such plot can be used as 3d generalization of @ref{step}. See also @ref{surf}, @ref{boxs}, @ref{step}, @ref{tiles}. @sref{Tile sample}
-@end deftypefn
-
-@cindex dens
-@anchor{dens}
-@deftypefn {MGL command} {} dens zdat ['sch'='']
-@deftypefnx {MGL command} {} dens xdat ydat zdat ['sch'='']
-Draws density plot for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal}. See also @ref{surf}, @ref{cont}, @ref{contf}, @ref{boxs}, @ref{tile}, @code{dens[xyz]}. @sref{Dens sample}
-@end deftypefn
-
-@cindex cont
-@anchor{cont}
-@deftypefn {MGL command} {} cont vdat zdat ['sch'='']
-@deftypefnx {MGL command} {} cont vdat xdat ydat zdat ['sch'='']
-Draws contour lines for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if). Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k. If string @var{stl} contain 't' (or 'T') symbol then contour labels will be drawn below (or above) the contours. See also @ref{dens}, @ref{contf}, @ref{contd}, @ref{axial}, @code{cont[xyz]}. @sref{Cont sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} cont zdat ['sch'='' @code{num=7 zval=nan}]
-@deftypefnx {MGL command} {} cont xdat ydat zdat ['sch'='' @code{num=7 zval=nan}]
-The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see, @code{caxis}).
-@end deftypefn
-
-@cindex contf
-@anchor{contf}
-@deftypefn {MGL command} {} contf vdat zdat ['sch'='']
-@deftypefnx {MGL command} {} contf vdat xdat ydat zdat ['sch'='']
-Draws solid (or filled) contours for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if). Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k (must be @code{vdat.nx>2}). See also @ref{dens}, @ref{cont}, @ref{contd}, @code{contf[xyz]}. @sref{ContF sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} contf zdat ['sch'='' @code{num=7 zval=nan}]
-@deftypefnx {MGL command} {} contf xdat ydat zdat ['sch'='' @code{num=7 zval=nan}]
-The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see, @code{caxis}).
-@end deftypefn
-
-@cindex contd
-@anchor{contd}
-@deftypefn {MGL command} {} contd vdat zdat ['sch'='']
-@deftypefnx {MGL command} {} contd vdat xdat ydat zdat ['sch'='']
-Draws solid (or filled) contours for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if) with manual colors. Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k (must be @code{vdat.nx>2}). The color of k-th contour is @code{sch[k%strlen(sch)]}. See also @ref{dens}, @ref{cont}, @ref{contf}. @sref{ContD sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} contd zdat ['sch'='' @code{num=7 zval=nan}]
-@deftypefnx {MGL command} {} contd xdat ydat zdat ['sch'='' @code{num=7 zval=nan}]
-The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see, @code{caxis}).
-@end deftypefn
-
-@cindex axial
-@anchor{axial}
-@deftypefn {MGL command} {} axial vdat zdat ['sch'='']
-@deftypefnx {MGL command} {} axial vdat xdat ydat zdat ['sch'='']
-Draws surface which is result of contour plot rotation surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k. If string @var{sch} have symbol @samp{#} then wire plot is produced. If string @var{sch} contain symbols @samp{x}, @samp{y} or @samp{z} then rotation axis @code{axialdir} will be set to specified direction. If string @var{sch} have symbol @samp{#} then wire plot is produced. See also @ref{cont}, @ref{contf}, @ref{torus}, @ref{surf3}. @sref{Axial sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} axial zdat ['sch'='' @code{num=3}]
-@deftypefnx {MGL command} {} axial xdat ydat zdat ['sch'='' @code{num=3}]
-The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see, @code{caxis}).
-@end deftypefn
-
-@cindex grad
-@anchor{grad}
-@deftypefn {MGL command} {} grad pdat ['sch'='' @code{num=5 zval=nan}]
-@deftypefnx {MGL command} {} grad xdat ydat pdat ['sch'='' @code{num=5 zval=nan}]
-@deftypefnx {MGL command} {} grad xdat ydat zdat pdat ['sch'='' @code{num=5}]
-Draws gradient lines for scalar field @var{pdat} specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j]@} or @{@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. Number of lines is proportional to @var{num}. If @var{num}<0 then lines start from borders only. See also @ref{dens}, @ref{cont}, @ref{dens3}, @ref{cont3}, @ref{flow}. @sref{Grad sample}
-@end deftypefn
-
-
-@cindex grid2
-@anchor{grid2}
-@deftypefn {MGL command} {} grid2 zdat ['sch'='']
-@deftypefnx {MGL command} {} grid2 xdat ydat zdat ['sch'='']
-Draws grid lines for density plot of surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal}. See also @ref{dens}, @ref{cont}, @ref{contf}.
-@end deftypefn
-
-
-@c ##################################################################
-@node 3D plotting @MGL{}, Dual plotting @MGL{}, 2D plotting @MGL{}, MGL interface
-@section 3D plotting @MGL{}
-
-These commands perform plotting of 3D data. 3D means that data depend from 3 independent parameters like matrix @math{f(x_i,y_j,z_k), i=1...n, j=1...m, k=1...l}. There are 4 generally different types of data representations: isosurface or surface of constant value (@ref{surf3}), density plot at slices (Dens3), contour lines plot at slices (@ref{cont3}), solid contours plot at slices (@ref{contf3}) and cloud-like plot (@ref{cloud}). Commands @ref{surf3}, @ref{cont3} and @ref{contf3} have variants for automatic and manual selection of level values for surfaces/contours. Also there are commands for plotting data grid lines according to the data format (@ref{grid3}) for enhancing density or contour plots. Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. @sref{3D plot sample}
-
-String paramter @var{sch} sets the color scheme (@pxref{Color scheme}). Previous color scheme is used by default. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). If array @var{xdat}, @var{ydat}, @var{zdat} is not specified then its an automatic arrays are used with values equidistantly distributed along x, y, z.
-
-
-@cindex surf3
-@anchor{surf3}
-@deftypefn {MGL command} {} surf3 adat @code{val} ['sch'='']
-@deftypefnx {MGL command} {} surf3 xdat ydat zdat adat @code{val} ['sch'='']
-Draws isosurface plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) at @var{a}(x,y,z)=@var{val}. If string contain @samp{#} then wire plot is produced. See also @ref{cloud}, @ref{dens3}, @ref{surf3c}, @ref{surf3a}, @ref{axial}. @sref{Surf3 sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} surf3 adat ['sch'='' @code{num=5}]
-@deftypefnx {MGL command} {} surf3 xdat ydat zdat adat ['sch'='' @code{num=5}]
-Draws @var{num}-th uniformly distributed in color range (see @ref{caxis}) isosurfaces for 3d data specified parametrically.
-@end deftypefn
-
-@cindex dens3
-@anchor{dens3}
-@deftypefn {MGL command} {} dens3 adat 'dir' [@code{sval=-1} 'sch'='']
-@deftypefnx {MGL command} {} dens3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='']
-Draws density plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Density is plotted at slice @var{sval} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. If string @var{stl} have symbol @samp{#} then grid lines are drawn. See also @ref{cont3}, @ref{contf3}, @ref{dens}, @ref{grid3}. @sref{Dens3 sample}
-@end deftypefn
-
-@cindex densa
-@anchor{densa}
-@deftypefn {MGL command} {} densa adat ['sch'='']
-@deftypefnx {MGL command} {} densa xdat ydat zdat adat ['sch'='']
-Draws density plots at all central slices of the 3d data specified parametrically.
-@end deftypefn
-
-@cindex cont3
-@anchor{cont3}
-@deftypefn {MGL command} {} cont3 vdat adat 'dir' [@code{sval=-1} 'sch'='']
-@deftypefnx {MGL command} {} cont3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='']
-Draws contour plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Contours are plotted for values specified in array @var{vdat} at slice @var{sval} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. If string @var{stl} have symbol @samp{#} then grid lines are drawn. If string @var{stl} contain 't' (or 'T') symbol then contour labels will be drawn below (or above) the contours. See also @ref{dens3}, @ref{contf3}, @ref{cont}, @ref{grid3}. @sref{Cont3 sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} cont3 adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}]
-@deftypefnx {MGL command} {} cont3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}]
-The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see @code{caxis}).
-@end deftypefn
-
-@cindex conta
-@anchor{conta}
-@deftypefn {MGL command} {} conta adat ['sch'='' @code{num=7}]
-@deftypefnx {MGL command} {} conta xdat ydat zdat adat ['sch'='' @code{num=7}]
-Draws contour plots at all central slices of the 3d data specified parametrically.
-@end deftypefn
-
-@cindex contf3
-@anchor{contf3}
-@deftypefn {MGL command} {} contf3 vdat adat 'dir' [@code{sval=-1} 'sch'='']
-@deftypefnx {MGL command} {} contf3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='']
-Draws solid contour plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Contours are plotted for values specified in array @var{vdat} at slice @var{sval} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. If string @var{stl} have symbol @samp{#} then grid lines are drawn. See also @ref{dens3}, @ref{cont3}, @ref{contf}, @ref{grid3}. @sref{ContF3 sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} contf3 adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}]
-@deftypefnx {MGL command} {} contf3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}]
-The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see @ref{caxis}).
-@end deftypefn
-
-@cindex contfa
-@anchor{contfa}
-@deftypefn {MGL command} {} contfa adat ['sch'='' @code{num=7}]
-@deftypefnx {MGL command} {} contfa xdat ydat zdat adat ['sch'='' @code{num=7}]
-Draws solid contour plots at all central slices of the 3d data specified parametrically.
-@end deftypefn
-
-@cindex grid3
-@anchor{grid3}
-@deftypefn {MGL command} {} grid3 adat 'dir' [@code{sval=-1} 'sch'='']
-@deftypefnx {MGL command} {} grid3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='']
-Draws grid for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Grid is plotted at slice @var{sval} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. See also @ref{cont3}, @ref{contf3}, @ref{dens3}, @ref{grid2}. @sref{Dens3 sample}
-@end deftypefn
-
-@cindex grida
-@anchor{grida}
-@deftypefn {MGL command} {} grida adat ['sch'='']
-@deftypefnx {MGL command} {} grida xdat ydat zdat adat ['sch'='']
-Draws grids at all central slices of the 3d data specified parametrically.
-@end deftypefn
-
-@cindex cloud
-@anchor{cloud}
-@deftypefn {MGL command} {} cloud adat ['sch'='']
-@deftypefnx {MGL command} {} cloud xdat ydat zdat adat ['sch'='']
-Draws cloud for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). This plot is a set of cubes with color and transparency proportional to value of @var{adat}. The resulting plot is like cloud -- low value is transparent but higher ones are not. The number of plotting cells depend on @ref{meshnum}. Paramater @var{alpha} changes the overall transparency of plot. See also @ref{surf3}. @sref{Cloud sample}
-@end deftypefn
-
-@cindex beam
-@anchor{beam}
-@deftypefn {MGL command} {} beam tr g1 g2 adat @code{rval} ['sch'='' @code{flag=0 num=3}]
-Draws @var{num}-th uniformly distributed in color range (see @code{caxis}) isosurfaces for 3d array @var{adat}. This is special kind of plot for @var{adat} specified in accompanied coordinates along curve @var{tr} with orts @var{g1}, @var{g2} and with transverse scale @var{rval}. Variable @var{flag} is bitwise: @samp{0x1} - draw in accompanied (not laboratory) coordinates; @samp{0x2} - draw projection to @math{\rho-z} plane; @samp{0x4} - draw normalized in each slice field. The x-size of data arrays @var{tr}, @var{g1}, @var{g2} must be nx>2. The y-size of data arrays @var{tr}, @var{g1}, @var{g2} and z-size of the data array @var{a} must be equal. See also @ref{surf3}.
-@end deftypefn
-
-
-@c ##################################################################
-@node Dual plotting @MGL{}, Vector fields @MGL{}, 3D plotting @MGL{}, MGL interface
-@section Dual plotting @MGL{}
-
-These plotting commands draw @emph{two matrix} simultaneously. There are 5 generally different types of data representations: surface or isosurface colored by other data (@ref{surfc}, @ref{surf3c}), surface or isosurface transpared by other data (@ref{surfa}, @ref{surf3a}), tiles with variable size (@ref{tiles}), mapping diagram (@ref{map}), STFA diagram (@ref{stfa}). Commands @ref{surf3a} and @ref{surf3c} have variants for automatic and manual selection of level values for isosurfaces. Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array.
-
-String paramter @var{sch} sets the color scheme (@pxref{Color scheme}). Previous color scheme is used by default. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). If array @var{xdat}, @var{ydat}, @var{zdat} is not specified then its an automatic arrays are used with values equidistantly distributed along x, y, z.
-
-@cindex surfc
-@anchor{surfc}
-@deftypefn {MGL command} {} surfc zdat cdat ['sch'='']
-@deftypefnx {MGL command} {} surfc xdat ydat zdat cdat ['sch'='']
-Draws surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} and color it by matrix @var{cdat}[i,j]. See also @ref{surf}, @ref{surfa}, @ref{surf3c}. @sref{SurfC sample}
-@end deftypefn
-
-@cindex surf3c
-@anchor{surf3c}
-@deftypefn {MGL command} {} surf3c adat cdat @code{val} ['sch'='']
-@deftypefnx {MGL command} {} surf3c xdat ydat zdat adat cdat @code{val} ['sch'='']
-Draws isosurface plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) at @var{a}(x,y,z)=@var{val}. It is mostly the same as @ref{surf3} command but the color of isosurface depends on values of array @var{cdat}. If string contain @samp{#} then wire plot is produced. See also @ref{surf3}, @ref{surfc}, @ref{surf3a}. @sref{Surf3C sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} surf3c adat cdat ['sch'='' @code{num=5}]
-@deftypefnx {MGL command} {} surf3c xdat ydat zdat adat cdat ['sch'='' @code{num=5}]
-Draws @var{num}-th uniformly distributed in color range (see @code{caxis}) isosurfaces for 3d data specified parametrically.
-@end deftypefn
-
-@cindex surfa
-@anchor{surfa}
-@deftypefn {MGL command} {} surfa zdat cdat ['sch'='']
-@deftypefnx {MGL command} {} surfa xdat ydat zdat cdat ['sch'='']
-Draws surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} and transparent it by matrix @var{cdat}[i,j]. See also @ref{surf}, @ref{surfc}, @ref{surf3a}, @ref{tiles}. @sref{SurfA sample}
-@end deftypefn
-
-@cindex surf3a
-@anchor{surf3a}
-@deftypefn {MGL command} {} surf3a adat cdat @code{val} ['sch'='']
-@deftypefnx {MGL command} {} surf3a xdat ydat zdat adat cdat @code{val} ['sch'='']
-Draws isosurface plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) at @var{a}(x,y,z)=@var{val}. It is mostly the same as @ref{surf3} command but the transparency of isosurface depends on values of array @var{cdat}. If string contain @samp{#} then wire plot is produced. See also @ref{surf3}, @ref{surfa}, @ref{surf3c}. @sref{Surf3A sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} surf3a adat cdat ['sch'='' @code{num=5}]
-@deftypefnx {MGL command} {} surf3a xdat ydat zdat adat cdat ['sch'='' @code{num=5}]
-Draws @var{num}-th uniformly distributed in color range (see @code{caxis}) isosurfaces for 3d data specified parametrically.
-@end deftypefn
-
-@cindex tiles
-@anchor{tiles}
-@deftypefn {MGL command} {} tiles zdat rdat ['sch'='']
-@deftypefnx {MGL command} {} tiles xdat ydat zdat rdat ['sch'='']
-Draws horizontal tiles for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. It is mostly the same as @ref{tile} but the size of tiles is determined by @var{rdat} array. See also @ref{surfa}, @ref{tile}. @sref{TileS sample}
-@end deftypefn
-
-@cindex map
-@anchor{map}
-@deftypefn {MGL command} {} map udat vdat ['sch'='' @code{pnts=on}]
-@deftypefnx {MGL command} {} map xdat ydat udat vdat ['sch'='' @code{pnts=on}]
-Draws mapping plot for matrixes @{@var{udat}, @var{vdat} @} which parametrically depend on coordinates @var{xdat}, @var{ydat}. The previous position of the cell (point) is marked by color. Height is proportional to Jacobian(udat,vdat). This plot is like Arnold diagram ???. If @code{pnts=off} then face is drawn otherwise the color ball at matrix knots are drawn. The size of @var{udat} and @var{vdat} must be the same. @sref{Map sample}
-@end deftypefn
-
-@cindex stfa
-@anchor{stfa}
-@deftypefn {MGL command} {} stfa re im @code{dn} ['sch'='' @code{pnts=on}]
-@deftypefnx {MGL command} {} stfa xdat ydat re im @code{dn} ['sch'='' @code{pnts=on}]
-Draws spectrogram of complex array @var{re}+i*@code{im} for Fourier size of @var{dn} points at plane @var{z=zVal}. Parameter @var{dn} is arbitrary even integer. For example in 1D case, result is density plot of data @math{res[i,j]=|\sum_d^dn exp(I*j*d)*(re[i*dn+d]+I*im[i*dn+d])|/dn} with size @{int(nx/dn), dn, ny@}. @sref{STFA sample}
-@end deftypefn
-
-
-
-
-@c ##################################################################
-@node Vector fields @MGL{}, Other plotting @MGL{}, Dual plotting @MGL{}, MGL interface
-@section Vector fields @MGL{}
-
-These commands perform plotting of 2D and 3D vector fields. There are 6 generally different types of vector fields representations: simple vector field (@ref{vect}), vector field by dew-drops (@ref{dew}), flow threads (@ref{flow}), flow pipes (@ref{pipe}), vectors along a curve (@ref{traj}). Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of color scheme are specified by the string argument. @xref{Color scheme}.
-
-The color is specified by the string argument @var{sch}. Previous color scheme is used by default. Parameter @var{flag} setup the hachures (arrows). It is combination of values: @code{1} for drawing bi-color arrow, @code{2} for drawing fixed length arrows, @code{4} for drawing arrows to the cell point, @code{8} for drawing arrows with center at cell point, @code{16} for drawing hachures with dots instead of arrows.
-
-The size of @var{udat}, @var{vdat} and @var{wdat} must be equal. The minor dimensions of arrays @var{xdat}, @var{ydat}, @var{zdat} and @var{udat} must be equal too. Arrays @var{xdat}, @var{ydat} and @var{zdat} can be vectors (not matrices as @var{udat}). The graphics is plotted for each z slice of @var{udat}, @var{vdat} for 2D case.
-
-@cindex traj
-@anchor{traj}
-@deftypefn {MGL command} {} traj xdat ydat udat vdat ['sch'='' @code{zval=nan len=0}]
-@deftypefnx {MGL command} {} traj xdat ydat zdat udat vdat wdat ['sch'='' @code{len=0}]
-Draws vectors @{@var{udat}, @var{vdat}, @var{wdat}@} along a curve @var{xdat}, @var{ydat}, @var{zdat}. The length and color of arrows are proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. See also @code{vect}. @sref{Traj sample}
-@end deftypefn
-
-@cindex vect
-@anchor{vect}
-@deftypefn {MGL command} {} vect udat vdat ['sch'='' @code{zval=nan flag=0}]
-@deftypefnx {MGL command} {} vect xdat ydat udat vdat ['sch'='' @code{zval=nan flag=0}]
-Draws plane vector field plot for the field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zval}. The length and color of arrows are proportional to @math{\sqrt@{udat^2+vdat^2@}}. The number of arrows depend on @ref{meshnum}. See also @ref{flow}, @ref{dew}, @ref{vectc}. @sref{Vect sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} vect udat vdat wdat ['sch'='' @code{flag=0}]
-@deftypefnx {MGL command} {} vect xdat ydat zdat udat vdat wdat ['sch'='' @code{flag=0}]
-This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the length and color of arrows are proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Vect 3D sample}
-@end deftypefn
-
-@cindex vectc
-@anchor{vectc}
-@deftypefn {MGL command} {} vectc udat vdat ['sch'='']
-@deftypefnx {MGL command} {} vectc xdat ydat udat vdat ['sch'='']
-Draws plane vector field plot for the field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zVal}. The color of hachures is proportional to @math{\sqrt@{udat^2+vdat^2@}}. The number of hachures depend on @var{meshnum}. See also @code{vect, flow, pipe, dew}. @sref{VectC sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} vectc udat vdat wdat ['sch'='']
-@deftypefnx {MGL command} {} vectc xdat ydat zdat udat vdat wdat ['sch'='']
-This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the color of hachures is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{VectC 3D sample}
-@end deftypefn
-
-@cindex vectl
-@anchor{vectl}
-@deftypefn {MGL command} {} vectl udat vdat ['sch'='']
-@deftypefnx {MGL command} {} vectl xdat ydat udat vdat ['sch'='']
-Draws plane vector field plot for the field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zVal}. The length of hachures is proportional to @math{\sqrt@{udat^2+vdat^2@}}. The number of hachures depend on @var{meshnum}. See also @code{vectc, flow, pipe, dew}. @sref{Vect sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} vectl udat vdat wdat ['sch'='']
-@deftypefnx {MGL command} {} vectl xdat ydat zdat udat vdat wdat ['sch'='']
-This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the length of hachures is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{VectL 3D sample}
-@end deftypefn
-
-@cindex dew
-@anchor{dew}
-@deftypefn {MGL command} {} dew udat vdat ['sch'='']
-@deftypefnx {MGL command} {} dew xdat ydat udat vdat ['sch'='']
-Draws dew-drops for plane vector field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zval}. The color of drops is proportional to @math{\sqrt@{udat^2+vdat^2@}}. The number of drops depend on @ref{meshnum}. Note that this is very expensive plot in memory usage and creation time! See also @ref{vect}. @sref{Dew sample}
-@end deftypefn
-
-@cindex flow
-@anchor{flow}
-@deftypefn {MGL command} {} flow udat vdat ['sch'='' @code{num=5 zval=nan}]
-@deftypefnx {MGL command} {} flow xdat ydat udat vdat ['sch'='' @code{num=5 zval=nan}]
-Draws plane flow threads for the vector field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zVal}. Number of threads is proportional to @var{num}. The color of lines is proportional to @math{\sqrt@{udat^2+vdat^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). See also @code{vect, vectc, pipe}. @sref{Flow sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} flow udat vdat wdat ['sch'='' @code{num=3}]
-@deftypefnx {MGL command} {} flow xdat ydat zdat udat vdat wdat ['sch'='' @code{num=3}]
-This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the color is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Flow 3D sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} flow @code{x0 y0} udat vdat ['sch'='']
-@deftypefnx {MGL command} {} flow @code{x0 y0} xdat ydat udat vdat ['sch'='']
-Draws plane flow threads for the vector field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} from point @{@var{x0}, @var{y0}@} at level @var{z=zVal}. The color of lines is proportional to @math{\sqrt@{udat^2+vdat^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). See also @code{vect, vectc, pipe}. @sref{Flow sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} flow @code{x0 y0 z0} udat vdat wdat ['sch'='']
-@deftypefnx {MGL command} {} flow @code{x0 y0 z0} xdat ydat zdat udat vdat wdat ['sch'='']
-Draws flow thread from point @{@var{x0}, @var{y0}, @var{z0}@}. Arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the color is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Flow 3D sample}
-@end deftypefn
-
-
-@cindex pipe
-@anchor{pipe}
-@deftypefn {MGL command} {} pipe udat vdat ['sch'='' @code{r0=0.05 num=5 zval=nan}]
-@deftypefnx {MGL command} {} pipe xdat ydat udat vdat ['sch'='' @code{r0=0.05 num=5 zval=nan}]
-Draws plane flow pipes for the vector field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zVal}. Number of pipes is proportional to @var{num}. The color of pipes is proportional to @math{\sqrt@{udat^2+vdat^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). Parameter @var{r0} set the base pipe radius. If @var{r0}<0 then pipe radius is inverse proportional to amplitude. The size of @var{ax} and @var{ay} must be equal. See also @code{vect, vectc, pipe}. @sref{Pipe sample}
-@end deftypefn
-
-@deftypefn {MGL command} {} pipe udat vdat wdat ['sch'='' @code{r0=0.05 num=3}]
-@deftypefnx {MGL command} {} pipe xdat ydat zdat udat vdat wdat ['sch'='' @code{r0=0.05 num=3}]
-This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the color is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Pipe 3D sample}
-@end deftypefn
-
-
-@c ##################################################################
-@node Other plotting @MGL{}, Nonlinear fitting @MGL{}, Vector fields @MGL{}, MGL interface
-@section Other plotting @MGL{}
-
-These commands perform miscelaneous plotting. There is unstructured data points plots (Dots), surface reconstruction (Crust), surfaces on the triangular mesh (TriPlot) or quadrangular mesh (QuadPlot), textual formula plotting (Plots by formula), data plots at edges (Dens[XYZ], Cont[XYZ], ContF[XYZ]), simple plot (SimplePlot). Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of color scheme are specified by the string argument. @xref{Color scheme}.
-
-@cindex densx
-@cindex densy
-@cindex densz
-@anchor{densz} @anchor{densy} @anchor{densx}
-@deftypefn {MGL command} {} densx dat ['sch'='' @code{val=nan}]
-@deftypefnx {MGL command} {} densy dat ['sch'='' @code{val=nan}]
-@deftypefnx {MGL command} {} densz dat ['sch'='' @code{val=nan}]
-These plotting commands draw density plot in x, y or z plain. If @var{dat} is a tensor (3-dimensional data) then interpolation to a given @var{val} is performed. These commands are useful for creating projections of the 3D data array to the bounding box. See also @code{cont[xyz], contf[xyz]}, @ref{dens}. @sref{Dens projection sample}
-@end deftypefn
-
-@cindex contx
-@cindex conty
-@cindex contz
-@anchor{contz} @anchor{conty} @anchor{contx}
-@deftypefn {MGL command} {} contx dat ['sch'='' @code{val=nan num=7}]
-@deftypefnx {MGL command} {} conty dat ['sch'='' @code{val=nan num=7}]
-@deftypefnx {MGL command} {} contz dat ['sch'='' @code{val=nan num=7}]
-These plotting commands draw contour lines in x, y or z plain. If @var{dat} is a tensor (3-dimensional data) then interpolation to a given @var{val} is performed. These commands are useful for creating projections of the 3D data array to the bounding box. See also @code{dens[xyz], contf[xyz]}, @ref{cont}. @sref{Cont projection sample}
-@end deftypefn
-
-@cindex contfx
-@cindex contfy
-@cindex contfz
-@anchor{contfz} @anchor{contfy} @anchor{contfx}
-@deftypefn {MGL command} {} contfx dat ['sch'='' @code{val=nan num=7}]
-@deftypefnx {MGL command} {} contfy dat ['sch'='' @code{val=nan num=7}]
-@deftypefnx {MGL command} {} contfz dat ['sch'='' @code{val=nan num=7}]
-These plotting commands draw solid contours in x, y or z plain. If @var{dat} is a tensor (3-dimensional data) then interpolation to a given @var{val} is performed. These commands are useful for creating projections of the 3D data array to the bounding box. See also @code{dens[xyz], cont[xyz]}, @ref{contf}.
-@end deftypefn
-
-@cindex dots
-@anchor{dots}
-@deftypefn {MGL command} {} dots xdat ydat zdat ['sch'='']
-@deftypefnx {MGL command} {} dots xdat ydat zdat adat ['sch'='']
-Draws the arbitrary placed points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Variable @var{adat}[i] set transparency for dots. See also @ref{crust}, @ref{mark}, @ref{plot}. @sref{Dots sample}
-@end deftypefn
-
-@cindex crust
-@anchor{crust}
-@deftypefn {MGL command} {} crust xdat ydat zdat ['sch'='']
-Reconstructs and draws the surface for arbitrary placed points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. If string contain @samp{#} then wire plot is produced. See also @ref{dots}, @ref{triplot}. @sref{Crust sample}
-@end deftypefn
-
-@cindex triplot
-@anchor{triplot}
-@deftypefn {MGL command} {} triplot idat xdat ydat ['sch'='']
-@deftypefnx {MGL command} {} triplot idat xdat ydat zdat ['sch'='']
-@deftypefnx {MGL command} {} triplot idat xdat ydat zdat cdat ['sch'='']
-Draws the surface of triangles. Triangle vertexes are set by indexes @var{idat} of data points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. If string contain @samp{#} then wire plot is produced. First dimensions of @var{idat} must be 3 or greater. See also @code{dots, crust, quadplot}. Parameter @var{cdat} set the colors of triangles (if @var{idat}.ny=@var{cdat}.nx) or colors of vertexes (if @var{xdat}.nx=@var{cdat}.nx). See also @ref{dots}, @ref{crust}, @ref{quadplot}, @ref{tricont}.
-@end deftypefn
-
-@cindex tricont
-@anchor{tricont}
-@deftypefn {MGL command} {} tricont vdat idat xdat ydat zdat cdat ['sch'='']
-@deftypefnx {MGL command} {} tricont vdat idat xdat ydat zdat ['sch'='']
-@deftypefnx {MGL command} {} tricont idat xdat ydat zdat ['sch'='' @code{num=7 zval=nan}]
-Draws contour lines for surface of triangles at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if). Triangle vertexes are set by indexes @var{idat} of data points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k (or @var{num} contours equidistantly distributed in range [@var{Cmin}, @var{Cmax}].). See also @ref{triplot}, @ref{cont}.
-@end deftypefn
-
-@cindex quadplot
-@anchor{quadplot}
-@deftypefn {MGL command} {} quadplot idat xdat ydat ['sch'='']
-@deftypefnx {MGL command} {} quadplot idat xdat ydat zdat ['sch'='']
-@deftypefnx {MGL command} {} quadplot idat xdat ydat zdat cdat ['sch'='']
-Draws the surface of quadrangles. Quadrangle vertexes are set by indexes @var{idat} of data points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. If string contain @samp{#} then wire plot is produced. First dimensions of @var{idat} must be 4 or greater. See also @code{triplot, dots, crust}. Parameter @var{cdat} set the colors of triangles (if @var{idat}.ny=@var{cdat}.nx) or colors of vertexes (if @var{xdat}.nx=@var{cdat}.nx). See also @ref{triplot}.
-@end deftypefn
-
-@cindex fplot
-@anchor{fplot}
-@deftypefn {MGL command} {} fplot 'y(x)' ['pen'='' @code{zval=nan num=100}]
-Draws command function @samp{y(x)} at plane z=@var{zval} where @samp{x} variable is changed in @code{xrange}. You do not need to create the data arrays to plot it. The parameter @var{num} set the minimal number of points along coordinate(s) for plots. See also @ref{plot}.
-@end deftypefn
-
-@deftypefn {MGL command} {} fplot 'x(t)' 'y(t)' 'z(t)' ['pen'='' @code{num=100}]
-Draws command parametrical curve @{@samp{x(t)}, @samp{y(t)}, @samp{z(t)}@} where @samp{t} variable is changed in range [0, 1]. You do not need to create the data arrays to plot it. The parameter @var{num} set the minimal number of points along coordinate(s) for plots. See also @ref{plot}.
-@end deftypefn
-
-@cindex fsurf
-@anchor{fsurf}
-@deftypefn {MGL command} {} fsurf 'z(x,y)' ['sch'='' @code{num=100}]
-Draws command surface for function @samp{z(x,y)} where @samp{x}, @samp{y} variable are changed in @code{xrange, yrange}. You do not need to create the data arrays to plot it. The parameter @var{num} set the minimal number of points along coordinate(s) for plots. See also @ref{surf}.
-@end deftypefn
-
-@deftypefn {MGL command} {} fsurf 'x(u,v)' 'y(u,v)' 'z(u,v)' ['sch'='' @code{num=100}]
-Draws command parametrical surface @{@samp{x(u,v)}, @samp{y(u,v)}, @samp{z(u,v)}@} where @samp{u}, @samp{v} variable are changed in range [0, 1]. You do not need to create the data arrays to plot it. The parameter @var{num} set the minimal number of points along coordinate(s) for plots. See also @ref{surf}.
-@end deftypefn
-
-
-@c ##################################################################
-@node Nonlinear fitting @MGL{}, Data create @MGL{}, Other plotting @MGL{}, MGL interface
-@section Nonlinear fitting @MGL{}
-
-These commands fit data to formula. Fitting goal is to find formula parameters for the best fit the data points, i.e. to minimize the sum @math{\sum_i (f(x_i, y_i, z_i) - a_i)^2/s_i^2}. At this, approximation function @samp{f} can depend only on one argument @samp{x} (1D case), on two arguments @samp{x,y} (2D case) and on three arguments @samp{x,y,z} (3D case). The command @samp{f} also may depend on parameters. Normally the list of fitted parameters is specified by @var{var} string (like, @samp{abcd}). Usually user should supply initial values for fitted parameters by @var{ini} variable. But if he/she don't supply it then the zeros are used.
-
-Commands @ref{fit} and @ref{fits} do not draw the obtained data themselves. They fill the data @var{out} by formula @samp{f} with found coefficients. At this, the @samp{x,y,z} coordinates are equidistantly distributed in the bounding box. Number of points in @var{out} is selected as maximal value of @var{out} size or 100. Also you may print the last formula with found coefficients by @code{putsfit} command. @sref{Fitting sample}
-
-The dimensions of arrays must be at least the same as the number of specified arrays @var{xdat}, @var{ydat}, @var{zdat}. Also the fitting only along specified directions will be performed (for example, along x and y if only @var{xdat} and @var{ydat} are specified). If array @var{xdat} is not specified then its an automatic array is used with values equidistantly distributed along x.
-
-
-@cindex fits
-@anchor{fits}
-@deftypefn {MGL command} {} fits adat sdat 'func' 'var' [ini=0]
-@deftypefnx {MGL command} {} fits xdat adat sdat 'func' 'var' [ini=0]
-@deftypefnx {MGL command} {} fits xdat ydat adat sdat 'func' 'var' [ini=0]
-@deftypefnx {MGL command} {} fits xdat ydat zdat adat sdat 'func' 'var' [ini=0]
-Fit data along x-, y- and z-directions for 1d-,2d- or 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) with weight factor @var{sdat}[i,j,k].
-@end deftypefn
-
-@cindex fit
-@anchor{fit}
-@deftypefn {MGL command} {} fit adat 'func' 'var' [ini=0]
-@deftypefnx {MGL command} {} fit xdat adat 'func' 'var' [ini=0]
-@deftypefnx {MGL command} {} fit xdat ydat adat 'func' 'var' [ini=0]
-@deftypefnx {MGL command} {} fit xdat ydat zdat adat 'func' 'var' [ini=0]
-Fit data along x-, y- and z-directions for 1d-,2d- or 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) with weight factor =1.
-@end deftypefn
-
-@cindex putsfit
-@anchor{putsfit}
-@deftypefn {MGL command} {} putsfit @code{x y} ['pre'='' 'fnt'='' @code{size=-1}]
-Print last fitted formula with found coefficients (as numbers) at position @{@var{x}, @var{y}@}. The string @var{pre} will be printed before formula. All other parameters are the same as in @ref{Text printing @MGL{}}.
-@end deftypefn
-
-
-@c ##################################################################
-@node Data create @MGL{}, Data filling @MGL{}, Nonlinear fitting @MGL{}, MGL interface
-@section Data create @MGL{}
-
-@cindex new
-@anchor{new}
-@deftypefn {MGL command} {} new dat [@code{nx=1 ny=1 nz=1}]
-Creates or recreates the array @var{dat} with specified size and fills it by zero. This command does nothing if one of parameters @var{nx}, @var{ny}, @var{nz} is zero or negative.
-@end deftypefn
-
-@cindex var
-@anchor{var}
-@deftypefn {MGL command} {} var dat @code{num v1 [v2=nan]}
-Creates new variable with name @var{dat} for one-dimensional array of size @var{num}. Array elements are equidistantly distributed in range [@var{v1}, @var{v2}]. If @var{v2}=@code{nan} then @var{v2=v1} is used.
-@end deftypefn
-
-@cindex list
-@anchor{list}
-@deftypefn {MGL command} {} list dat @code{v1 ...}
-Creates new variable with name @var{dat} and fills it by numeric values of command arguments @code{v1 ...}. Command can create one-dimensional and two-dimensional arrays with arbitrary values. For creating 2d array the user should use delimiter @samp{|} which means that the following values lie in next row. Array sizes are [maximal of row sizes * number of rows]. For example, command @code{list 1 | 2 3} creates the array [1 0; 2 3]. Note, that the maximal number of arguments is 1000.
-@end deftypefn
-
-@deftypefn {MGL command} {} list dat d1 ...
-Creates new variable with name @var{dat} and fills it by data values of arrays of command arguments @var{d1 ...}. Command can create two-dimensional or three-dimensional (if arrays in arguments are 2d arrays) arrays with arbitrary values. Minor dimensions of all arrays in arguments should be equal to dimensions of first array d1. In the opposite case the argument will be ignored. Note, that the maximal number of arguments is 1000.
-@end deftypefn
-
-@cindex copy
-@anchor{copy}
-@deftypefn {MGL command} {} copy dat1 dat2 ['eq'='' @code{on_axis=on}]
-@deftypefnx {MGL command} {} copy dat1 @code{val}
-Creates new variable with name @var{dat1} and fills it by data values of array @var{dat2}. At this, if parameter @var{eq} is specified then the data will be modified by corresponding formula by the same way as in @ref{fill} command (for @code{on_axis=on}) or in @ref{modify} command (for @code{on_axis=off}).
-@end deftypefn
-
-@cindex idset
-@anchor{idset}
-@deftypefn {MGL command} {} idset dat 'ids'
-Set the symbol id for data columns. The string must contain one symbol 'a'...'z' per column (without spaces).
-@end deftypefn
-
-@cindex info
-@anchor{info}
-@deftypefn {MGL command} {} info dat [@code{detail=off}]
-Display information (sizes, maximum/minimum, momentums and so on) about the data dat. Show brief information by default (if @code{detail=off}).
-@end deftypefn
-
-@deftypefn {MGL command} {} info 'text'
-Display @var{text} as information (warning).
-@end deftypefn
-
-@c ------------------------------------------------------------------
-@node Data filling @MGL{}, Rearrange data @MGL{}, Data create @MGL{}, MGL interface
-@section Data filling @MGL{}
-@cindex fill
-@cindex modify
-
-@cindex fill
-@anchor{fill}
-@deftypefn {MGL command} {} fill dat v1 v2 ['dir'='x']
-Equidistantly fills the data values to range [@var{x1}, @var{x2}] in direction @var{dir}=@{@samp{x},@samp{y},@samp{z}@}.
-@end deftypefn
-
-@deftypefn {MGL command} {} fill dat 'eq'
-@deftypefnx {MGL command} {} fill dat 'eq' vdat
-@deftypefnx {MGL command} {} fill dat 'eq' vdat wdat
-Command fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in @emph{bounding box} (in difference from @code{modify} commands). Variable @samp{u} is the original value of the array. Variables @samp{v} and @samp{w} are values of @var{vdat}, @var{wdat}.
-@end deftypefn
-
-@cindex modify
-@anchor{modify}
-@deftypefn {MGL command} {} modify dat 'eq' [@code{dim=0}]
-@deftypefnx {MGL command} {} modify dat 'eq' vdat
-@deftypefnx {MGL command} {} modify dat 'eq' vdat wdat
-Command fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}. Coordinates @samp{x}, @samp{y}, @samp{z} are data indexes normalized in range [0,1]. Variable @samp{u} is the original value of the array. If @var{dim}>0 is specified then modification will be fulfilled only for slices >=@var{dim}.
-@end deftypefn
-
-
-@cindex put
-@anchor{put}
-@deftypefn {MGL command} {} put dat @code{val [i=: j=: k=:]}
-Function sets value(s) of array @var{dat}[@var{i}, @var{j}, @var{k}] = @var{val}. Negative indexes @var{i}, @var{j}, @var{k}=@samp{:} set the value @var{val} to whole range in corresponding direction(s). For example, @code{put dat val : 0 :} sets @var{dat}[i,0,j]=@var{val} for i=0...(@var{dat}.nx-1), j=0...(@var{dat}.nz-1).
-@end deftypefn
-
-@deftypefn {MGL command} {} put dat vdat [@code{i=: j=: k=:}]
-Function copies value(s) from array @var{vdat} to the range of array @var{dat}. Negative indexes @var{i}, @var{j}, @var{k}=@samp{:} set the range in corresponding direction(s). At this minor dimensions of array @var{vdat} should be large than corresponding dimensions of array @var{dat}. For example, @code{put dat v : 0 :} sets @var{dat}[i,0,j]=@var{vdat}.ny>@var{dat}.nz ? @var{vdat}[i,j] : @var{vdat}[i], where i=0...(@var{dat}.nx-1), j=0...(@var{dat}.nz-1) and condition vdat.nx>=dat.nx is true.
-@end deftypefn
-
-
-
-@c ------------------------------------------------------------------
-@node Rearrange data @MGL{}, File I/O @MGL{}, Data filling @MGL{}, MGL interface
-@section Rearrange data @MGL{}
-
-@cindex rearrange
-@anchor{rearrange}
-@deftypefn {MGL command} {} rearrange dat @code{mx [my=0 mz=0]}
-Rearrange dimensions without changing data array so that resulting sizes should be @var{mx}*@var{my}*@var{mz} < nx*ny*nz. If some of parameter @var{my} or @var{mz} are zero then it will be selected to optimal fill of data array. For example, if @var{my}=0 then it will be change to @var{my}=nx*ny*nz/@var{mx} and @var{mz} will be 1.
-@end deftypefn
-
-@cindex extend
-@anchor{extend}
-@deftypefn {MGL command} {} extend dat @code{n1 [n2=0]}
-Increase the dimensions of the data by inserting new (|@var{n1}|+1)-th slices after (for @var{n1}>0) or before (for @var{n1}<0) of existed one. It is possible to insert 2 dimensions simultaneously for 1d data by using parameter @var{n2}. Data to new slices is copy from existed one. For example, for @var{n1}>0 new array will be
-@iftex
-@math{a_{ij}^{new} = a_i^{old}} where j=0...@var{n1}. Correspondingly, for @var{n1}<0 new array will be @math{a_{ij}^{new} = a_j^{old}} where i=0...|@var{n1}|.
-@end iftex
-@ifnottex
-a_ij^new = a_i^old where j=0...@var{n1}. Correspondingly, for @var{n1}<0 new array will be a_ij^new = a_j^old where i=0...|@var{n1}|.
-@end ifnottex
-@end deftypefn
-
-@cindex transpose
-@anchor{transpose}
-@deftypefn {MGL command} {} transpose dat ['dim'='yxz']
-Transposes (shift order of) dimensions of the data. New order of dimensions is specified int string @var{dim}. This command may be useful also for the reading of one-dimensional data.
-@end deftypefn
-
-@cindex squeeze
-@anchor{squeeze}
-@deftypefn {MGL command} {} squeeze dat @code{rx [ry=1 rz=1 sm=off]}
-Reduces the data size by excluding data elements which indexes are not divisible by @var{rx}, @var{ry}, @var{rz} correspondingly. Parameter @var{sm} set to use smoothing
-@iftex
-(i.e. @math{a_{out}[i]=\sum_{j=i}^{i+r}a[j]/r}) or not (i.e. @math{a_{out}[i]=a[j*r]}).
-@end iftex
-@ifnottex
-(i.e. out[i]=\sum_@{j=i@}^@{i+r@} a[j]/r) or not (i.e. out[i]=a[j*r]).
-@end ifnottex
-@end deftypefn
-
-@cindex crop
-@anchor{crop}
-@deftypefn {MGL command} {} crop dat @code{n1 n2} 'dir'
-Cuts off edges of the data @var{i}<@var{n1} and @var{i}>@var{n2} if @var{n2}>0 or @var{i}>@code{n[xyz]}-@var{n2} if @var{n2}<=0 along direction @var{dir}.
-@end deftypefn
-
-@cindex delete
-@anchor{delete}
-@deftypefn {MGL command} {} delete dat
-Deletes variable @var{dat} and makes its memory free. Can be useful for huge data arrays.
-@end deftypefn
-
-@deftypefn {MGL command} {} delete dat 'dir' @code{[pos=off num=0]}
-Delete @var{num} slices along @var{dir}-direction at position @var{pos}.
-@end deftypefn
-
-@cindex insert
-@anchor{insert}
-@deftypefn {MGL command} {} insert dat 'dir' @code{[pos=off num=0]}
-Insert @var{num} slices along @var{dir}-direction at position @var{pos}.
-@end deftypefn
-
-@c ------------------------------------------------------------------
-@node File I/O @MGL{}, Make another data @MGL{}, Rearrange data @MGL{}, MGL interface
-@section File I/O @MGL{}
-
-@cindex read
-@anchor{read}
-@deftypefn {MGL command} {} read dat 'fname'
-Reads data from tab-separated text file with auto determining sizes of the data.
-@end deftypefn
-
-@deftypefn {MGL command} {} read dat 'fname' @code{mx [my=1 mz=1]}
-Reads data from text file with specified data sizes. This command does nothing if one of parameters @var{mx}, @var{my} or @var{mz} is zero or negative.
-@end deftypefn
-
-@cindex readmat
-@anchor{readmat}
-@deftypefn {MGL command} {} readmat dat 'fname' [@code{dim=2}]
-Read data from text file with size specified at beginning of the file by first @var{dim} numbers. At this, variable @var{dim} set data dimensions.
-@end deftypefn
-
-@cindex readall
-@anchor{readall}
-@deftypefn {MGL command} {} readall dat 'templ' @code{v1 v2 [dv=1 slice=off]}
-Join data arrays from several text files. The file names are determined by function call @code{sprintf(fname,templ,val);}, where @var{val} changes from @var{v1} to @var{v2} with step @var{dv}. The data load one-by-one in the same slice if @var{slice}=@code{off} or as slice-by-slice if @var{slice}=@code{on}.
-@end deftypefn
-
-@deftypefn {MGL command} {} readall dat 'templ' @code{[slice=off]}
-Join data arrays from several text files which filenames satisfied the template @var{templ} (for example, @var{templ}=@code{"t_*.dat"}). The data load one-by-one in the same slice if @var{slice}=@code{off} or as slice-by-slice if @var{slice}=@code{on}.
-@end deftypefn
-
-@cindex save
-@anchor{save}
-@deftypefn {MGL command} {} save dat 'fname'
-Saves the whole data array to tab-separated text file.
-@end deftypefn
-
-@cindex readhdf
-@anchor{readhdf}
-@deftypefn {MGL command} {} readhdf dat 'fname' 'dname'
-Reads data array named @var{dname} from HDF5 or HDF4 file @var{fname}.
-@end deftypefn
-
-@cindex savehdf
-@anchor{savehdf}
-@deftypefn {MGL command} {} savehdf dat 'fname' 'dname'
-Saves data array named @var{dname} from HDF5 or HDF4 file @var{fname}.
-@end deftypefn
-
-@cindex import
-@anchor{import}
-@deftypefn {MGL command} {} import dat 'fname' 'sch' [@code{v1=0 v2=1}]
-Reads data from bitmap file. The RGB values of bitmap pixels are transformed to float values in range [@var{v1}, @var{v2}] using color scheme @var{sch} (@pxref{Color scheme}).
-@end deftypefn
-
-@cindex export
-@anchor{export}
-@deftypefn {MGL command} {} export dat 'fname' 'sch' [@code{v1=0 v2=0}]
-Saves data matrix to bitmap file. The data values are transformed from range [@var{v1}, @var{v2}] to RGB pixels of bitmap using color scheme @var{sch} (@pxref{Color scheme}). If @var{v1}>=@var{v2} then the values of @var{v1}, @var{v2} are automatically determined as minimal and maximal value of the data array.
-@end deftypefn
-
-@c ------------------------------------------------------------------
-@node Make another data @MGL{}, Change data @MGL{}, File I/O @MGL{}, MGL interface
-@section Make another data @MGL{}
-
-@cindex combine
-@anchor{combine}
-@deftypefn {MGL command} {} combine res adat bdat
-Returns direct multiplication of arrays (like, res[i,j] = adat[i]*bdat[j] and so on).
-@end deftypefn
-
-@cindex evaluate
-@anchor{evaluate}
-@deftypefn {MGL command} {} evaluate res dat idat [@code{norm=on}]
-@deftypefnx {MGL command} {} evaluate res dat idat jdat [@code{norm=on}]
-@deftypefnx {MGL command} {} evaluate res dat idat jdat kdat [@code{norm=on}]
-Get array which values is result of interpolation of original array for coordinates from other arrays (for example, res[i,j]=dat[idat[i,j],jdat[i,j]]). All dimensions must be the same for data @var{idat}, @var{jdat}, @var{kdat}. Coordinates from @var{idat}, @var{jdat}, @var{kdat} are supposed to be normalized in range [0,1] (if @var{norm}=@code{true}) or in ranges [0,nx], [0,ny], [0,nz] correspondingly.
-@end deftypefn
-
-@cindex hist
-@anchor{hist}
-@deftypefn {MGL command} {} hist res dat @code{num v1 v2 [nsub=0]}
-@deftypefnx {MGL command} {} hist res dat wdat @code{num v1 v2 [nsub=0]}
-Creates @var{num}-th points distribution @var{res} of the data values of @var{dat} in range [@var{v1}, @var{v2}]. Array @var{wdat} specifies weights of the data elements (all weight is 1 if @var{wdat} is not specified). Parameter @var{nsub} define the number of additional interpolated points (for smoothness of histogram).
-@end deftypefn
-
-@deftypefn {MGL command} {} hist res xdat adat
-@deftypefnx {MGL command} {} hist res xdat ydat adat
-@deftypefnx {MGL command} {} hist res xdat ydat zdat adat
-Creates distribution @var{res} of the data values of @var{adat} in axis range [Min, Max]. Array @var{adat} look like weights of the data points.
-@end deftypefn
-
-
-@cindex momentum
-@anchor{momentum}
-@deftypefn {MGL command} {} momentum res dat 'how' ['dir'='z']
-Get momentum (1D-array) of the data along direction @var{dir}. String @var{how} contain kind of momentum. The momentum is defined like as
-@iftex
-@math{res_k = \sum_{ij} how(x_i,y_j,z_k) a_{ij}/\sum_{ij} a_{ij}}
-@end iftex
-@ifnottex
-res_k = \sum_ij how(x_i,y_j,z_k) a_ij/ \sum_ij a_ij
-@end ifnottex
-if @var{var}=@samp{z} and so on. Coordinates @samp{x}, @samp{y}, @samp{z} are data indexes normalized in range [0,1].
-@end deftypefn
-
-@cindex sum
-@anchor{sum}
-@deftypefn {MGL command} {} sum res dat 'dir'
-Gets array which is the result of summation in given direction or direction(s).
-@end deftypefn
-@cindex max
-@anchor{max}
-@deftypefn {MGL command} {} max res dat 'dir'
-Gets array which is the maximal data values in given direction or direction(s).
-@end deftypefn
-@cindex min
-@anchor{min}
-@deftypefn {MGL command} {} min res dat 'dir'
-Gets array which is the minimal data values in given direction or direction(s).
-@end deftypefn
-
-@cindex resize
-@anchor{resize}
-@deftypefn {MGL command} {} resize res dat @code{mx [my=1 mz=1]}
-Makes array @var{res} of sizes @var{mx}, @var{my}, @var{mz} with interpolated data of array @var{dat}.
-@end deftypefn
-
-@cindex subdata
-@anchor{subdata}
-@deftypefn {MGL command} {} subdata res dat @code{xx [yy=: zz=:]}
-Extracts sub-array data @var{res} from the original data @var{dat} array keeping fixed positive index. For example @code{subdata a b : 2} extracts 3d row (indexes are zero based), @code{subdata a b 4 :} extracts 5th column, @code{subdata a b : : 3} extracts 4th slice and so on. Note that symbol @samp{:} is defined @samp{:}=@code{-1} in MGL.
-@end deftypefn
-
-@cindex trace
-@anchor{trace}
-@deftypefn {MGL command} {} trace res dat
-Gets array of diagonal elements @var{dat}[i,i] (for 2D case) or @var{dat}[i,i,i] (for 3D case) where i=0...nx-1. Function return copy of @var{dat} for 1D case. Data array must have dimensions @var{dat}.ny, @var{dat}.nz >= @var{dat}.nx or @var{dat}.ny, @var{dat}.nz = 1.
-@end deftypefn
-
-@cindex transform
-@anchor{transform}
-@deftypefn {MGL command} {} transform dat 'type' real imag
-Do integral transformation of complex data @var{real}, @var{imag} on specified direction. The order of transformations is specified in string @var{type}: first character for x-dimension, second one for y-dimension, third one for z-dimension. The possible character are: @samp{f} is forward Fourier transformation, @samp{i} is inverse Fourier transformation, @samp{s} is Sine transform, @samp{c} is Cosine transform, @samp{h} is Hankel transform, @samp{n} or @samp{ } is no transformation.
-@end deftypefn
-
-@cindex transforma
-@anchor{transforma}
-@deftypefn {MGL command} {} transforma dat 'type' ampl phase
-The same as previous but with specified amplitude @var{ampl} and phase @var{phase} of complex numbers.
-@end deftypefn
-
-@cindex stfad
-@anchor{stfad}
-@deftypefn {MGL command} {} stfad res real imag @code{dn} ['dir'='x']
-Short time Fourier transformation for real and imaginary parts. Output is amplitude of partial Fourier of length @var{dn}. For example if @var{dir}=@samp{x}, result will have size @{int(nx/dn), dn, ny@} and it will contain @math{res[i,j,k]=|\sum_d^dn exp(I*j*d)*(real[i*dn+d,k]+I*imag[i*dn+d,k])|/dn}.
-@end deftypefn
-
-@cindex pde
-@anchor{pde}
-@deftypefn {MGL command} {} pde res 'ham' ini_re ini_im [@code{dz=0.1 k0=100}]
-Solves equation du/dz = i*k0*@var{ham}(p,q,x,y,z,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators. Parameters @var{ini_re}, @var{ini_im} specify real and imaginary part of initial field distribution. Coordinates of the equation (and the solution) are supposed to be in the bounding box. Note, that really this ranges are increased by factor 3/2 for purpose of reducing reflection from boundaries. Parameter @var{dz} set the step along evolutionary coordinate z. At this moment, simplified form of function @var{ham} is supported -- all ``mixed'' terms (like @samp{x*p}->x*d/dx) are excluded. For example, in 2D case this function is effectively @math{ham = f(p,z) + g(x,z,u)}. However commutable combinations (like @samp{x*q}->x*d/dy) are allowed. Here variable @samp{u} is used for field amplitude |u|. This allow one solve nonlinear problems -- for example, for non-linear Shrodinger equation you may set @code{ham='p^2+q^2-u^2'}. You may specify imaginary part for wave absorption, like @code{ham = 'p^2+i*x*(x>0)'}, but only if dependence on variable @samp{i} is linear (i.e. @math{ham = hre+i*him}). @sref{PDE sample}
-@end deftypefn
-
-@cindex ray
-@anchor{ray}
-@deftypefn {MGL command} {} ray res 'ham' @code{x0 y0 z0 p0 q0 v0 [dt=0.1 tmax=10]}
-Solves GO ray equation like d@emph{r}/dt = d @var{ham}/d@emph{p}, d@emph{p}/dt = -d @var{ham}/d@emph{r}. This is Hamiltonian equations for particle trajectory in 3D case. Here @var{ham} is Hamiltonian which may depend on coordiantes @samp{x}, @samp{y}, @samp{z}, momentums @samp{p}=px, @samp{q}=py, @samp{v}=pz and time @samp{t}: @math{ham = H(x,y,z,p,q,v,t)}. The starting point (at @code{t=0}) is defined by variables @{@var{x0}, @var{y0}, @var{z0}, @var{p0}, @var{q0}, @var{v0}@}. Parameters @var{dt} and @var{tmax} specify the integration step and maximal time for ray tracing. Result is array of @{x,y,z,p,q,v,t@} with dimensions @{7 * int(@var{tmax}/@var{dt}+1) @}. See also @ref{pde}. @sref{Beam tracing sample}
-@end deftypefn
-
-@cindex qo2d
-@anchor{qo2d}
-@deftypefn {MGL command} {} qo2d res 'ham' ini_re ini_im ray [@code{r=1 k0=100} xx=0 yy=0]
-Solves equation du/dt = i*k0*@var{ham}(p,q,x,y,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators. Parameters @var{ini_re}, @var{ini_im} specify real and imaginary part of initial field distribution. Parameters @var{ray} set the reference ray, i.e. the ray around which the accompanied coordinate system will be maked. You may use, for example, the array created by @ref{ray} function. Note, that the reference ray @strong{must be} smooth enough to make accompanied coodrinates unambiguity. Otherwise errors in the solution may appear. If @var{xx} and @var{yy} are non-zero then Cartesian coordinates for each point will be written into them. @sref{Beam tracing sample}
-@end deftypefn
-
-@cindex jacobian
-@anchor{jacobian}
-@deftypefn {MGL command} {} jacobian res xdat ydat [zdat=0]
-Computates the Jacobian for transformation @{i,j,k@} to @{@var{xdat},@var{ydat},@var{zdat}@} where initial coordinates @{i,j,k@} are data indexes normalized in range [0,1]. The Jacobian is determined by formula det||@math{dr_\alpha/d\xi_\beta}|| where @math{r}=@{@var{xdat},@var{ydat},@var{zdat}@} and @math{\ xi}=@{i,j,k@}. All dimensions must be the same for all data arrays. Data must be 3D if all 3 arrays @{@var{xdat},@var{ydat},@var{zdat}@} are specified or 2D if only 2 arrays @{@var{xdat},@var{ydat}@} are specified.
-@end deftypefn
-
-
-
-@c ------------------------------------------------------------------
-@node Change data @MGL{}, Operators @MGL{}, Make another data @MGL{}, MGL interface
-@section Change data @MGL{}
-
-These commands change the data in some direction like differentiations, integrations and so on. The direction in which the change will applied is specified by the string parameter, which may contain @samp{x}, @samp{y} or @samp{z} characters for 1-st, 2-nd and 3-d dimension correspondingly.
-
-@cindex cumsum
-@anchor{cumsum}
-@deftypefn {MGL command} {} cumsum dat 'dir'
-Cumulative summation of the data in given direction or directions.
-@end deftypefn
-@cindex integrate
-@anchor{integrate}
-@deftypefn {MGL command} {} integrate dat 'dir'
-Integrates (like cumulative summation) the data in given direction or directions.
-@end deftypefn
-@cindex diff
-@anchor{diff}
-@deftypefn {MGL command} {} diff dat 'dir'
-Differentiates the data in given direction or directions.
-@end deftypefn
-@deftypefn {MGL command} {} diff dat xdat ydat [zdat=0]
-Differentiates the data @var{dat} specified parametrically in direction @var{xdat} with @var{ydat}, @var{zdat}=constant. Parameter @var{zdat} can be omitted that correspond to 2D case. Parametrical differentiation uses the formula (for 2D case): @math{da/dx = (a_j*y_i-a_i*y_j)/(x_j*y_i-x_i*y_j)} where @math{a_i=da/di, a_j=da/dj} denotes usual differentiation along 1st and 2nd dimensions. The similar formula is used for 3D case. Note, that you may change the order of arguments -- for example, if you have 2D data a(i,j) which depend on coordinates @{x(i,j), y(i,j)@} then usual derivative along @samp{x} will be @code{diff a x y} and usual derivative along @samp{y} will be @code{diff a y x}.
-@end deftypefn
-
-@cindex diff2
-@anchor{diff2}
-@deftypefn {MGL command} {} diff2 dat 'dir'
-Double-differentiates (like Laplace operator) the data in given direction.
-@end deftypefn
-
-@cindex sinfft
-@anchor{sinfft}
-@deftypefn {MGL command} {} sinfft dat 'dir'
-Do Sine transform of the data in given direction or directions. The Sine transform is @math{\sum a_i \sin(k i)}.
-@end deftypefn
-@cindex cosfft
-@anchor{cosfft}
-@deftypefn {MGL command} {} cosfft dat 'dir'
-Do Cosine transform of the data in given direction or directions. The Cosine transform is @math{\sum a_i \cos(k i)}.
-@end deftypefn
-@cindex hankel
-@anchor{hankel}
-@deftypefn {MGL command} {} hankel dat 'dir'
-Do Hankel transform of the data in given direction or directions. The Hankel transform is @math{\sum a_i J_0(k i)}.
-@end deftypefn
-
-
-@cindex swap
-@anchor{swap}
-@deftypefn {MGL command} {} swap dat 'dir'
-Swaps the left and right part of the data in given direction (useful for Fourier spectrum).
-@end deftypefn
-@cindex roll
-@anchor{roll}
-@deftypefn {MGL command} {} roll dat 'dir' num
-Rolls the data along direction 'dir'. Resulting array will be out[i] = ini[(i+num)%nx] if @code{dir='x'}.
-@end deftypefn
-
-@cindex mirror
-@anchor{mirror}
-@deftypefn {MGL command} {} mirror dat 'dir'
-Mirror the left-to-right part of the data in given direction. Looks like change the value index @var{i}->@var{n-i}.
-@end deftypefn
-
-@cindex sew
-@anchor{sew}
-@deftypefn {MGL command} {} sew dat ['dir'='xyz' @code{da=2*pi}]
-Remove value steps (like phase jumps after inverse trigonometric commands) with period @var{da} in given direction.
-@end deftypefn
-@cindex smooth
-@anchor{smooth}
-@deftypefn {MGL command} {} smooth data @code{type} ['dir'='xyz']
-Smooths the data on specified direction or directions by method @var{Type}. Now 4 methods are supported: @samp{0} does nothing, @samp{1} linear averaging by 3 points, @samp{2} linear averaging by 5 points, @samp{3} quadratic averaging by 5 points.
-@end deftypefn
-
-@cindex envelop
-@anchor{envelop}
-@deftypefn {MGL command} {} envelop dat ['dir'='x']
-Find envelop for data values along direction @var{dir}. Only one direction can be specified at once.
-@end deftypefn
-
-@cindex normsl
-@anchor{normsl}
-@deftypefn {MGL command} {} normsl dat @code{v1 v2} ['dir'='z' @code{keep=on sym=off}]
-Normalizes data slice-by-slice along direction @var{dir} the data in slices to range [@var{v1},@var{v2}]. If flag @var{sym}=@code{on} then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. If @var{keep} is set then maximal value of k-th slice will be limited by
-@iftex
-@math{\sqrt{\sum a_{ij}(k)/\sum a_{ij}(0)}}.
-@end iftex
-@ifnottex
-@math{\sqrt@{\sum a_ij(k)/\sum a_ij(0)@}}.
-@end ifnottex
-@end deftypefn
-
-@cindex norm
-@anchor{norm}
-@deftypefn {MGL command} {} norm dat @code{v1 v2 [sym=off dim=0]}
-Normalizes the data to range [@var{v1},@var{v2}]. If flag @var{sym}=@code{on} then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. Modification will be applied only for slices >=@var{dim}.
-@end deftypefn
-
-@c ------------------------------------------------------------------
-@node Operators @MGL{}, Program flow @MGL{}, Change data @MGL{}, MGL interface
-@section Operators @MGL{}
-
-@cindex multo
-@anchor{multo}
-@deftypefn {MGL command} {} multo dat dat2
-Multiplies the data by the other one for each element.
-@end deftypefn
-@deftypefn {MGL command} {} multo dat @code{val}
-Multiplies each element by the number.
-@end deftypefn
-
-@cindex divto
-@anchor{divto}
-@deftypefn {MGL command} {} divto dat dat2
-Divides the data by the other one for each element.
-@end deftypefn
-@deftypefn {MGL command} {} divto dat @code{val}
-Divides each element by the number.
-@end deftypefn
-
-@cindex addto
-@anchor{addto}
-@deftypefn {MGL command} {} addto dat dat2
-Adds the other data.
-@end deftypefn
-@deftypefn {MGL command} {} addto dat @code{val}
-Adds the number to each element.
-@end deftypefn
-
-@cindex subto
-@anchor{subto}
-@deftypefn {MGL command} {} subto dat dat2
-Subtracts the other data.
-@end deftypefn
-@deftypefn {MGL command} {} subto dat @code{val}
-Subtracts the number to each element.
-@end deftypefn
-
-@c ------------------------------------------------------------------
-@node Program flow @MGL{}, Command options @MGL{}, Operators @MGL{}, MGL interface
-@section Program flow @MGL{}
-
-These commands control program flow, like, conditions, cycles, define script arguments and so on.
-
-@cindex chdir
-@anchor{chdir}
-@deftypefn {MGL command} {} chdir 'path'
-Changes the current directory to @var{path}.
-@end deftypefn
-
-@cindex define
-@anchor{define}
-@deftypefn {MGL command} {} define $N smth
-Sets @var{N}-th script argument to @var{smth}. Note, that @var{smth} is used as is (with @samp{'} symbols if present). Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@deftypefn {MGL command} {} define name smth
-Create scalar variable @code{name} which have the numeric value of @code{smth}. Later you can use this variable as usual number. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@cindex defchr
-@anchor{defchr}
-@deftypefn {MGL command} {} defchr $N smth
-Sets @var{N}-th script argument to character with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@cindex defnum
-@anchor{defnum}
-@deftypefn {MGL command} {} defnum $N smth
-Sets @var{N}-th script argument to number with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@cindex defpal
-@anchor{defpal}
-@deftypefn {MGL command} {} defpal $N smth
-Sets @var{N}-th script argument to palette character at position evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-
-@cindex call
-@anchor{call}
-@deftypefn {MGL command} {} call 'fname' [ARG1 ARG2 ... ARG9]
-Executes function @var{fname} (or script if function is not found). Optional arguments will be passed to functions. See also @ref{func}.
-@end deftypefn
-@cindex func
-@anchor{func}
-@deftypefn {MGL command} {} func 'fname' [narg=0]
-Define the function @var{fname} and number of required arguments. The arguments will be placed in script parameters $1, $2, ... $9. Note, you should stop script execution before function definition(s) by command @ref{stop}. See also @ref{return}.
-@end deftypefn
-@cindex return
-@anchor{return}
-@deftypefn {MGL command} {} return
-Return from the function. See also @ref{func}.
-@end deftypefn
-
-
-@cindex if
-@anchor{if}
-@deftypefn {MGL command} {} if dat 'cond'
-Starts block which will be executed if @var{dat} satisfy to @var{cond}.
-@end deftypefn
-@deftypefn {MGL command} {} if @code{val}
-Starts block which will be executed if @code{val} is nonzero.
-@end deftypefn
-@cindex elseif
-@anchor{elseif}
-@deftypefn {MGL command} {} elseif dat 'cond'
-Starts block which will be executed if previous @code{if} or @code{elseif} is false and @var{dat} satisfy to @var{cond}.
-@end deftypefn
-@deftypefn {MGL command} {} elseif @code{val}
-Starts block which will be executed if previous @code{if} or @code{elseif} is false and @code{val} is nonzero.
-@end deftypefn
-@cindex else
-@anchor{else}
-@deftypefn {MGL command} {} else
-Starts block which will be executed if previous @code{if} or @code{elseif} is false.
-@end deftypefn
-@cindex endif
-@anchor{endif}
-@deftypefn {MGL command} {} endif
-Finishes @code{if/elseif/else} block.
-@end deftypefn
-
-@cindex for
-@anchor{for}
-@deftypefn {MGL command} {} for $N @code{v1 v2 [dv=1]}
-Starts cycle with $@var{N}-th argument changing from @var{v1} to @var{v2} with the step @var{dv}. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@deftypefn {MGL command} {} for $N dat
-Starts cycle with $@var{N}-th argument changing for @var{dat} values. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@cindex next
-@anchor{next}
-@deftypefn {MGL command} {} next
-Finishes @code{for} cycle.
-@end deftypefn
-
-@cindex once
-@anchor{once}
-@deftypefn {MGL command} {} once @code{val}
-The code between @code{once on} and @code{once off} will be executed only once. Useful for large data manipulation in programs like UDAV.
-@end deftypefn
-@cindex stop
-@anchor{stop}
-@deftypefn {MGL command} {} stop
-Terminate execution.
-@end deftypefn
-
-@c ------------------------------------------------------------------
-@node Command options @MGL{}, Suffixes, Program flow @MGL{}, MGL interface
-@section Command options @MGL{}
-
-Command options allow the easy setup of the plot by changing of global settings only for this plot. Options are specified at the end of string. Each option is separated from the previous text by symbol @samp{;}. Options work so that them remember the current settings, change settings as it being set in the option, execute command and return the original settings back. So, the options usage for data handling commands or for graphics setup commands is useless.
-
-The most useful options are @code{xrange, yrange, zrange}. They sets the boundaries for data change. This boundaries are used for automatically filled variables. So, these options allow one to change the position of some plots. For example, in command @code{plot y; xrange 0.1 0.9} the x coordinate will be equidistantly distributed in range 0.1 ... 0.9.
-
-The full list of options are:
-@cindex alpha
-@cindex alphadef
-@deffn {MGL option} alpha @code{val}
-@deffnx {MGL option} alphadef @code{val}
-Sets alpha value (transparency) of the plot. The value should be in range [0, 1]. See also @ref{alphadef}.
-@end deftypefn
-@cindex ambient
-@deffn {MGL option} ambient @code{val}
-Sets brightness of ambient light for the plot. The value should be in range [0, 1]. See also @ref{ambient}.
-@end deftypefn
-@cindex crange
-@deffn {MGL option} crange @code{val1 val2}
-Sets boundaries of color change for the plot. See also @ref{crange}.
-@end deftypefn
-@cindex xrange
-@deffn {MGL option} xrange @code{val1 val2}
-Sets boundaries of x coordinate change for the plot. See also @ref{xrange}.
-@end deftypefn
-@cindex yrange
-@deffn {MGL option} yrange @code{val1 val2}
-Sets boundaries of y coordinate change for the plot. See also @ref{yrange}.
-@end deftypefn
-@cindex zrange
-@deffn {MGL option} zrange @code{val1 val2}
-Sets boundaries of z coordinate change for the plot. See also @ref{zrange}.
-@end deftypefn
-@cindex cut
-@deffn {MGL option} cut @code{val}
-Sets whether to cut or to project the plot points lying outside the bounding box. See also @ref{cut}.
-@end deftypefn
-@cindex fontsize
-@deffn {MGL option} fontsize @code{val}
-Sets the size of text. See also @ref{font}.
-@end deftypefn
-@cindex marksize
-@deffn {MGL option} marksize @code{val}
-Sets the size of marks. See also @ref{marksize}.
-@end deftypefn
-@cindex meshnum
-@deffn {MGL option} meshnum @code{val}
-Work like @ref{meshnum} command.
-@end deftypefn
-@cindex legend
-@deffn {MGL option} legend 'txt'
-Adds string 'txt' to internal legend accumulator. The style of described line and mark is taken from arguments of the last @ref{1D plotting @MGL{}} command. See also @ref{legend}.
-@end deftypefn
-
-@c ------------------------------------------------------------------
-@node Suffixes, Utilities, Command options @MGL{}, MGL interface
-@section Suffixes for variable
-
-Suffixes can get some numerical value (like its size, maximal or minimal value, the sum of elements and so on) of the data array in variable and use it later as usual number in command arguments. The suffixes start from point @samp{.} right after (without spaces) variable name or its sub-array. For example, @code{a.nx} give the x-size of data @var{a}, @code{b(1).max} give maximal value of second row of variable @var{b}, @code{(c(:,0)^2).sum} give the sum of squares of elements in the first column of @var{c} and so on.
-
-The full list of suffixes are:
-@table @strong
-@item nx, ny, nz
-Give the data size in x-, y-, z-direction correspondingly.
-@item max
-Give maximal value of the data.
-@item min
-Give minimal value of the data.
-@item sum
-Give sum of data values.
-@item a
-Give first value of data array.
-@item fst
-Give first nonzero value of data array.
-@item lst
-Give last nonzero value of data array.
-@item mx, my, mz
-Give x-, y-, z-position of data maximum.
-@item ax, ay, az, aa
-Give x-, y-, z-position of data mass center or average data value.
-@item wx, wy, wz, wa
-Give width in x-, y-, z-direction or data dispersion value.
-@item sx, sy, sz, sa
-Give skewness in x-, y-, z-direction or data skewness value.
-@item kx, ky, kz, ka
-Give kurtosis in x-, y-, z-direction or data kurtosis value.
-@end table
-
-@c ------------------------------------------------------------------
-@node Utilities, , Suffixes, MGL interface
-@section Utilities for parsing MGL
-
-MathGL library provides several tools for parsing MGL scripts. There is tools saving it to bitmap (@code{mgl2png}, @code{mgl2gif}) or vectorial (@code{mgl2eps}, @code{mgl2svg}) images. Tool @code{mglview} show MGL script and allow to rotate and setup the image. Also you can translate MGL script to C++ file by help of @code{mgl2cpp} tool.
-
-All of this tools have similar set of arguments. First argument is name of script file, next argument is optional output file name, last arguments are options. There are options for setting script parameters (it is @code{$0, $1, ... $9}) and locale settings. The script parameters have format @samp{-Nval}. Here N=0,1...9 is parameter ID and val is its value. For example, option @samp{-1test} set to substitute @samp{test} instead of @code{$1} in the script. Option -Lval set locale to val. For example, @samp{-Lutf8} will set UTF-8 locale for script.
-
-Additionally you can create animated GIF file or a set of JPEG files with names @samp{frameNNNN.jpg} (here @samp{NNNN} is frame index). You should use @code{mgl2gif} tool and specify the values of @code{$0} parameter for making animation. Values of the parameter @code{$0} can be specified inside the script by comment @code{##a val} for each value @code{val} (one comment for one value) or by option(s) @samp{-Aval}. Also you can specify a cycle for animation by comment @code{##c v1 v2 dv} or by option @code{-Cn1:n2}. Tool @code{mgl2gif} will execute script several times (once for each specified value of @code{$0}) and save result in animated GIF file. For saving each frame in JPEG just add command @code{write ''} at the end of the script.
-
+++ /dev/null
-@c ------------------------------------------------------------------
-@chapter Язык MGL
-
-MathGL имеет встроенный скриптовый язык MGL для обработки и отображения данных. Скрипты MGL можно использовать как независимо (программами UDAV, mgl2png, mgl2eps, mgl2svg и пр., @pxref{Utilities}) так и вызовами библиотеки.
-
-Язык MGL достаточно простой. Каждая строка -- отдельная команда. Первое слово -- имя команды, а все остальные ее аргументы. Команда может иметь до 1000 аргументов (по крайней мере сейчас). Слова разделяются одно от другого пробелом или символом табуляции. Различий между верхним и нижним индексом нет, т.е. переменные @var{a} и @var{A} идентичны. Символ @samp{#} начинает комментарий -- все символы после него игнорируются до конца строки. Исключением является случай, когда @samp{#} входит в строку. Опции команды указываются после символа @samp{;} (@pxref{Command options @MGL{}}). Символ @samp{:} начинает новую команду (подобно переводу строки) если он расположен не внутри скобок или строки.
-
-Если строка содержит ссылки на внешние параметры (@samp{$0}, @samp{$1} ... @samp{$9}) или макроопределения (@samp{$a}, @samp{$b} ... @samp{$z}), то текущие значения параметров/макроопределений подставляются в строку вместо ссылки до выполнением команды. Это позволяет использовать один и тот же скрипт при различных входных параметрах командной строки или вводить макроопределения по ходу исполнения команд скрипта.
-
-Аргументы команды могут быть строками, переменными или числами.
-@itemize @bullet
-@item
-Строка -- произвольный набор символов между метками @samp{'}.
-
-@item
-Обычно переменная имеет имя, состоящее из букв и чисел (должно начинаться с буквы и не быть длиннее 64 символов). В качестве переменной можно использовать временные массивы, включающие в себя:
-@itemize @bullet
-@item
-срезы (``подмассивы'') массивов данных (подобно команде @ref{subdata}). Например, @code{a(1)} или @code{a(1,:)} или @code{a(1,:,:)} -- вторая строка массива @var{a}, @code{a(:,2)} или @code{a(:,2,:)} -- третий столбец, @code{a(:,:,0)} -- первый срез и т.д. Также можно выделить часть массива с m-го по n-ый элемент @code{a(m:n,:,:)} или просто @code{a(m:n)}.
-
-@item
-произвольные комбинации столбцов данных (например, @code{a('n*w^2/exp(t)')}), если столбцы данных были именованы командой @ref{idset} или в файле данных (в строке начинающейся с @code{##}).
-
-@item
-произвольное выражение из существующих переменных и констант. Например, @samp{sqrt(dat(:,5)+1)} даст временный массив данных с элементами равными @code{tmp[i,j] = sqrt(dat[i,5,j]+1)}.
-
-@item
-массивы с элементами заданными в квадратных скобках [], разделенные @samp{,}. При этом внутри выражения не должно быть пробелов! Например, @samp{[1,2,3]} даст временный массив из 3 элементов @{1, 2, 3@}; @samp{[[11,12],[21,22]]} даст матрицу 2*2 и т.д. Элементами такой конструкции могут быть и массивы если их размерности одинаковые, например @samp{[v1,v2,...,vn]}.
-
-@item
-результат команд построения новых данных (@pxref{Make another data}), если они заключены в фигурные скобки @{@}. Например, @samp{@{sum dat 'x'@}} даст временный массив, который есть результат суммирования @var{dat} вдоль 'x'. Это такой же массив как и @var{tmp}, полученный командой @samp{sum tmp dat 'x'}. При этом можно использовать вложенные конструкции, например @samp{@{sum @{max dat 'z'@} 'x'@}}.
-@end itemize
-Временные массивы не могут стоять в качестве первого аргумента команд, создающих массивы (например, @samp{new}, @samp{read}, @samp{hist} и т.д.).
-
-@item
-К скалярным переменным, кроме собственно чисел, относятся: специальные переменные @code{nan=#QNAN, pi=3.1415926..., on=1, off=0, :=-1}, переменные с суффиксами (@pxref{Suffixes}), переменные определенные командой @ref{define}. Также массивы размером 1x1x1 считаются скалярами (например, @samp{pi/dat.nx}).
-@end itemize
-Перед первым использованием все переменные должны быть определены с помощью команд, создающих массивы (@ref{new}, @ref{var}, @ref{list}, @ref{copy}, @ref{read}, @ref{hist}, @ref{sum} и др., @pxref{Data create @MGL{}} и @ref{Make another data @MGL{}}).
-
-Команды могут иметь несколько наборов аргументов (например, @code{plot ydat} и @code{plot xdat ydat}). Все аргументы команды для выбранного набора должны быть указаны, однако часть из них могут иметь значения по умолчанию. Такие аргументы в описании команд будут помещены в квадратные скобки [], например @code{plot ydat ['stl'='' zval=nan]}. При этом запись @code{[arg1 arg2 arg3 ...]} подразумевает @code{[arg1 [arg2 [arg3 ...]]]}, т.е. опускать можно только аргументы с конца, если вы согласны с их значениями по умолчанию. Например, @code{plot ydat '' 1} или @code{plot ydat ''} правильно, а @code{plot ydat 1} не правильно (аргумент @code{'stl'} пропущен).
-
-Все команды MGL можно разделить на несколько групп. В дальнейшем будет использованы следующие обозначения при описании команд: имя команды выделено жирным, строки заключены в одинарные кавычки '', переменные выделены курсивом, числа (скаляры) выделены моноширинным шрифтом. Необязательные аргументы будут помещены в квадратные скобки [] и показаны их значения по умолчанию. Подробную информацию о цвете и стиле линий (@pxref{Line styles}), цветовых схемах (@pxref{Color scheme}), стиле текста и символах TeX (@pxref{Font styles}), текстовых формулах (@pxref{Textual formulas}) можно найти в соответствующих разделах.
-
-@menu
-@ifset UDAV
-* General concepts::
-@end ifset
-* Graphics setup @MGL{}::
-* Axis settings @MGL{}::
-* Transformation matrix @MGL{}::
-* Export to file @MGL{}::
-* Primitives drawing @MGL{}::
-* Text printing @MGL{}::
-* Axis and Colorbar @MGL{}::
-* Legend @MGL{}::
-* 1D plotting @MGL{}::
-* 2D plotting @MGL{}::
-* 3D plotting @MGL{}::
-* Dual plotting @MGL{}::
-* Vector fields @MGL{}::
-* Other plotting @MGL{}::
-* Nonlinear fitting @MGL{}::
-* Data create @MGL{}::
-* Data filling @MGL{}::
-* Rearrange data @MGL{}::
-* File I/O @MGL{}::
-* Make another data @MGL{}::
-* Change data @MGL{}::
-* Operators @MGL{}::
-* Program flow @MGL{}::
-* Command options @MGL{}::
-* Suffixes::
-* Utilities::
-@end menu
-
-@c ##################################################################
-@ifset UDAV
-@node General concepts, , Utilities, MGL interface
-@section Основные принципы
-
-Возможности библиотеки MathGL довольно богаты -- число только основных типов графиков превышает 50 видов. Кроме того, есть функции для обработки данных, настройки вида графика и пр. и пр. Тем не менее, я старался придерживаться единого стиля в порядке аргументов функций и способе их ``настройки''. В основном все ниже сказанное относится к функциям рисования различных графиков.
-
-Всего основных концепций (базисных идей) четыре:
-@enumerate
-@item
-@strong{Все настройки графиков (стиль линий, цветовые схемы поверхностей, стиль и цвет текста) задаются строками.} Это обеспечивает: удобство для пользователя -- короткую строку легче читать и здесь тяжелее ошибиться, чем в большом списке параметров; переносимость -- строки выглядят одинаково на всех платформах и не надо заботиться о типе и числе аргументов.
-@item
-@strong{Все функции имеют ``упрощенный'' и ``продвинутый'' варианты.} Сделано опять из-за удобства. В ``упрощенном'' варианте для построения графика нужны только один-два массив(а) данных, которые автоматически равнораспределяются в заданном диапазоне осей координат. В ``продвинутой'' версии можно не только указать явно диапазон построения графика, но и задать его параметрически. Последнее позволяет легко строить довольно сложные кривые и поверхности. В обоих вариантах функций порядок аргументов стандартен: сначала идут массивы данных, потом необязательный строковый параметр стиля графика, а далее -- второстепенные необязательные параметры для более точной настройки графика.
-@item
-@strong{Все элементы рисунков векторные.} Изначально библиотека MathGL была ориентированна на работу с научными данными, которые по своей природе векторные (линии, грани, матрицы и т.д.). Поэтому векторность используется во всех рисунках! Причем иногда даже в ущерб производительности (например, при выводе шрифтов). Помимо всего прочего, векторность позволяет легко масштабировать рисунок -- измените размер картинки в 2 раза, и рисунок пропорционально растянется.
-@item
-@strong{Новые графики не удаляют уже нарисованное.} Этот, в чем-то неожиданный, подход позволяет создавать огромное количество ``комбинированных'' графиков. Например, поверхность с наложенными линиями уровня строится двумя последовательными вызовами функций рисования поверхности и линий уровня (в любом порядке). И совершенно не надо писать специальную функцию (как в Matlab и некоторых других программах) для рисования этого графика. Примеров таких графиков можно привести множество (см. раздел @ref{Hints} и сайт программы @uref{http://mathgl.sf.net/index.html}).
-@end enumerate
-
-Кроме основных концепций я хотел бы остановиться на нескольких, как оказалось, нетривиальных моментах -- способе указания положения графика, осей координат и строковых параметров линий, поверхностей, текста.
-
-@menu
-* Coordinate axes::
-* Line styles::
-* Color scheme::
-* Font styles::
-* Textual formulas::
-@end menu
-
-@include concept_ru.texi
-
-@node Graphics setup @MGL{}, Axis settings @MGL{}, General concepts, MGL interface
-@end ifset
-@ifclear UDAV
-
-@c ##################################################################
-@node Graphics setup @MGL{}, Axis settings @MGL{}, , MGL interface
-@end ifclear
-@section Настройка графика @MGL{}
-
-Команды в этой группе влияют на вид всего рисунка. Соответственно они должны располагаться @emph{перед} вызовом функций непосредственно рисующих графики.
-
-@menu
-* Transparency @MGL{}::
-* Lighting @MGL{}::
-* Fog @MGL{}::
-* Default sizes @MGL{}::
-* Zooming @MGL{}::
-* Cutting @MGL{}::
-* Other settings @MGL{}::
-@end menu
-
-@c ==================================================================
-@node Transparency @MGL{}, Lighting @MGL{}, , Graphics setup @MGL{}
-@subsection Прозрачность @MGL{}
-
-Эти команды настраивают тип и степень прозрачности поверхностей. Главной является функция @ref{alpha}, которая включает/выключает прозрачность для всех графиков, созданных после вызова @ref{alpha}. Функция @ref{alphadef} устанавливает величину alpha-канала по умолчанию. Прозрачность можно выключить для отдельного графика с помощью @ref{transparent}. Наконец, функция @ref{transptype} задает тип прозрачности. @sref{Transparent surface sample}
-
-@cindex alpha
-@anchor{alpha}
-@deffn {Команда MGL} alpha @code{[val=on]}
-Включает/выключает прозрачность для @emph{всего} рисунка. По умолчанию прозрачность выключена. Используйте @code{transparent off} для конкретного графика для выключения прозрачности.
-@end deffn
-@cindex alphadef
-@anchor{alphadef}
-@deffn {Команда MGL} alphadef @code{val}
-Задает значение прозрачности по умолчанию для всех графиков. Начальное значение 0.5.
-@end deffn
-@cindex transparent
-@anchor{transparent}
-@deffn {Команда MGL} transparent @code{val}
-Временно включает/возвращает прозрачность графиков.
-@end deffn
-@cindex transptype
-@anchor{transptype}
-@deffn {Команда MGL} transptype @code{val}
-Задает тип прозрачности. Обычная прозрачность (@samp{0}) -- "закрытые" объекты видны меньше чем закрывающие. "Стеклянная" прозрачность (@samp{1}) -- закрытые и закрывающие объекты единообразно ослабляют интенсивность света (по RGB каналам). "Ламповая" прозрачность (@samp{2}) -- закрытые и закрывающие объекты являются источниками дополнительного освещения (рекомендую установить @code{alphadef 0.3} или меньше в этом случае). @xref{Normal transparency}, @ref{Glass-like transparency}, @ref{Lamp-like transparency}.
-@end deffn
-
-@c ==================================================================
-@node Lighting @MGL{}, Fog @MGL{}, Transparency @MGL{}, Graphics setup @MGL{}
-@subsection Освещение @MGL{}
-
-Эти функции настраивают освещение графика. Главная функция @ref{light} включает/выключает освещение графиков построенных после ее вызова. MathGL поддерживает до 10 независимых источников света. Положение, цвет, яркость каждого источника света можно задавать по отдельности. По умолчанию включен только первый (с порядковым номером @code{0}) источник света белого цвета, расположенный сверху.
-
-@cindex light
-@anchor{light}
-@deffn {Команда MGL} light @code{[val=on]}
-Включает/выключает освещение графика. По умолчанию освещение выключено.
-@end deffn
-@deffn {Команда MGL} light @code{n val}
-Включает/выключает @var{n}-ый источник света.
-@end deffn
-
-@deffn {Команда MGL} light @code{n xpos ypos zpos} ['col'='w' @code{br=0.5}]
-Добавляет источник света с номером @var{n} в положение @{@var{xpos}, @var{ypos}, @var{zpos}@} с цветом @var{col} и яркостью @var{br}, которая должна быть в диапазоне [0,1].
-@end deffn
-
-@cindex ambient
-@anchor{ambient}
-@deffn {Команда MGL} ambient @code{val}
-Задает яркость рассеянного освещения. Значение должно быть в диапазоне [0,1].
-@end deffn
-
-@c ==================================================================
-@node Fog @MGL{}, Default sizes @MGL{}, Lighting @MGL{}, Graphics setup @MGL{}
-@subsection Туман @MGL{}
-
-@cindex fog
-@anchor{fog}
-@deffn {Команда MGL} fog @code{val [dz=0.25]}
-Имитирует туман на графике. Туман начинается на относительном расстоянии @var{dz} от точки обзора и его плотность растет экспоненциально вглубь по закону ~@math{1-exp(-d*z)}. Здесь @emph{z} -- нормализованная на 1 глубина графика. Если @var{d}=@code{0} то туман отсутствует. @sref{Surface in fog sample}
-@end deffn
-
-@c ==================================================================
-@node Default sizes @MGL{}, Zooming @MGL{}, Fog @MGL{}, Graphics setup @MGL{}
-@subsection Базовые размеры @MGL{}
-
-Эти команды задают величины большинства параметров графика, включая размеры маркеров, стрелок, толщину линий и т.д. Как и любые другие настройки, они подействуют только на графики созданные после изменения настроек.
-
-@cindex barwidth
-@anchor{barwidth}
-@deffn {Команда MGL} barwidth @code{val}
-Относительный размер прямоугольников в @code{bars, barh, boxplot}. Значение по умолчанию @code{0.7}.
-@end deffn
-
-@cindex marksize
-@anchor{marksize}
-@deffn {Команда MGL} marksize @code{val}
-Размер маркеров для @ref{1D plotting}. Значение по умолчанию @code{1}.
-@end deffn
-
-@cindex arrowsize
-@anchor{arrowsize}
-@deffn {Команда MGL} arrowsize @code{val}
-Размер стрелок для @ref{1D plotting}, линий и кривых (@pxref{Primitives drawing}). Значение по умолчанию @code{1}.
-@end deffn
-
-@cindex linewidth
-@anchor{linewidth}
-@deffn {Команда MGL} linewidth @code{val}
-Базовая толщина линий. Значения <1 игнорируются. Для значений >1 реальная толщина получается перемножением указанной ширины линии на данное значение. Увеличение ширины линии актуально для больших растровых рисунков. Значение по умолчанию @code{1}.
-@end deffn
-
-@cindex ticklen
-@anchor{ticklen}
-@deffn {Команда MGL} ticklen @code{val} [@code{stt=1}]
-Относительная длина меток осей координат. Значение по умолчанию @code{0.1}. Параметр @var{stt}>0 задает относительную длину подметок, которые в @code{sqrt(1+stt)} раз меньше.
-@end deffn
-
-@cindex tickstl
-@anchor{tickstl}
-@deffn {Команда MGL} tickstl 'stl' ['sub'='']
-Стиль меток (@var{stl}) и подметок (@var{sub}) осей координат. Если @code{stl=''}, то используется стиль по умолчанию (@samp{k} или @samp{w} в зависимости от типа прозрачности). Если @code{sub=''}, то используется стиль меток (т.е. @var{stl}).
-@end deffn
-
-@c ==================================================================
-@node Zooming @MGL{}, Cutting @MGL{}, Default sizes @MGL{}, Graphics setup @MGL{}
-@subsection Масштабирование @MGL{}
-
-Эти команды управляют масштабированием всего рисунка (@ref{zoom}) или отдельной картинки (@ref{plotfactor}). Обычно эти функции используются для удаления пустого места вокруг графиков.
-
-@cindex plotfactor
-@anchor{plotfactor}
-@deffn {Команда MGL} plotfactor @code{val}
-Масштаб картинки (значение должно быть больше 1). Не рекомендуется устанавливать значения меньше 1.5. Это аналог @ref{zoom}, но применяется только к конкретной картинке, заданной @ref{inplot}. Используйте ноль для включения автоматического масштабирования.
-@end deffn
-
-@cindex zoom
-@anchor{zoom}
-@deffn {Команда MGL} zoom @code{x1 y1 x2 y2}
-Масштабирует весь рисунок. После вызова функции текущий график будет очищен и в дальнейшем рисунок будет содержать только область [x1,x2]*[y1,y2] от исходного рисунка. Координаты @var{x1}, @var{x2}, @var{y1}, @var{y2} меняются в диапазоне от 0 до 1. Внимание! эти настройки не могут быть переписаны никакими другими функциями. Используйте @code{zoom 0 0 1 1} для перехода в масштаб по умолчанию.
-@end deffn
-
-@c ==================================================================
-@node Cutting @MGL{}, Other settings @MGL{}, Zooming @MGL{}, Graphics setup @MGL{}
-@subsection Обрезание @MGL{}
-
-Эти команды задают условия когда точка будет исключена (вырезана) из рисования. Замечу, что все точки со значением(-ями) @code{nan} по одной из координат или амплитуде автоматически исключаются из рисования.
-
-@cindex cut
-@anchor{cut}
-@deffn {Команда MGL} cut @code{val}
-Задает обрезание точек за пределами осей координат. Если @code{on} то такие точки исключаются из рисования (это по умолчанию) иначе они проецируются на ограничивающий прямоугольник.
-@end deffn
-
-@deffn {Команда MGL} cut @code{x1 y1 z1 x2 y2 z2}
-Задает границы параллелепипеда внутри которого точки не рисуются. Если границы одинаковы (переменные равны), то параллелепипеда считается пустым. @sref{CutMinMax sample}
-@end deffn
-
-@deffn {Команда MGL} cut 'cond'
-Задает условие обрезания по формуле @var{cond}. Это условие исключает точки из рисования если результат вычисления формулы не равен нулю. Установите аргумент @code{''} для выключения условия обрезания. @sref{CutOff sample}
-@end deffn
-
-@c ==================================================================
-@node Other settings @MGL{}, , Cutting @MGL{}, Graphics setup @MGL{}
-@subsection Прочие настройки @MGL{}
-
-@cindex font
-@anchor{font}
-@deffn {Команда MGL} font 'fnt' [@code{val=6}]
-Задает стиль и размер шрифта (@pxref{Text printing}). Вначале используется @samp{rC} -- прямой шрифт с выравниванием по центру. По умолчанию размер подписей оси координат в 1.4 раза больше.
-@end deffn
-
-@cindex rotatetext
-@anchor{rotatetext}
-@deffn {Команда MGL} rotatetext @code{val}
-Включает/выключает вращение меток и подписей осей координат вдоль оси. Начальное значение @code{on}.
-@end deffn
-
-@cindex palette
-@anchor{palette}
-@deffn {Команда MGL} palette 'colors'
-Задает палитру как последовательность цветов. Значение по умолчанию @code{"Hbgrcmyhlnqeup"}, что соответствует цветам: темно серый @samp{H}, синий @samp{b}, зеленый @samp{g}, красный @samp{r}, голубой @samp{c}, малиновый @samp{m}, желтый @samp{y}, серый @samp{h}, сине-зеленый @samp{l}, небесно-голубой @samp{n}, оранжевый @samp{q}, желто-зеленый @samp{e}, сине-фиолетовый @samp{u}, фиолетовый @samp{p}. Палитра в основном используется в 1D графиках (@pxref{1D plotting}) для кривых с неопределенным стилем линии.
-@end deffn
-
-@cindex meshnum
-@anchor{meshnum}
-@deffn {Команда MGL} meshnum @code{num}
-Задает ориентировочное число линий в @ref{mesh}, @ref{fall}, @ref{grid}, число стрелок (штрихов) в @ref{vect}, @ref{dew} и число ячеек в @ref{cloud}. По умолчанию (=0) рисуются все линии, стрелки, ячейки.
-@end deffn
-
-@cindex axialdir
-@anchor{axialdir}
-@deffn {Команда MGL} axialdir 'dir'
-Задает ось вращения для @ref{axial}, @ref{torus}. По умолчанию это 'z'.
-@end deffn
-
-@c ==================================================================
-@node Axis settings @MGL{}, Transformation matrix @MGL{}, Graphics setup @MGL{}, MGL interface
-@section Параметры осей координат @MGL{}
-
-Этот большой набор команд определяет вид осей и меток координат. Перед построением для каждой точки выполняются 3 преобразования: сначала определяется возможность рисования точки (@pxref{Cutting @MGL{}}), далее применяются формулы перехода к криволинейным координатам и наконец точка отображается.
-
-@cindex axis
-@anchor{axis}
-@deffn {Команда MGL} axis @code{x1 y1 x2 y2}
-@deffnx {Команда MGL} axis @code{x1 y1 z1 x2 y2 z2}
-@cindex ranges
-@anchor{ranges}
-@deffnx {Команда MGL} ranges @code{x1 x2 y1 y2 [z1=0 z2=0]}
-Задает диапазон изменения координат. Если минимальное и максимальное значение координаты равны, то они игнорируются по данному направлению. Также устанавливает размер цветовой шкалы, аналогично команде @code{caxis z1 z2}. Начальные диапазоны равны [-1, 1].
-@end deffn
-
-@deffn {Команда MGL} axis 'fx' 'fy' ['fz'='' 'fa'='']
-Задает формулы перехода к криволинейным координатам. Каждая строка является математическим выражением, зависящим от старых координат @samp{x}, @samp{y}, @samp{z} и @samp{a} или @samp{c} для цветовой шкалы. Например, для цилиндрических координат будет @code{axis 'x*cos(y)' 'x*sin(y)' 'z'}. Для удаления формул соответствующий параметр должен быть пустым @code{''}. Использование формул преобразования слегка замедляет программу, т.е.. @code{axis '' '' ''} быстрее чем @code{axis '1*x' '1*y' '1*z'}. Параметр @var{fa} задает аналогичную формулу для цветовой шкалы. @xref{Textual formulas}.
-@end deffn
-
-@deffn {Команда MGL} axis @code{how}
-Устанавливает одну из предопределенных систем криволинейных координат в зависимости от параметра @var{how}: @samp{0} -- декартова система (нет преобразования координат, наиболее быстрая); @samp{1} -- полярные координаты @math{x_n=x*cos(y),y_n=x*sin(y), z_n=z}; @samp{2} -- сферические координаты @math{x_n=x*sin(y)*cos(z), y_n=x*sin(y)*sin(z), z_n=x*cos(y)}; @samp{3} -- параболические координаты @math{x_n=x*y, y_n=(x*x-y*y)/2, z_n=z}; @samp{4} -- Paraboloidal coordinates @math{x_n=(x*x-y*y)*cos(z)/2, y_n=(x*x-y*y)*sin(z)/2, z_n=x*y}; @samp{5} -- Oblate coordinates @math{x_n=cosh(x)*cos(y)*cos(z), y_n=cosh(x)*cos(y)*sin(z), z_n=sinh(x)*sin(y)}; @samp{6} -- Prolate coordinates @math{x_n=sinh(x)*sin(y)*cos(z), y_n=sinh(x)*sin(y)*sin(z), z_n=cosh(x)*cos(y)}; @samp{7} -- эллиптические координаты @math{x_n=cosh(x)*cos(y), y_n=sinh(x)*sin(y), z_n=z}; @samp{8} -- тороидальные координаты @math{x_n=sinh(x)*cos(z)/(cosh(x)-cos(y)), y_n=sinh(x)*sin(z)/(cosh(x)-cos(y)), z_n=sin(y)/(cosh(x)-cos(y))}; @samp{9} -- бисферические координаты @math{x_n=sin(y)*cos(z)/(cosh(x)-cos(y)), y_n=sin(y)*sin(z)/(cosh(x)-cos(y)), z_n=sinh(x)/(cosh(x)-cos(y))}; @samp{10} -- биполярные координаты @math{x_n=sinh(x)/(cosh(x)-cos(y)), y_n=sin(y)/(cosh(x)-cos(y)), z_n=z}.
-@end deffn
-
-@cindex caxis
-@anchor{caxis}
-@deffn {Команда MGL} caxis @code{z1 z2}
-Задает масштаб цветовой шкалы (c-координаты). Эти значения используются для определения цвета поверхностей и прочих 2D и 3D графиков. Начальный диапазон равен [-1, 1].
-@end deffn
-
-@cindex origin
-@anchor{origin}
-@deffn {Команда MGL} origin @code{x0 y0 [z0=nan]}
-Задает центр пересечения осей координат. Если одно из значений равно @code{nan}, то выбрается оптимальное положение осей координат по этому направлению.
-@end deffn
-
-@cindex ternary
-@anchor{ternary}
-@deffn {Команда MGL} ternary @code{val}
-Задает рисование треугольных (Ternary) осей координат. Это специальный тип графика для 3 зависимых координат (компонент) @var{a}, @var{b}, @var{c} таких, что @var{a}+@var{b}+@var{c}=1. MathGL использует только 2 независимые координаты @var{a}=x и @var{b}=y поскольку их достаточно для построения всех графиков. При этом третья координата z является независимым параметром для построения линий уровня, поверхностей и т.д. @sref{Ternary plot sample}
-@end deffn
-
-@cindex xrange
-@anchor{xrange}
-@deffn {Команда MGL} xrange dat [@code{add=off fact=0}]
-@cindex yrange
-@anchor{yrange}
-@deffnx {Команда MGL} yrange dat [@code{add=off fact=0}]
-@cindex zrange
-@anchor{zrange}
-@deffnx {Команда MGL} zrange dat [@code{add=off fact=0}]
-@cindex crange
-@anchor{crange}
-@deffnx {Команда MGL} crange dat [@code{add=off fact=0}]
-Задает диапазон изменения x-,y-,z-,c- координат как минимальное и максимальное значение массива @var{dat}. Параметр @var{add} указывает добавлять новый диапазон к существующему или заменять его. Параметр @var{fact} дополнительно расширяет диапазон на величину (@var{Max}-@var{Min})*@var{fact}.
-@end deffn
-
-@deffn {Команда MGL} xrange @code{x1 x2}
-@deffnx {Команда MGL} yrange @code{x1 x2}
-@deffnx {Команда MGL} zrange @code{x1 x2}
-@deffnx {Команда MGL} crange @code{x1 x2}
-Задает диапазон изменения x-,y-,z-,c- координат. См. также @ref{axis}.
-@end deffn
-
-@cindex xtick
-@anchor{xtick}
-@deffn {Команда MGL} xtick @code{val [sub=0 org=nan]}
-@cindex ytick
-@anchor{ytick}
-@deffnx {Команда MGL} ytick @code{val [sub=0 org=nan]}
-@cindex ztick
-@anchor{ztick}
-@deffnx {Команда MGL} ztick @code{val [sub=0 org=nan]}
-@cindex ctick
-@anchor{ctick}
-@deffnx {Команда MGL} ctick @code{val}
-Задает шаг меток осей @var{val}, число подметок @var{ns} и начальное положение меток @var{org}. Переменная @var{val} задает шаг меток (если положительна) или их число на оси (если отрицательна). Нулевое значение задает логарифмические метки. Если @var{org}=@code{NAN}, то используется значение из @ref{origin}.
-@end deffn
-
-@deffn {Команда MGL} xtick 'templ'
-@deffnx {Команда MGL} ytick 'templ'
-@deffnx {Команда MGL} ztick 'templ'
-@deffnx {Команда MGL} ctick 'templ'
-Задает шаблоны для меток вдоль x-,y-,z-оси или colorbar. Шаблон может содержать и символы TeX. Если @var{xtt}, @var{ytt}, @var{ztt}, @var{ctt}=@code{''}, то используется шаблон по умолчанию (в простейшем случае @samp{%.2g}). Установка шаблона выключает автоматическое улучшение вида меток.
-@end deffn
-
-@deffn {Команда MGL} xtick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...]
-@deffnx {Команда MGL} ytick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...]
-@deffnx {Команда MGL} ztick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...]
-Задает явное положение @var{val} и подписи @var{lbl} для меток вдоль оси. Метки могут содержать и символы TeX.
-@end deffn
-
-@cindex adjust
-@anchor{adjust}
-@deffn {Команда MGL} adjust ['dir'='xyzc']
-Автоматически задает шаг меток осей, число подметок и начальное положение меток для осей координат @var{dir} в виде наиболее удобном для человека.
-@end deffn
-
-
-@c ##################################################################
-@node Transformation matrix @MGL{}, Export to file @MGL{}, Axis settings @MGL{}, MGL interface
-@section Матрица преобразования @MGL{}
-
-Эти команды контролируют где и как график будет расположен. Существует определенный порядок вызова этих функций для лучшего вида графика. Вначале должны вызываться команды @ref{subplot} или @ref{inplot} для указания местоположения вывода. После них -- команды вращения @ref{rotate} и сжатия @ref{aspect}. И наконец любые другие функции для рисования графика. Вместо вращения графика можно вызвать команды @ref{columnplot} для расположения графиков в столбец одного над другим или @ref{stickplot} для расположения в линейку.
-
-@cindex subplot
-@anchor{subplot}
-@deffn {Команда MGL} subplot @code{nx ny m [dx=0 dy=0]}
-Помещает последующий вывод в @var{m}-ую ячейку сетки размером @var{nx}*@var{ny} от всего рисунка. Функция сбрасывает матрицу трансформации (повороты и сжатие графика) и должна вызываться первой для создания "подграфика". С эстетической точки зрения не рекомендуется вызывать эту функцию с различными (или не кратными) размерами сетки. Ячейка может быть дополнительно сдвинута относительно своего обычного положения на относительный размер @var{dx}, @var{dy}.
-@end deffn
-
-@deffn {Команда MGL} subplot @code{nx ny m} 'style'
-Аналогично предыдущему, но место для осей/colorbar резервируется только если строка @var{style} содержит: @samp{L} или @samp{<} -- с левого края, @samp{R} или @samp{>} -- с правого края, @samp{A} или @samp{^} -- с верхнего края, @samp{U} или @samp{_} -- с нижнего края.
-@end deffn
-
-@cindex inplot
-@anchor{inplot}
-@deffn {Команда MGL} inplot @code{x1 x2 y1 y2 [rel=off]}
-Помещает последующий вывод в прямоугольную область [@var{x1}, @var{x2}]*[@var{y1}, @var{y2}] (исходный размер [0,1]*[0,1]). Эта функция позволяет поместить график в произвольную область рисунка. Если параметр @var{rel}=@code{on}, то используется позиция относительно текщего @ref{subplot} (или @ref{inplot} с @var{rel}=@code{off}). Функция сбрасывает матрицу трансформации (повороты и сжатие графика) и должна вызываться первой для создания "подграфика".
-@end deffn
-
-@cindex columnplot
-@anchor{columnplot}
-@deffn {Команда MGL} columnplot @code{num ind [d=0]}
-Помещает последующий вывод в @var{ind}-ую строку столбца из @var{num} строк. Положение столбца выбирается относительно последнего вызова @ref{subplot} (или @ref{inplot} с @var{rel}=@code{off}). Параметр @var{d} задает дополнительный зазор между строк. @sref{ColumnPlot sample}
-@end deffn
-
-@cindex stickplot
-@anchor{stickplot}
-@deffn {Команда MGL} stickplot @code{num ind tet phi}
-Помещает последующий вывод в @var{ind}-ую ячейку "бруска" из @var{num} ячеек. При этом сам брусок повернут на углы @var{tet}, @var{phi}. Положение выбирается относительно последнего вызова @ref{subplot} (или @ref{inplot} с @var{rel}=@code{off}). @sref{StickPlot sample}
-@end deffn
-
-@cindex rotate
-@anchor{rotate}
-@deffn {Команда MGL} rotate @code{tetz tetx [tety=0]}
-Вращает систему координат относительно осей @{x, z, y@} последовательно на углы @var{tetx}, @var{tetz}, @var{tety}.
-@end deffn
-
-@deffn {Команда MGL} rotate @code{tet x y z}
-Вращает систему координат относительно вектора @{@var{x}, @var{y}, @var{z}@} на угол @var{tet}.
-@end deffn
-
-@cindex aspect
-@anchor{aspect}
-@deffn {Команда MGL} aspect @code{ax ay [az=1]}
-Устанавливает соотношение размеров осей в отношении @var{ax:ay:az}. Для лучшего вида следует вызывать после функции @ref{rotate}.
-@end deffn
-
-@cindex perspective
-@anchor{perspective}
-@deffn {Команда MGL} perspective @code{val}
-Добавляет (включает) перспективу для графика. Параметр @math{val ~ 1/z_@{eff@} \in [0,1)}. По умолчанию (@code{val=0}) перспектива отключена.
-@end deffn
-
-@c ##################################################################
-@node Export to file @MGL{}, Primitives drawing @MGL{}, Transformation matrix @MGL{}, MGL interface
-@section Экспорт в файл @MGL{}
-
-@cindex write
-@anchor{write}
-@deffn {Команда MGL} write 'fname' [@code{solid=off}]
-Экспортирует текущий кадр в файл 'fname' (тип определяется по расширению). Параметр @var{solid} задает вывод картинки на текущем фоне (обычно белом) или полупрозрачной. Если 'fname'='', то используется имя @samp{frame####.jpg}, где @samp{####} -- текущий номер кадра.
-@end deffn
-
-@cindex setsize
-@anchor{setsize}
-@deffn {Команда MGL} setsize @code{w h}
-Изменяет размер картинки в пикселях. Функция должна вызываться @strong{перед} любыми функциями построения потому что полностью очищает содержимое рисунка. В некоторых программах исполнение этой команды может запрещено.
-@end deffn
-
-
-@c ##################################################################
-@node Primitives drawing @MGL{}, Text printing @MGL{}, Export to file @MGL{}, MGL interface
-@section Рисование примитивов
-
-Эти команды рисуют рисуют простые объекты типа линий, точек, сфер, капель, конусов, и т.д.
-
-@cindex clf
-@anchor{clf}
-@deffn {Команда MGL} clf
-Очищает рисунок и заполняет его цветом по умолчанию (обычно белым).
-@end deffn
-
-@cindex ball
-@anchor{ball}
-@deffn {Команда MGL} ball @code{x y} ['col'='r']
-@deffnx {Команда MGL} ball @code{x y z} ['col'='r']
-Рисует точку (шарик) с координатами @{@var{x}, @var{y}, @var{z}@} и цветом @var{col}.
-@end deffn
-
-@cindex line
-@anchor{line}
-@deffn {Команда MGL} line @code{x1 y1 x2 y2} ['stl'='']
-@deffnx {Команда MGL} line @code{x1 y1 z1 x2 y2 z2} ['stl'='']
-Рисует геодезическую линию (декартовых координатах -- прямую) из точки @{@var{x1},@var{y1},@var{z1}@} в @{@var{x2},@var{y2},@var{z2}@} использую стиль линии @var{stl}. Кривая рисуется даже если часть ее лежит вне диапазона осей координат.
-@end deffn
-
-@cindex curve
-@anchor{curve}
-@deffn {Команда MGL} curve @code{x1 y1 dx1 dy1 x2 y2 dx2 dy2} ['stl'='']
-@deffnx {Команда MGL} curve @code{x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2} ['stl'='']
-Рисует кривую Безье из точки @{@var{x1},@var{y1},@var{z1}@} в @{@var{x2},@var{y2},@var{z2}@} использую стиль линии @var{stl}. Касательные в точках пропорциональны @{@var{dx1},@var{dy1},@var{dz1}@}, @{@var{dx2},@var{dy2},@var{dz2}@}. Кривая рисуется даже если часть ее лежит вне диапазона осей координат.
-@end deffn
-
-@cindex facex
-@anchor{facex}
-@deffn {Команда MGL} facex @code{x0 y0 z0 wy wz} ['stl'='' @code{d1=0 d2=0}]
-@cindex facey
-@anchor{facey}
-@deffnx {Команда MGL} facey @code{x0 y0 z0 wx wz} ['stl'='' @code{d1=0 d2=0}]
-@cindex facez
-@anchor{facez}
-@deffnx {Команда MGL} facez @code{x0 y0 z0 wx wy} ['stl'='' @code{d1=0 d2=0}]
-Рисует закрашенный прямоугольник (грань) перпендикулярно оси [x,y,z] в точке @{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl} и шириной @var{wx}, @var{wy}, @var{wz} вдоль соответствующего направления. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета (полезно для градиента цвета, например @samp{wwrr}). Параметры @var{d1}!=0, @var{d2}!=0 задают дополнительный сдвиг последней точки (т.е. рисуют четырехугольник). Грань будет нарисована даже если часть ее лежит вне диапазона осей координат.
-@end deffn
-
-@cindex sphere
-@anchor{sphere}
-@deffn {Команда MGL} sphere @code{x0 y0 r} ['col'='r']
-@deffnx {Команда MGL} sphere @code{x0 y0 z0 r} ['col'='r']
-Рисует сферу радиуса @var{r} с центром в точке @{@var{x}, @var{y}, @var{z}@} цветом @var{stl}.
-@end deffn
-
-@cindex drop
-@anchor{drop}
-@deffn {Команда MGL} drop @code{x0 y0 dx dy r} ['col'='b' @code{sh=1 asp=1}]
-@deffnx {Команда MGL} drop @code{x0 y0 z0 dx dy dz r} ['col'='b' @code{sh=1 asp=1}]
-Рисует каплю радиуса @var{r} в точке @{@var{x0},@var{y0},@var{z0}@} вытянутую вдоль направления @{@var{dx},@var{dy},@var{dz}@} цветом @var{col}. Параметр @var{sh} определяет степень вытянутости: @samp{0} -- сфера, @samp{1} -- классическая капля. Параметр @var{asp} определяет относительную ширину капли (аналог "эллиптичности" для сферы). @sref{Drops sample}
-@end deffn
-
-@cindex cone
-@anchor{cone}
-@deffn {Команда MGL} cone @code{x1 y1 z1 x2 y2 z2 r1} [@code{r2=-1} 'stl'='' @code{edge=off}]
-Рисует трубу (или усеченный конус если @var{edge}=@code{off}) между точками @{@var{x1},@var{y1},@var{z1}@}, @{@var{x2},@var{y2},@var{z2}@} с радиусами на концах @var{r1}, @var{r2}. Если @var{r2}<0, то полагается @var{r2}=@var{r1}. Цвет конуса задается строкой @var{stl}.
-@end deffn
-
-@cindex rect
-@anchor{rect}
-@deffn {Команда MGL} rect @code{x1 y1 x2 y2} ['st'='']
-@deffnx {Команда MGL} rect @code{x1 y1 z1 x2 y2 z2} ['st'='']
-Рисует закрашенный прямоугольник (грань) с противоположными вершинами в точках @{@var{x1},@var{y1},@var{z1}@}, @{@var{x2},@var{y2},@var{z2}@} цветом @var{stl}. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета (полезно для градиента цвета, например @samp{wwrr}). Грань будет нарисована даже если часть ее лежит вне диапазона осей координат.
-@end deffn
-
-@c ##################################################################
-@node Text printing @MGL{}, Axis and Colorbar @MGL{}, Primitives drawing @MGL{}, MGL interface
-@section Вывод текста @MGL{}
-
-Команды для вывода текста позволяют вывести строку текста в произвольном месте рисунка, в произвольном направлении и вдоль произвольной кривой. Можно использовать произвольное начертание шрифта и многие ТеХ-ие команды (детальнее @pxref{Font styles}). Аргумент @var{size} определяет размер текста: размер шрифта если положителен или относительный размер (=-@var{size}*@var{fontsize}) если отрицателен.
-
-Параметры шрифта задаются строкой, которая может содержать символы стиля (@samp{rbiwou}) и/или выравнивания (@samp{LRC}). Также строка может содержать символы цвета @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}) после символа @samp{:}. Стили шрифта: @samp{r} -- прямой, @samp{i} -- курсив, @samp{b} -- жирный, @samp{w} -- контурный, @samp{o} -- надчеркнутый, @samp{u} -- подчеркнутый. По умолчанию используется прямой шрифт. Типы выравнивания: @samp{L} -- по левому краю (по умолчанию), @samp{C} -- по центру, @samp{R} -- по правому краю. Например, строка @samp{iC:b} соответствует курсиву синего цвета с выравниванием по центру. По умолчанию используются параметры, определенные командой @ref{font}.
-
-Если строка содержит символы @samp{aA}, то текст выводится в абсолютных координатах (полагаются в диапазоне [0,1]). При этом используются координаты относительно рисунка (если указано @samp{A}) или относительно последнего @ref{subplot}/@ref{inplot} (если указано @samp{a}).
-
-@cindex text
-@anchor{text}
-@deffn {Команда MGL} text @code{x y} 'text' ['fnt'='' @code{size=-1.4}]
-@deffnx {Команда MGL} text @code{x y z} 'text' ['fnt'='' @code{size=-1.4}]
-Выводит строку @var{text} от точки @{@var{x},@var{y},@var{z}@} шрифтом @var{fnt} и размером @var{size}.
-@end deffn
-
-@deffn {Команда MGL} text @code{x y dx dy} 'text' [@code{size=-1.4}]
-@deffnx {Команда MGL} text @code{x y z dx dy dz} 'text' [@code{size=-1.4}]
-Выводит строку @var{text} от точки @{@var{x},@var{y},@var{z}@} вдоль направления @{@var{dx},@var{dy},@var{dz}@} шрифтом @var{fnt} и размером @var{size}.
-@end deffn
-
-@deffn {Команда MGL} text ydat 'text' ['fnt'='' @code{size=-1 zval=nan}]
-@deffnx {Команда MGL} text xdat ydat 'text' ['fnt'='' @code{size=-1 zval=nan}]
-@deffnx {Команда MGL} text xdat ydat zdat 'text' ['fnt'='' @code{size=-1}]
-Выводит строку @var{text} вдоль кривой @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} шрифтом @var{font}. Строка @var{font} может содержать символы: @samp{t} для вывода текста под кривой (по умолчанию), или @samp{T} для вывода текста над кривой. Если массив @var{xdat} не указан, то используется массив со значениями равно распределенными вдоль оси x. Если массив @var{zdat} не указан, то используется @var{zdat}[i] = @var{zval}. @sref{Text sample}
-@end deffn
-
-@cindex title
-@anchor{title}
-@deffn {Команда MGL} title 'text' ['fnt'='' @code{size=-2}]
-Выводит строку @var{text} как заголовок (сверху рисунка). Может использоваться в любом месте (даже внутри @ref{subplot}).
-@end deffn
-
-@cindex fgets
-@anchor{fgets}
-@deffn {Команда MGL} fgets @code{x y} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}]
-@deffnx {Команда MGL} fgets @code{x y z} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}]
-Выводит @var{n}-ую строку файла @var{fname} от точки @{@var{x},@var{y},@var{z}@} шрифтом @var{fnt} и размером @var{size}.
-@end deffn
-
-
-@c ##################################################################
-@node Axis and Colorbar @MGL{}, Legend @MGL{}, Text printing @MGL{}, MGL interface
-@section Оси и Colorbar @MGL{}
-
-Эти команды рисуют объекты для "измерения" типа осей координат, цветовой таблицы (colorbar), сетку по осям, обрамляющий параллелепипед и подписи по осям координат. См. также @ref{Axis settings @MGL{}}.
-
-@cindex axis
-@c @anchor{}
-@deffn {Команда MGL} axis ['dir'='xyz' @code{adjust=off}]
-Рисует оси координат и метки на них (@pxref{Axis settings @MGL{}}) в направлениях, указанных строкой @var{dir}. Если строка содержит символ @samp{_}, то подписи меток отображаться не будут. Шрифт подписей определяется командой @ref{font}. Метки будут "подогнаны" если @var{adjust}=@code{on} (с помощью вызова @code{adjust 'dir'}).
-@end deffn
-
-@cindex colorbar
-@anchor{colorbar}
-@deffn {Команда MGL} colorbar ['sch'='' @code{pos=0}]
-Рисует полосу соответствия цвета и числовых значений (colorbar) для цветовой схемы @var{sch} (используется текущая для @code{sch=''}) с краю от графика. Параметр @var{pos} задает местоположение: @samp{0} - справа (по умолчанию), @samp{1} - слева, @samp{2} - сверху, @samp{3} - снизу. Если строка @var{sch} содержит @samp{<>^_}, то параметр @var{pos} определяется как: @code{pos=0} для @samp{>} (справа), @code{pos=1} для @samp{<} (слева), @code{pos=2} для @samp{^} (сверху), @code{pos=3} для @samp{_} (снизу). Если строка содержит @samp{A}, то используются абсолютные координаты (относительно рисунка). @sref{Dens sample}
-@end deffn
-
-@deffn {Команда MGL} colorbar vdat ['sch'='' @code{pos=0}]
-Аналогично предыдущему, но для цветовой схемы без сглаживания с заданными значениями @var{vdat}. @sref{ContD sample}
-@end deffn
-
-@deffn {Команда MGL} colorbar 'sch' @code{pos x y w h}
-Аналогично первому, но в произвольном месте графика @{@var{x}, @var{y}@} (полагаются в диапазоне [0,1]). Параметры @var{w}, @var{h} задают относительную ширину и высоту colorbar.
-@end deffn
-
-@cindex grid
-@anchor{grid}
-@deffn {Команда MGL} grid ['dir'='xyz' 'pen'='B']
-Рисует линии сетки в направлениях перпендикулярным @var{dir}. Шаг сетки такой же как у меток осей координат. Стиль линий задается параметром @var{pen} (по умолчанию -- сплошная темно синяя линия @samp{B-}).
-@end deffn
-
-@cindex box
-@anchor{box}
-@deffn {Команда MGL} box ['stl'='k' @code{ticks=on}]
-Рисует ограничивающий параллелепипед цветом 'stl'. При @code{ticks=on} рисуются метки в соответствии с текущими настройками осей координат @ref{axis}.
-@end deffn
-
-@cindex xlabel
-@anchor{xlabel}
-@deffn {Команда MGL} xlabel 'text' [@code{pos=0 size=-1.4 shift=0}]
-@cindex ylabel
-@anchor{ylabel}
-@deffnx {Команда MGL} ylabel 'text' [@code{pos=0 size=-1.4 shift=0}]
-@cindex zlabel
-@anchor{zlabel}
-@deffnx {Команда MGL} zlabel 'text' [@code{pos=0 size=-1.4 shift=0}]
-@cindex tlabel
-@anchor{tlabel}
-@deffnx {Команда MGL} tlabel 'text' [@code{pos=0 size=-1.4 shift=0}]
-Выводит подпись @var{text} для x-,y-,z-,t-оси (где @samp{t} -- ``тернарная'' ось @math{t=1-x-y}). Параметр @var{pos} задает положение подписи: при @var{pos}=0 -- по центру оси, при @var{pos}>0 -- около максимальных значений, при @var{pos}<0 -- около минимальных значений. Параметр @var{size} задает размер шрифта (по умолчанию в 1.4 раза больше чем у меток). @xref{Text printing @MGL{}}.
-@end deffn
-
-@c ##################################################################
-@node Legend @MGL{}, 1D plotting @MGL{}, Axis and Colorbar @MGL{}, MGL interface
-@section Легенда @MGL{}
-
-Эти команды обеспечивают рисование легенды графика (полезно для @ref{1D plotting}). Запись в легенде состоит из двух строк: одна для стиля линии и маркеров, другая с текстом описания (с включенным разбором TeX-их команд), накапливаемые во внутренние массивы с помощью команды @ref{addlegend} или опции @ref{legend}. Положение легенды можно задать автоматически или вручную. Параметры @var{font} и @var{size} задают стиль и размер шрифта. Параметр @var{llen} задает относительную ширину примера линии. Ели стиль линии пустой, то соответствующий текст печатается без отступа. Если строка @var{font} содержит символ @samp{A}, то координаты легенды считаются относительно картинки (а не текущего subplot). @sref{Legend sample}
-
-@cindex legend
-@anchor{legend}
-@deffn {Команда MGL} legend [@code{pos=3} 'fnt'='rL' @code{size=-1 llen=0.1}]
-Рисует легенду из накопленных записей шрифтом @var{fnt} размером @var{size}. Параметр @var{pos} задает положение легенды: @samp{0} -- в нижнем левом углу, @samp{1} -- нижнем правом углу, @samp{2} -- верхнем левом углу, @samp{3} -- верхнем правом углу (по умолчанию).
-@end deffn
-
-@deffn {Команда MGL} legend @code{x y} ['fnt'='rL' @code{size=-1 llen=0.1}]
-Рисует легенду из накопленных записей шрифтом @var{font} размером @var{size}. Положение легенды задается параметрами @var{x}, @var{y}, которые полагаются нормированными в диапазоне [0,1].
-@end deffn
-
-@cindex addlegend
-@anchor{addlegend}
-@deffn {Команда MGL} addlegend 'text' 'stl'
-Добавляет описание @var{text} кривой со стилем @var{stl} (@pxref{Line styles}) во внутренний массив записей легенды. Максимальное число записей 100.
-@end deffn
-
-@cindex clearlegend
-@anchor{clearlegend}
-@deffn {Команда MGL} clearlegend
-Очищает внутренний массив записей легенды.
-@end deffn
-
-@cindex legendbox
-@anchor{legendbox}
-@deffn {Команда MGL} legendbox @code{val}
-Включает/выключает рисование прямоугольника вокруг легенды. По умолчанию (=@code{on}) прямоугольник рисуется.
-@end deffn
-
-@cindex legendmarks
-@anchor{legendmarks}
-@deffn {Команда MGL} legendmarks @code{val}
-Задает число маркеров в легенде. По умолчанию используется 1 маркер.
-@end deffn
-
-@c ##################################################################
-@node 1D plotting @MGL{}, 2D plotting @MGL{}, Legend @MGL{}, MGL interface
-@section 1D графики @MGL{}
-
-Эти команды строят графики для одномерных (1D) массивов. Одномерными считаются массивы, зависящие только от одного параметра (индекса) подобно кривой в параметрической форме @{x(i),y(i),z(i)@}, i=1...n. Есть 5 основных типов 1D графиков: линия (@ref{plot}), линия с заполнением (@ref{area}), ступеньки (@ref{step}), прямоугольники (@ref{bars}, @ref{barh}) и вертикальные линии (@ref{stem}). Все эти типы графиков имеют похожий интерфейс. Есть версии для рисования в пространстве и на плоскости. В последнем случае имеется возможность использования только одного массива. Стиль линии и маркеров указывается строковой переменной. Если она равна @code{''}. Кроме того, есть еще несколько типов графиков для одномерных массивов, имеющих другой интерфейс и вид: поверхность вращения кривой (@ref{torus}), диаграмма (@ref{chart}), размер ошибки (@ref{error}), маркеры переменного размера (@ref{mark}), трубками (@ref{tube}) и т.д. @sref{1D plot sample}
-
-График рисуется для каждой строки если один из массивов матрица. Размер по 1-ой координате @strong{должен быть одинаков} для всех массивов @code{xdat.nx=ydat.nx=zdat.nx}. Если массив @var{xdat} не указан, то используется массив со значениями равно распределенными вдоль оси x. Если массив @var{zdat} не указан, то используется @var{zdat}[i] = @var{zval}. Строка @var{stl} задает цвет и стиль линии и маркеров (@pxref{Line styles}). По умолчанию (@code{stl=''}) рисуется сплошная линия с текущим цветом из палитры.
-
-@cindex plot
-@anchor{plot}
-@deffn {Команда MGL} plot ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} plot xdat ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} plot xdat ydat zdat ['stl'='']
-Рисует ломанную линию между точками @{@var{x}[i], @var{y}[i], @var{z}[i]@}. См. также @ref{area}, @ref{step}, @ref{stem}, @ref{tube}, @ref{mark}, @ref{error}, @ref{belt}, @ref{tens}. @sref{Plot sample}
-@end deffn
-
-
-@cindex radar
-@anchor{radar}
-@deffn {Команда MGL} radar adat ['stl'='' @code{r=-1}]
-Рисует radar chart, представляющий собой ломанную с вершинами на радиальных линиях (типа ломанной в полярных координатах). График рисуется для каждой строки если один из массивов матрица. Параметр @var{r} задает дополнительный сдвиг данных (т.е. используется @var{a}+@var{r} вместо @var{a}). Если @code{r<0}, то @code{r=max(0, -min(a)}. Если @var{stl} содержит символ @samp{#}, то также рисуется "сетка" (радиальные линии и круг для @var{r}). См. также @ref{plot}. @sref{Radar sample}
-@end deffn
-
-@cindex tens
-@anchor{tens}
-@deffn {Команда MGL} tens ydat cdat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} tens xdat ydat cdat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} tens xdat ydat zdat cdat ['stl'='']
-Рисует ломанную линию по точкам @{@var{x}[i], @var{y}[i], @var{z}[i]@} с цветом, определяемым массивом @var{c}[i] (типа графика натяжений). См. также @ref{plot}, @ref{mesh}, @ref{fall}. @sref{Tens sample}
-@end deffn
-
-@cindex area
-@anchor{area}
-@deffn {Команда MGL} area ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} area xdat ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} area xdat ydat zdat ['stl'='']
-Рисует ломанную линию по точками @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} и закрашивает ее вниз до плоскости осей координат. Можно использовать градиентное закрашивание если число указанных цветов в @var{stl} равно удвоенному числу кривых для построения. Если строка содержит символ @samp{a}, то линии рисуются одна поверх другой (с суммированием) -- того же эффекта можно достичь вызовом @code{cumsum ydat 'y'} перед построением графика. См. также @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{Area sample}
-@end deffn
-
-@cindex region
-@anchor{region}
-@deffn {Команда MGL} region fdat gdat ['stl'='' @code{inside=off}]
-@deffnx {Команда MGL} region xdat fdat gdat ['stl'='' @code{inside=off}]
-Закрашивает область между 2 кривыми @{@var{xdat}[i], @var{fdat}[i]@} и @{@var{xdat}[i], @var{gdat}[i]@}. При @code{inside=off} закрашивается только область y1<y<y2, в противном случае также будет закращена область y2<y<y1. Можно использовать градиентное закрашивание если число указанных цветов @var{stl} равно удвоенному числу кривых для построения. См. также @ref{area}, @ref{bars}, @ref{stem}. @sref{Region sample}
-@end deffn
-
-@cindex stem
-@anchor{stem}
-@deffn {Команда MGL} stem ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} stem xdat ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} stem xdat ydat zdat ['stl'='']
-Рисует вертикальные линии из точек @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} до плоскости осей координат. См. также @ref{area}, @ref{bars}, @ref{plot}, @ref{mark}. @sref{Stem sample}
-@end deffn
-
-@cindex bars
-@anchor{bars}
-@deffn {Команда MGL} bars ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} bars xdat ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} bars xdat ydat zdat ['stl'='']
-Рисует вертикальные полосы (прямоугольники) из точек @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} до плоскости осей координат. Если строка @var{stl} содержит символ @samp{a}, то линии рисуются одна поверх другой. Если строка содержит символ @samp{f}, то рисуется график типа waterfall для определения кумулятивного эффекта последовательности положительных и отрицательных значений. Можно использовать разные цвета для положительных и отрицательных значений если число указанных цветов равно удвоенному числу кривых для построения. См. также @ref{barh}, @ref{area}, @ref{stem}, @ref{chart}. @sref{Bars sample}
-@end deffn
-
-@cindex barh
-@anchor{barh}
-@deffn {Команда MGL} barh xdat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} barh ydat xdat ['stl'='' @code{zval=nan}]
-Рисует горизонтальные полосы (прямоугольники) из точек @{@var{xdat}[i], @var{ydat}[i]@} до плоскости оси y. Если массив @var{ydat} не указан, то используется массив со значениями равно распределенными вдоль оси y. Если строка @var{stl} содержит символ @samp{a}, то линии рисуются одна поверх другой. Если строка содержит символ @samp{f}, то рисуется график типа waterfall для определения кумулятивного эффекта последовательности положительных и отрицательных значений. Можно использовать разные цвета для положительных и отрицательных значений если число указанных цветов равно удвоенному числу кривых для построения. См. также @ref{bars}. @sref{Barh sample}
-@end deffn
-
-@cindex chart
-@anchor{chart}
-@deffn {Команда MGL} chart adat ['col'='']
-Рисует цветные полосы (пояса) для массива данных @var{adat}. Число полос равно числу строк @var{adat} (равно @var{a.ny}). Цвет полос поочередно меняется из цветов указанных в @var{col} или в палитре (если @code{col=''}). Пробел в цветах соответствует прозрачному "цвету", т.е. соответствующая полоса не рисуется. Ширина полосы пропорциональна значению элемента в @var{adat}. График строится только для массивов не содержащих отрицательных значений. Если строка @var{col} содержит @samp{#}, то рисуется также черная граница полос. График выглядит лучше в 3d (после вращения системы координат) и/или в полярной системе координат (становится Pie chart). @sref{Chart sample}
-@end deffn
-
-@cindex step
-@anchor{step}
-@deffn {Команда MGL} step ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} step xdat ydat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} step xdat ydat zdat ['stl'='']
-Рисует ступеньки для точек массива @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. См. также @ref{plot}, @ref{stem}, @ref{tile}, @ref{boxs}. @sref{Step sample}
-@end deffn
-
-@cindex torus
-@anchor{torus}
-@deffn {Команда MGL} torus zdat ['stl'='']
-@deffnx {Команда MGL} torus rdat zdat ['stl'='']
-Рисует поверхность вращения кривой @{@var{rdat}[i], @var{zdat}[i], @var{zdat}[i]@} относительно оси @ref{axialdir}. Если массив @var{rdat} не указан, то используется массив со значениями равно распределенными вдоль оси x. См. также @ref{plot}, @ref{axial}. @sref{Torus sample}
-@end deffn
-
-@cindex tube
-@anchor{tube}
-@deffn {Команда MGL} tube ydat rdat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} tube ydat @code{rval} ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} tube xdat ydat rdat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} tube xdat ydat @code{rval} ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} tube xdat ydat zdat rdat ['stl'='']
-@deffnx {Команда MGL} tube xdat ydat zdat @code{rval} ['stl'='']
-Рисует трубу радиуса @var{rdat}[i] (or @var{rval}) вдоль кривой между точками @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. См. также @ref{plot}. @sref{Tube sample}
-@end deffn
-
-@cindex mark
-@anchor{mark}
-@deffn {Команда MGL} mark ydat rdat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} mark xdat ydat rdat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} mark xdat ydat zdat rdat ['stl'='']
-Рисует маркеры размером @var{rdat}[i]*@code{marksize} в точках @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Для рисования маркеров одинакового размера можно использовать функцию @code{plot} с невидимой линией (со стилем содержащим @samp{ }). См. также @ref{plot}, @ref{textmark}, @ref{stem}, @ref{error}. @sref{Mark sample}
-@end deffn
-
-@cindex textmark
-@anchor{textmark}
-@deffn {Команда MGL} textmark ydat 'txt' ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} textmark ydat rdat 'txt' ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} textmark xdat ydat rdat 'txt' ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} textmark xdat ydat zdat rdat 'txt' ['stl'='']
-Рисует текст @var{txt} как маркер с размером пропорциональным @var{rdat}[i]*@code{marksize} в точках @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Если массив @var{rdat} не указан, то полагается @var{rdat}[i] = 1. См. также @ref{plot}, @ref{mark}, @ref{stem}. @sref{TextMark sample}
-@end deffn
-
-@cindex error
-@anchor{error}
-@deffn {Команда MGL} error ydat yerr ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} error xdat ydat yerr ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} error xdat ydat xerr yerr ['stl'='' @code{zval=nan}]
-Рисует размер ошибки @{@var{xerr}[i], @var{yerr}[i]@} в точках @{@var{xdat}[i], @var{ydat}[i]@} на плоскости @var{z} = @var{zval}. Такой график полезен для отображения ошибки эксперимента, вычислений и пр. См. также @ref{plot}. @sref{Error sample}
-@end deffn
-
-@cindex boxplot
-@anchor{boxplot}
-@deffn {Команда MGL} boxplot adat ['stl'='' @code{zval=nan}]
-@deffnx {Команда MGL} boxplot xdat adat ['stl'='' @code{zval=nan}]
-Рисует boxplot (называемый также как box-and-whisker diagram или как "ящик с усами") в точках @var{xdat}[i] на плоскости @var{z} = @var{zval}. Это график, компактно изображающий распределение вероятностей @var{adat}[i,j] (минимум, нижний квартиль (Q1), медиана (Q2), верхний квартиль (Q3) и максимум) вдоль второго (j-го) направления. См. также @ref{plot}, @ref{error}, @ref{bars}. @sref{BoxPlot sample}
-@end deffn
-
-@c ##################################################################
-@node 2D plotting @MGL{}, 3D plotting @MGL{}, 1D plotting @MGL{}, MGL interface
-@section 2D графики @MGL{}
-
-Эти команды строят графики для двумерных (2D) массивов. Двумерными считаются массивы, зависящие только от двух параметров (индексов) подобно матрице @math{f(x_i,y_j), i=1...n, j=1...m}. Есть несколько основных типов 2D графиков: сплошная поверхность (@ref{surf}), сетчатая поверхность (@ref{mesh}), поверхность из ящиков (@ref{boxs}), поверхность из плиток (@ref{tile}), водопад (@ref{fall}), ленточки (@ref{belt}), график плотности (@ref{dens}), линии уровня (@ref{cont}), линии уровня с заполнением (@ref{contf}) и результат их вращения (@ref{axial}). В функциях @ref{cont}, @ref{contf} и @ref{axial} значения уровней можно задавать автоматически и вручную. Можно также нарисовать сетку (@ref{grid}) по массиву данных для улучшения вида графика плотности или линий уровня. Каждый тип графика имеет похожий интерфейс. Есть версия для рисования одного массива с автоматическими координатами и версия для параметрически заданной поверхности. @sref{1D plot sample}
-
-Строка @var{sch} задает цветовую схему (@pxref{Color scheme}. Предыдущая цветовая схема используется по умолчанию. Младшие размерности массивов @var{xdat}, @var{ydat}, @var{zdat} должны быть одинаковы @code{xdat.nx=zdat.nx && ydat.nx=zdat.ny} или @code{xdat.nx=ydat.nx=zdat.nx && xdat.ny=ydat.ny=zdat.ny}. Массивы @var{xdat} и @var{ydat} могут быть векторами (не матрицами как @var{zdat}). Если массивы @var{xdat}, @var{ydat} не указаны, то используются массивы со значениями равно распределенными вдоль осей x, y. График строится для каждого z среза данных.
-
-@cindex surf
-@anchor{surf}
-@deffn {Команда MGL} surf zdat ['sch'='']
-@deffnx {Команда MGL} surf xdat ydat zdat ['sch'='']
-Рисует параметрически заданную поверхность @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. Если @var{sch} содержит @samp{#}, то на поверхности рисуется сетка. См. также @ref{mesh}, @ref{dens}, @ref{belt}, @ref{tile}, @ref{boxs}, @ref{surfc}, @ref{surfa}. @sref{Surf sample}
-@end deffn
-
-@cindex mesh
-@anchor{mesh}
-@deffn {Команда MGL} mesh zdat ['sch'='']
-@deffnx {Команда MGL} mesh xdat ydat zdat ['sch'='']
-Рисует сетчатую поверхность, заданную параметрически @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. См. также @ref{surf}, @ref{fall}, @ref{meshnum}, @ref{cont}, @ref{tens}. @sref{Mesh sample}
-@end deffn
-
-@cindex fall
-@anchor{fall}
-@deffn {Команда MGL} fall zdat ['sch'='']
-@deffnx {Команда MGL} fall xdat ydat zdat ['sch'='']
-Рисует водопад для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. График удобен для построения нескольких кривых, сдвинутых вглубь друг относительно друга. Если @var{sch} содержит @samp{x}, то линии рисуются вдоль x-оси (по умолчанию линии рисуются вдоль y-оси). См. также @ref{belt}, @ref{mesh}, @ref{tens}, @ref{meshnum}. @sref{Fall sample}
-@end deffn
-
-@cindex belt
-@anchor{belt}
-@deffn {Команда MGL} belt zdat ['sch'='']
-@deffnx {Команда MGL} belt xdat ydat zdat ['sch'='']
-Рисует ленточки для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. Если @var{sch} содержит @samp{x}, то линии рисуются вдоль x-оси (по умолчанию линии рисуются вдоль y-оси). См. также @ref{fall}, @ref{surf}, @ref{plot}, @ref{meshnum}. @sref{Belt sample}
-@end deffn
-
-@cindex boxs
-@anchor{boxs}
-@deffn {Команда MGL} boxs zdat ['sch'='']
-@deffnx {Команда MGL} boxs xdat ydat zdat ['sch'='']
-Рисует вертикальные ящики для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. См. также @ref{surf}, @ref{dens}, @ref{tile}, @ref{step}. @sref{Boxs sample}
-@end deffn
-
-@cindex tile
-@anchor{tile}
-@deffn {Команда MGL} tile zdat ['sch'='']
-@deffnx {Команда MGL} tile xdat ydat zdat ['sch'='']
-Рисует плитки для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. График может использоваться как 3d обобщение @ref{step}. См. также @ref{surf}, @ref{boxs}, @ref{step}, @ref{tiles}. @sref{Tile sample}
-@end deffn
-
-@cindex dens
-@anchor{dens}
-@deffn {Команда MGL} dens zdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} dens xdat ydat zdat ['sch'='' @code{zval=nan}]
-Рисует график плотности для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} при @var{z} = @var{zVal}. Если @var{sch} содержит @samp{#}, то рисуется сетка. См. также @ref{surf}, @ref{cont}, @ref{contf}, @ref{boxs}, @ref{tile}, @code{dens[xyz]}. @sref{Dens sample}
-@end deffn
-
-@cindex cont
-@anchor{cont}
-@deffn {Команда MGL} cont vdat zdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} cont vdat xdat ydat zdat ['sch'='' @code{zval=nan}]
-Рисует линии уровня для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} при @var{z} = @var{zval} (или при @var{z=vdat}[k] если @code{zval==nan}). Линии уровня рисуются для @var{z}=@var{vdat}[k]. Если @var{sch} содержит @samp{#}, то рисуется сетка. Если @var{sch} содержит @samp{t} или @samp{T}, то значения @var{vdat}[k] будут выведены вдоль контуров над (или под) кривой. См. также @ref{dens}, @ref{contf}, @ref{contd}, @ref{axial}, @code{cont[xyz]}. @sref{Cont sample}
-@end deffn
-
-@deffn {Команда MGL} cont zdat ['sch'='' @code{num=7 zval=nan}]
-@deffnx {Команда MGL} cont xdat ydat zdat ['sch'='' @code{num=7 zval=nan}]
-Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале цветовой шкалы (см., @ref{caxis}).
-@end deffn
-
-@cindex contf
-@anchor{contf}
-@deffn {Команда MGL} contf vdat zdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} contf vdat xdat ydat zdat ['sch'='' @code{zval=nan}]
-Рисует закрашенные линии (контуры) уровня для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} при @var{z} = @var{zval} (или при @var{z=v}[k] если @code{zval=nan}). Линии уровня рисуются для @var{z}=@var{vdat}[k]. Если @var{sch} содержит @samp{#}, то рисуется сетка. См. также @ref{dens}, @ref{cont}, @ref{contd}, @code{contf[xyz]}. @sref{ContF sample}
-@end deffn
-
-@deffn {Команда MGL} contf zdat ['sch'='' @code{num=7 zval=nan}]
-@deffnx {Команда MGL} contf xdat ydat zdat ['sch'='' @code{num=7 zval=nan}]
-Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале цветовой шкалы (см., @ref{caxis}).
-@end deffn
-
-@cindex contd
-@anchor{contd}
-@deffn {Команда MGL} contd vdat zdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} contd vdat xdat ydat zdat ['sch'='' @code{zval=nan}]
-Рисует закрашенные линии (контуры) уровня для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} при @var{z} = @var{zval} (или при @var{z=v}[k] если @code{zval==nan}) цветами заданными явно. Линии уровня рисуются для @var{z}=@var{vdat}[k]. Строка @var{sch} задает цвет контуров: цвет k-го контура определяется символом @code{sch[k%strlen(sch)]}. См. также @ref{dens}, @ref{cont}, @ref{contf}, @code{cont[xyz]}. @sref{ContD sample}
-@end deffn
-
-@deffn {Команда MGL} contd zdat ['sch'='' @code{num=7 zval=nan}]
-@deffnx {Команда MGL} contd xdat ydat zdat ['sch'='' @code{num=7 zval=nan}]
-Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале цветовой шкалы (см., @ref{caxis}).
-@end deffn
-
-@cindex axial
-@anchor{axial}
-@deffn {Команда MGL} axial vdat zdat ['sch'='']
-@deffnx {Команда MGL} axial vdat xdat ydat zdat ['sch'='']
-Рисует поверхность вращения линии уровня для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. Линии уровня рисуются для @var{zdat}[i,j]=@var{vdat}[k]. Если @var{sch} содержит @samp{#}, то рисуется сетчатая поверхность. Если строка содержит символы @samp{x}, @samp{y} или @samp{z}, то ось вращения устанавливается в указанное направление (по умолчанию вдоль оси @ref{axialdir}). См. также @ref{cont}, @ref{contf}, @ref{torus}, @ref{surf3}. @sref{Axial sample}
-@end deffn
-
-@deffn {Команда MGL} axial zdat ['sch'='' @code{num=3}]
-@deffnx {Команда MGL} axial xdat ydat zdat ['sch'='' @code{num=3}]
-Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале цветовой шкалы (см., @ref{caxis}).
-@end deffn
-
-@cindex grad
-@anchor{grad}
-@deffn {Команда MGL} grad pdat ['sch'='' @code{num=5 zval=nan}]
-@deffnx {Команда MGL} grad xdat ydat pdat ['sch'='' @code{num=5 zval=nan}]
-@deffnx {Команда MGL} grad xdat ydat zdat pdat ['sch'='' @code{num=5}]
-Рисует линии градиента скалярного поля @var{pdat} заданного параметрически @{@var{xdat}[i,j], @var{ydat}[i,j]@} или @{@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]@}. Число линий пропорционально @var{num}. Линии рисуются только с границ интервала при @var{num}<0. См. также @ref{dens}, @ref{cont}, @ref{dens3}, @ref{cont3}, @ref{flow}. @sref{Grad sample}
-@end deffn
-
-
-@cindex grid2
-@anchor{grid2}
-@deffn {Команда MGL} grid2 zdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} grid2 xdat ydat zdat ['sch'='' @code{zval=nan}]
-Рисует плоскую сету для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} при @var{z} = @var{zval}. См. также @ref{dens}, @ref{cont}, @ref{contf}.
-@end deffn
-
-
-@c ##################################################################
-@node 3D plotting @MGL{}, Dual plotting @MGL{}, 2D plotting @MGL{}, MGL interface
-@section 3D графики @MGL{}
-
-Эти функции строят графики для трехмерных (3D) массивов. Трехмерными считаются массивы, зависящие от трех параметров (индексов) подобно матрице @math{f(x_i,y_j,z_k), i=1...n, j=1...m, k=1...l}. Есть 5 основных типов 3D графиков: поверхность постоянного уровня (@ref{surf3}), график плотности на срезе (@var{dens3}), линии уровня на срезе (@ref{cont3}), закрашенные контуры уровня на срезе (@ref{contf3}) и график объемной прозрачности типа облака (@ref{cloud}). В функциях @ref{cont3}, @ref{contf3} и @ref{surf3} значения уровней можно задавать автоматически и вручную. Можно также нарисовать на срезе сетку (@ref{grid3}) по массиву данных для улучшения вида графика плотности или линий уровня. Каждый тип графика имеет похожий интерфейс. Есть версия для рисования одного массива с автоматическими координатами и версия для параметрически заданного массива. @sref{3D plot sample}
-
-Строка @var{sch} задает цветовую схему (@pxref{Color scheme}). Предыдущая цветовая схема используется по умолчанию. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). Если массивы @var{xdat}, @var{ydat}, @var{zdat} не указаны, то используются массивы со значениями равно распределенными вдоль осей x, y, z.
-
-
-@cindex surf3
-@anchor{surf3}
-@deffn {Команда MGL} surf3 adat @code{val} ['sch'='']
-@deffnx {Команда MGL} surf3 xdat ydat zdat adat @code{val} ['sch'='']
-Рисует поверхность уровня для 3d массива, заданного параметрически @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) при @var{adat}(x,y,z)=@var{val}. Если @var{sch} содержит @samp{#}, то рисуется сетчатая поверхность. См. также @ref{cloud}, @ref{dens3}, @ref{surf3c}, @ref{surf3a}, @ref{axial}. @sref{Surf3 sample}
-@end deffn
-
-@deffn {Команда MGL} surf3 adat ['sch'='' @code{num=5}]
-@deffnx {Команда MGL} surf3 xdat ydat zdat adat ['sch'='' @code{num=5}]
-Рисует @var{num} поверхностей уровня равномерно распределенных в интервале цветовой шкалы (см. @ref{caxis}).
-@end deffn
-
-@cindex dens3
-@anchor{dens3}
-@deffn {Команда MGL} dens3 adat 'dir' [@code{sval=-1} 'sch'='']
-@deffnx {Команда MGL} dens3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='']
-Рисует график плотности для 3d массива, заданного параметрически @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). График рисуется на срезе @var{sval} в направлении @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@}. Если @var{stl} содержит @samp{#}, то на срезе рисуется сетка. См. также @ref{cont3}, @ref{contf3}, @ref{dens}, @ref{grid3}. @sref{Dens3 sample}
-@end deffn
-
-@cindex densa
-@anchor{densa}
-@deffn {Команда MGL} densa adat ['sch'='']
-@deffnx {Команда MGL} densa xdat ydat zdat adat ['sch'='']
-Рисует графики плотности на всех центральных срезах 3d данных.
-@end deffn
-
-@cindex cont3
-@anchor{cont3}
-@deffn {Команда MGL} cont3 vdat adat 'dir' [@code{sval=-1} 'sch'='']
-@deffnx {Команда MGL} cont3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='']
-Рисует линии уровня для 3d массива, заданного параметрически @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Линии рисуются для значений из массива @var{v} на срезе @var{sval} в направлении @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@}. Если @var{stl} содержит @samp{#}, то на срезе рисуется сетка. Если @var{sch} содержит @samp{t} или @samp{T}, то значения @var{vdat}[k] будут выведены вдоль контуров над (или под) кривой. См. также @ref{dens3}, @ref{contf3}, @ref{cont}, @ref{grid3}. @sref{Cont3 sample}
-@end deffn
-
-@deffn {Команда MGL} cont3 adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}]
-@deffnx {Команда MGL} cont3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}]
-Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале цветовой шкалы (см., @ref{caxis}).
-@end deffn
-
-@cindex conta
-@anchor{conta}
-@deffn {Команда MGL} conta adat ['sch'='' @code{num=7}]
-@deffnx {Команда MGL} conta xdat ydat zdat adat ['sch'='' @code{num=7}]
-Рисует линии уровня на всех центральных срезах 3d данных.
-@end deffn
-
-@cindex contf3
-@anchor{contf3}
-@deffn {Команда MGL} contf3 vdat adat 'dir' [@code{sval=-1} 'sch'='']
-@deffnx {Команда MGL} contf3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='']
-Рисует закрашенные линии (контуры) уровня для 3d массива, заданного параметрически @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Линии рисуются для значений из массива @var{v} на срезе @var{sval} в направлении @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@}. Если @var{stl} содержит @samp{#}, то на срезе рисуется сетка. См. также @ref{dens3}, @ref{cont3}, @ref{contf}, @ref{grid3}. @sref{ContF3 sample}
-@end deffn
-
-@deffn {Команда MGL} contf3 adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}]
-@deffnx {Команда MGL} contf3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}]
-Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале цветовой шкалы (см., @ref{caxis}).
-@end deffn
-
-@cindex contfa
-@anchor{contfa}
-@deffn {Команда MGL} contfa adat ['sch'='' @code{num=7}]
-@deffnx {Команда MGL} contfa xdat ydat zdat adat ['sch'='' @code{num=7}]
-Рисует закрашенные линии (контуры) уровня на всех центральных срезах 3d данных.
-@end deffn
-
-@cindex grid3
-@anchor{grid3}
-@deffn {Команда MGL} grid3 adat 'dir' [@code{sval=-1} 'sch'='']
-@deffnx {Команда MGL} grid3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='']
-Рисует сетку для 3d массива, заданного параметрически @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). График рисуется на срезе @var{sval} в направлении @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@}. См. также @ref{cont3}, @ref{contf3}, @ref{dens3}, @ref{grid2}.
-@end deffn
-
-@cindex grida
-@anchor{grida}
-@deffn {Команда MGL} grida adat ['sch'='']
-@deffnx {Команда MGL} grida xdat ydat zdat adat ['sch'='']
-Рисует сетку на всех центральных срезах 3d данных.
-@end deffn
-
-@cindex cloud
-@anchor{cloud}
-@deffn {Команда MGL} cloud adat ['sch'='']
-@deffnx {Команда MGL} cloud xdat ydat zdat adat ['sch'='']
-Рисует облачный график для 3d массива, заданного параметрически @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). График состоит из кубиков с цветом и прозрачностью пропорциональной значениям @var{adat}. Результат похож на облако -- малые значения прозрачны, а большие нет. Число кубиков зависит от @ref{meshnum}. Параметр @var{alpha} меняет общую прозрачность графика. См. также @ref{surf3}. @sref{Cloud sample}
-@end deffn
-
-@cindex beam
-@anchor{beam}
-@deffn {Команда MGL} beam tr g1 g2 adat @code{rval} ['sch'='' @code{flag=0 num=3}]
-Рисует поверхность уровня для 3d массива @var{adat} при постоянном значении @var{adat}=@var{val}. Это специальный тип графика для @var{adat} заданного в сопровождающей системе координат вдоль кривой @var{tr} с ортами @var{g1}, @var{g2} и с поперечным размером @var{rval}. Переменная @var{flag} -- битовый флаг: @samp{0x1} - рисовать в сопровождающих (не лабораторных) координатах; @samp{0x2} - рисовать проекцию на плоскость @math{\rho-z}; @samp{0x4} - рисовать нормированное в каждом сечении поле. Размеры массивов по 1-му индексу @var{tr}, @var{g1}, @var{g2} должны быть nx>2. Размеры массивов по 2-му индексу @var{tr}, @var{g1}, @var{g2} и размер по 3-му индексу массива @var{adat} должны быть одинаковы. См. также @ref{surf3}.
-@end deffn
-
-
-@c ##################################################################
-@node Dual plotting @MGL{}, Vector fields @MGL{}, 3D plotting @MGL{}, MGL interface
-@section Парные графики @MGL{}
-
-Эти команды строят графики для двух связанных массивов. Есть несколько основных типов 3D графиков: поверхность и поверхность уровня с окраской по второму массиву (@ref{surfc}, @ref{surf3c}), поверхность и поверхность уровня с прозрачностью по второму массиву (@ref{surfa}, @ref{surf3a}), плитки переменного размера (@ref{tiles}), диаграмма точечного отображения (@ref{map}), STFA диаграмма (@ref{stfa}). В командах @ref{surf3a} и @ref{surf3c} значения уровней можно задавать автоматически и вручную. Каждый тип графика имеет похожий интерфейс. Есть версия для рисования одного массива с автоматическими координатами и версия для параметрически заданного массива.
-
-Строка @var{sch} задает цветовую схему (@pxref{Color scheme}). Предыдущая цветовая схема используется по умолчанию. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). Если массивы @var{xdat}, @var{ydat}, @var{zdat} не указаны, то используются массивы со значениями равно распределенными вдоль осей x, y, z.
-
-@cindex surfc
-@anchor{surfc}
-@deffn {Команда MGL} surfc zdat cdat ['sch'='']
-@deffnx {Команда MGL} surfc xdat ydat zdat cdat ['sch'='']
-Рисует параметрически заданную поверхность @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} с цветом, заданным массивом @var{cdat}[i,j]. Если @var{sch} содержит @samp{#}, то на поверхности рисуется сетка. См. также @ref{surf}, @ref{surfa}, @ref{surf3c}. @sref{SurfC sample}
-@end deffn
-
-@cindex surf3c
-@anchor{surf3c}
-@deffn {Команда MGL} surf3c adat cdat @code{val} ['sch'='']
-@deffnx {Команда MGL} surf3c xdat ydat zdat adat cdat @code{val} ['sch'='']
-Рисует поверхность уровня для 3d массива, заданного параметрически @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) при @var{a}(x,y,z)=@var{val}. Аналогично @ref{surf3}, но цвет задается массивом @var{cdat}. Если @var{sch} содержит @samp{#}, то рисуется сетчатая поверхность. См. также @ref{surf3}, @ref{surfc}, @ref{surf3a}. @sref{Surf3C sample}
-@end deffn
-
-@deffn {Команда MGL} surf3c adat cdat ['sch'='' @code{num=5}]
-@deffnx {Команда MGL} surf3c xdat ydat zdat adat cdat ['sch'='' @code{num=5}]
-Рисует @var{num} поверхностей уровня равномерно распределенных в интервале цветовой шкалы (см. @ref{caxis}).
-@end deffn
-
-@cindex surfa
-@anchor{surfa}
-@deffn {Команда MGL} surfa zdat cdat ['sch'='']
-@deffnx {Команда MGL} surfa xdat ydat zdat cdat ['sch'='']
-Рисует параметрически заданную поверхность @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} с прозрачностью, заданным массивом @var{cdat}[i,j]. Если @var{sch} содержит @samp{#}, то на поверхности рисуется сетка. См. также @ref{surf}, @ref{surfc}, @ref{surf3a}. @sref{SurfA sample}
-@end deffn
-
-@cindex surf3a
-@anchor{surf3a}
-@deffn {Команда MGL} surf3a adat cdat @code{val} ['sch'='']
-@deffnx {Команда MGL} surf3a xdat ydat zdat adat cdat @code{val} ['sch'='']
-Рисует поверхность уровня для 3d массива, заданного параметрически @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) при @var{a}(x,y,z)=@var{val}. Аналогично @ref{surf3}, но прозрачность задается массивом @var{cdat}. Если @var{sch} содержит @samp{#}, то рисуется сетчатая поверхность. См. также @ref{surf3}, @ref{surfa}, @ref{surf3c}. @sref{Surf3A sample}
-@end deffn
-
-@deffn {Команда MGL} surf3a adat cdat ['sch'='' @code{num=5}]
-@deffnx {Команда MGL} surf3a xdat ydat zdat adat cdat ['sch'='' @code{num=5}]
-Рисует @var{num} поверхностей уровня равномерно распределенных в интервале цветовой шкалы (см. @ref{caxis}).
-@end deffn
-
-@cindex tiles
-@anchor{tiles}
-@deffn {Команда MGL} tiles zdat rdat ['sch'='']
-@deffnx {Команда MGL} tiles xdat ydat zdat rdat ['sch'='']
-Рисует плитки для параметрически заданной поверхности @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. Аналогично @ref{tile}, но размер плиток задается массивов @var{rdat}. Это создает эффект "прозрачности" при экспорте в файлы EPS. См. также @ref{surfa}, @ref{tile}. @sref{TileS sample}
-@end deffn
-
-@cindex map
-@anchor{map}
-@deffn {Команда MGL} map udat vdat ['sch'='' @code{pnts=on}]
-@deffnx {Команда MGL} map xdat ydat udat vdat ['sch'='' @code{pnts=on}]
-Визуализирует точечное отображение для матриц @{@var{udat}, @var{vdat} @} параметрически зависящих от координат @var{xdat}, @var{ydat}. Исходное положение ячейки задает ее цвет. Высота пропорциональна якобиану Jacobian(udat,vdat). График является аналогом диаграммы Арнольда. Если @code{pnts=off}, то рисуются грани, иначе цветные точки рисуются в узлах матриц (полезно для "запутанного" отображения). @sref{Map sample}
-@end deffn
-
-@cindex stfa
-@anchor{stfa}
-@deffn {Команда MGL} stfa re im @code{dn} ['sch'='' @code{pnts=on}]
-@deffnx {Команда MGL} stfa xdat ydat re im @code{dn} ['sch'='' @code{pnts=on}]
-Рисует спектрограмму комплексного массива @var{re}+i*@code{im} для Фурье размером @var{dn} точек. Параметр @var{dn} -- любое четное число. Например в 1D случае, результатом будет график плотности от массива @math{res[i,j]=|\sum_d^dn exp(I*j*d)*(re[i*dn+d]+I*im[i*dn+d])|/dn} размером @{int(nx/dn), dn, ny@}. Массивы @var{re}, @var{im} параметрически зависят от координат @var{xdat}, @var{ydat}. @sref{STFA sample}
-@end deffn
-
-
-
-
-@c ##################################################################
-@node Vector fields @MGL{}, Other plotting @MGL{}, Dual plotting @MGL{}, MGL interface
-@section Векторные поля @MGL{}
-
-Эти функции рисуют графики для 2D и 3D векторных полей. Есть несколько типов графиков: просто векторное поле (@ref{vect}), вектора вдоль траектории (@ref{traj}), векторное поле каплями (@ref{dew}), нити тока (@ref{flow}), трубки тока (@ref{pipe}). Каждый тип графика имеет похожий интерфейс. Есть версия для рисования одного массива с автоматическими координатами и версия для параметрически заданного массива.
-
-Строка @var{sch} задает цветовую схему (@pxref{Color scheme}). Предыдущая цветовая схема используется по умолчанию. Все размеры массивов @var{ax} и @var{ay} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y} и @var{ax} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{ax}). График строится для каждого z среза @var{ax}, @var{ay} для 2D случаев.
-
-@cindex traj
-@anchor{traj}
-@deffn {Команда MGL} traj xdat ydat udat vdat ['sch'='' @code{zval=nan len=0}]
-@deffnx {Команда MGL} traj xdat ydat zdat udat vdat wdat ['sch'='' @code{len=0}]
-Рисует вектора @{@var{udat}, @var{vdat}, @var{wdat}@} вдоль кривой @{@var{xdat}, @var{ydat}, @var{zdat}@}. Длина векторов пропорциональна @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. Строка @var{pen} задает цвет (@pxref{Line styles}). По умолчанию (@code{pen=''}). Параметр @var{len} задает фактор длины векторов (если не нуль) или выбирать длину пропорционально расстоянию между точками кривой (если @var{len}=0). См. также @ref{vect}. @sref{Traj sample}
-@end deffn
-
-@cindex vect
-@anchor{vect}
-@deffn {Команда MGL} vect udat vdat ['sch'='' @code{zval=nan flag=0}]
-@deffnx {Команда MGL} vect xdat ydat udat vdat ['sch'='' @code{zval=nan flag=0}]
-Рисует векторное поле @{@var{udat}, @var{vdat}@} параметрически зависящее от координат @var{xdat}, @var{ydat} на плоскости при @var{z}=@var{zval}. Длина и цвет векторов пропорциональна @math{\sqrt@{ax^2+ay^2@}}. Число рисуемых векторов зависит от @ref{meshnum}. Параметр @var{flag} побитовый флаг для настройки вид векторов: @code{1} -- двуцветный вектор, @code{2} -- одинаковая длина векторов, @code{4} -- рисует стрелку в точку сетки, @code{8} -- рисует стрелку с серединой в точке сетки, @code{16} -- рисует штрихи вместо стрелок. См. также @ref{flow}, @ref{dew}, @ref{vectc}. @sref{Vect sample}
-@end deffn
-
-@deffn {Команда MGL} vect udat vdat wdat ['sch'='' @code{flag=0}]
-@deffnx {Команда MGL} vect xdat ydat zdat udat vdat wdat ['sch'='' @code{flag=0}]
-Это 3D версия графика. Здесь массивы @var{udat}, @var{vdat}, @var{wdat} должны быть 3d массивами, а длина и цвет пропорциональны @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Vect 3D sample}
-@end deffn
-
-@cindex vectc
-@anchor{vectc}
-@deffn {Команда MGL} vectc udat vdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} vectc xdat ydat udat vdat ['sch'='' @code{zval=nan}]
-Аналогично @ref{vect} c @code{flag=2+16=18}. @sref{VectC sample}
-@end deffn
-
-@deffn {Команда MGL} vectc udat vdat wdat ['sch'='']
-@deffnx {Команда MGL} vectc xdat ydat zdat udat vdat wdat ['sch'='']
-Это 3D версия графика. Здесь массивы @var{udat}, @var{vdat}, @var{wdat} должны быть 3d массивами, а длина и цвет пропорциональны @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{VectC 3D sample}
-@end deffn
-
-@cindex vectl
-@anchor{vectl}
-@deffn {Команда MGL} vectl udat vdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} vectl xdat ydat udat vdat ['sch'='' @code{zval=nan}]
-Аналогично @ref{vect} c @code{flag=1+16=17}. @sref{VectL sample}
-@end deffn
-
-@deffn {Команда MGL} vectl udat vdat wdat ['sch'='']
-@deffnx {Команда MGL} vectl xdat ydat zdat udat vdat wdat ['sch'='']
-Это 3D версия графика. Здесь массивы @var{udat}, @var{vdat}, @var{wdat} должны быть 3d массивами, а длина и цвет пропорциональны @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{VectL 3D sample}
-@end deffn
-
-@cindex dew
-@anchor{dew}
-@deffn {Команда MGL} dew udat vdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} dew xdat ydat udat vdat ['sch'='' @code{zval=nan}]
-Рисует капли для векторного поля @{@var{udat}, @var{vdat}@}, параметрически зависящего от координат @var{xdat}, @var{ydat} при @var{z=zval}. Замечу, что график требует много памяти и процессорного времени для своего создания! Цвет капель пропорционален @math{\sqrt@{ax^2+ay^2@}}. Число капель определяется @ref{meshnum}. См. также @ref{vect}. @sref{Dew sample}
-@end deffn
-
-@cindex flow
-@anchor{flow}
-@deffn {Команда MGL} flow udat vdat ['sch'='' @code{num=5 zval=nan}]
-@deffnx {Команда MGL} flow xdat ydat udat vdat ['sch'='' @code{num=5 zval=nan}]
-Рисует нити тока для векторного поля @{@var{udat}, @var{vdat}@}, параметрически зависящего от координат @var{xdat}, @var{ydat} на плоскости при z = @var{zval}. Число нитей пропорционально @var{num}. При @var{num}>0 нитей могут стартовать и изнутри сетки, в противном случае только с краев. Цвет нитей пропорционален @math{\sqrt@{udat^2+vdat^2@}}. Теплые цвета соответствуют нормальному току (типа стока). Холодные цвета соответствуют обратному току (типа источника). См. также @ref{pipe}, @ref{vect}. @sref{Flow sample}
-@end deffn
-
-@deffn {Команда MGL} flow udat vdat wdat ['sch'='' @code{num=3}]
-@deffnx {Команда MGL} flow xdat ydat zdat udat vdat wdat ['sch'='' @code{num=3}]
-Это 3D версия графика. Здесь массивы @var{udat}, @var{vdat}, @var{wdat} должны быть 3d массивами, а цвет пропорционален @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Flow 3D sample}
-@end deffn
-
-@deffn {Команда MGL} flow @code{x0 y0} udat vdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} flow @code{x0 y0} xdat ydat udat vdat ['sch'='' @code{zval=nan}]
-Рисует нить тока из точки @{@var{x0}, @var{y0}@} для векторного поля @{@var{udat}, @var{vdat}@}, параметрически зависящего от координат @var{xdat}, @var{ydat} на плоскости при z = @var{zval}. Цвет нити пропорционален @math{\sqrt@{udat^2+vdat^2@}}. Теплые цвета соответствуют нормальному току (типа стока). Холодные цвета соответствуют обратному току (типа источника).
-@end deffn
-
-@deffn {Команда MGL} flow @code{x0 y0 z0} udat vdat wdat ['sch'='']
-@deffnx {Команда MGL} flow @code{x0 y0 z0} xdat ydat zdat udat vdat wdat ['sch'='']
-Это 3D версия графика. Здесь массивы @var{udat}, @var{vdat}, @var{wdat} должны быть 3d массивами, а цвет пропорционален @math{\sqrt@{udat^2+vdat^2+wdat^2@}}.
-@end deffn
-
-
-@cindex pipe
-@anchor{pipe}
-@deffn {Команда MGL} pipe udat vdat ['sch'='' @code{r0=0.05 num=5 zval=nan}]
-@deffnx {Команда MGL} pipe xdat ydat udat vdat ['sch'='' @code{r0=0.05 num=5 zval=nan}]
-Рисует трубки тока для векторного поля @{@var{udat}, @var{vdat}@}, параметрически зависящего от координат @var{xdat}, @var{ydat} на плоскости при z = @var{zval}. Число трубок пропорционально @var{num}. При @var{num}>0 нитей могут стартовать и изнутри сетки, в противном случае только с краев. Цвет и радиус трубок пропорционален @math{\sqrt@{udat^2+vdat^2@}}. Теплые цвета соответствуют нормальному току (типа стока). Холодные цвета соответствуют обратному току (типа источника). Параметр @var{r0} задает радиус трубок. При @var{r0}<0 радиус трубок обратно пропорционален их амплитуде. См. также @ref{flow}, @ref{vect}. @sref{Pipe sample}
-@end deffn
-
-@deffn {Команда MGL} pipe udat vdat wdat ['sch'='' @code{r0=0.05 num=3}]
-@deffnx {Команда MGL} pipe xdat ydat zdat udat vdat wdat ['sch'='' @code{r0=0.05 num=3}]
-Это 3D версия графика. Здесь массивы @var{udat}, @var{vdat}, @var{wdat} должны быть 3d массивами, а цвет пропорционален @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Pipe 3D sample}
-@end deffn
-
-
-@c ##################################################################
-@node Other plotting @MGL{}, Nonlinear fitting @MGL{}, Vector fields @MGL{}, MGL interface
-@section Прочие графики @MGL{}
-
-Это команды, не относящиеся к какой-то специальной категории. Сюда входят функции построения графиков по текстовым формулам (@ref{fplot}, @ref{fsurf}), рисования поверхностей из треугольников (@ref{triplot}), произвольных точек в пространстве (@ref{dots}) и реконструкции по ним поверхности (@ref{crust}), графики плотности и линии уровня на плоскостях, перпендикулярных осям x, y или z (dens[xyz], cont[xyz], contf[xyz]). Каждый тип графика имеет похожий интерфейс. Есть версия для рисования одного массива с автоматическими координатами и версия для параметрически заданного массива. Строка @var{sch} задает цветовую схему (@pxref{Color scheme}). Предыдущая цветовая схема используется по умолчанию.
-
-@cindex densx
-@cindex densy
-@cindex densz
-@anchor{densx} @anchor{densy} @anchor{densz}
-@deffn {Команда MGL} densx dat ['sch'='' @code{val=nan}]
-@deffnx {Команда MGL} densy dat ['sch'='' @code{val=nan}]
-@deffnx {Команда MGL} densz dat ['sch'='' @code{val=nan}]
-Рисуют график плотности на x, y или z плоскостях. Если @var{dat} -- 3d массив, то выполняется интерполяция к заданному срезу @var{val}. Функции полезны для создания проекций 3D массивов на оси координат. См. также @code{cont[xyz], contf[xyz]}, @ref{dens}. @sref{Dens projection sample}
-@end deffn
-
-@cindex contx
-@cindex conty
-@cindex contz
-@anchor{contz} @anchor{conty} @anchor{contx}
-@deffn {Команда MGL} contx dat ['sch'='' @code{val=nan num=7}]
-@deffnx {Команда MGL} conty dat ['sch'='' @code{val=nan num=7}]
-@deffnx {Команда MGL} contz dat ['sch'='' @code{val=nan num=7}]
-Рисуют линии уровня на x, y или z плоскостях. Если @var{dat} -- 3d массив, то выполняется интерполяция к заданному срезу @var{val}. Функции полезны для создания проекций 3D массивов на оси координат. См. также @code{dens[xyz], contf[xyz]}, @ref{cont}. @sref{Cont projection sample}
-@end deffn
-
-@cindex contfx
-@cindex contfy
-@cindex contfz
-@anchor{contfz} @anchor{contfy} @anchor{contfx}
-@deffn {Команда MGL} contfx dat ['sch'='' @code{val=nan num=7}]
-@deffnx {Команда MGL} contfy dat ['sch'='' @code{val=nan num=7}]
-@deffnx {Команда MGL} contfz dat ['sch'='' @code{val=nan num=7}]
-Рисуют закрашенные контуры уровня на x, y или z плоскостях. Если @var{dat} -- 3d массив, то выполняется интерполяция к заданному срезу @var{val}. Функции полезны для создания проекций 3D массивов на оси координат. См. также @code{dens[xyz], cont[xyz]}, @ref{contf}.
-@end deffn
-
-@cindex dots
-@anchor{dots}
-@deffn {Команда MGL} dots xdat ydat zdat ['sch'='']
-@deffnx {Команда MGL} dots xdat ydat zdat adat ['sch'='']
-Рисует произвольно расположенные точки @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Если определен массив @var{adat}[i], то он задает прозрачность точек. См. также @ref{crust}, @ref{mark}, @ref{plot}. @sref{Dots sample}
-@end deffn
-
-@cindex crust
-@anchor{crust}
-@deffn {Команда MGL} crust xdat ydat zdat ['sch'='']
-Реконструирует и рисует поверхность по произвольно расположенным точкам @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Если строка содержит @samp{#}, то рисуется сетчатая поверхность. См. также @ref{dots}, @ref{triplot}. @sref{Crust sample}
-@end deffn
-
-@cindex triplot
-@anchor{triplot}
-@deffn {Команда MGL} triplot idat xdat ydat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} triplot idat xdat ydat zdat ['sch'='']
-@deffnx {Команда MGL} triplot idat xdat ydat zdat cdat ['sch'='']
-Рисует поверхность из треугольников. Вершины треугольников задаются индексами @var{idat} в массиве точек @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Если строка содержит @samp{#}, то рисуется сетчатая поверхность. Размер по 1-му индексу массива @var{idat} должен быть 3 или больше. Массивы @var{xdat}, @var{ydat}, @var{zdat} должны иметь одинаковые размеры. Массив @var{cdat} задает цвет треугольников (если @var{idat}.ny=@var{cdat}.nx) или цвет вершин (если @var{xdat}.nx=@var{cdat}.nx). См. также @ref{dots}, @ref{crust}, @ref{quadplot}, @ref{tricont}.
-@end deffn
-
-@cindex tricont
-@anchor{tricont}
-@deffn {Команда MGL} tricont vdat idat xdat ydat zdat cdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} tricont vdat idat xdat ydat zdat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} tricont idat xdat ydat zdat ['sch'='' @code{num=7 zval=nan}]
-Рисует линии уровня поверхности из треугольников при @var{z} = @var{zval} (или для z=@var{vdat}[k] если @code{zval==NAN}). Вершины треугольников задаются индексами @var{idat} в массиве точек @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Размер по 1-му индексу массива @var{idat} должен быть 3 или больше. Массивы @var{xdat}, @var{ydat}, @var{zdat} должны иметь одинаковые размеры. Массив @var{cdat} (если указан) задает цвет треугольников (если @var{idat}.ny=@var{cdat}.nx) или цвет вершин (если @var{xdat}.nx=@var{cdat}.nx). См. также @ref{triplot}, @ref{cont}.
-@end deffn
-
-@cindex quadplot
-@anchor{quadplot}
-@deffn {Команда MGL} quadplot idat xdat ydat ['sch'='' @code{zval=nan}]
-@deffnx {Команда MGL} quadplot idat xdat ydat zdat ['sch'='']
-@deffnx {Команда MGL} quadplot idat xdat ydat zdat cdat ['sch'='']
-Рисует поверхность из четырехугольников. Вершины треугольников задаются индексами @var{idat} в массиве точек @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Если строка содержит @samp{#}, то рисуется сетчатая поверхность. Размер по 1-му индексу массива @var{idat} должен быть 4 или больше. Массивы @var{xdat}, @var{ydat}, @var{zdat} должны иметь одинаковые размеры. Массив @var{cdat} задает цвет четырехугольников (если @var{idat}.ny=@var{cdat}.nx) или цвет вершин (если @var{xdat}.nx=@var{cdat}.nx). См. также @ref{triplot}.
-@end deffn
-
-@cindex fplot
-@anchor{fplot}
-@deffn {Команда MGL} fplot 'y(x)' ['pen'='' @code{zval=nan num=100}]
-Рисует функцию @samp{y(x)} в плоскости z=@var{zval} с координатой @samp{x} в диапазоне x-оси координат. Параметр @var{num} задает минимальное число точек по координате для графика. См. также @ref{plot}.
-@end deffn
-
-@deffn {Команда MGL} fplot 'x(t)' 'y(t)' 'z(t)' ['pen'='' @code{num=100}]
-Рисует параметрическую кривую @{@samp{x(t)}, @samp{y(t)}, @samp{z(t)}@}, где координата @samp{t} меняется в диапазоне [0, 1]. Параметр @var{num} задает минимальное число точек по координате для графика. См. также @ref{plot}.
-@end deffn
-
-@cindex fsurf
-@anchor{fsurf}
-@deffn {Команда MGL} fsurf 'z(x,y)' ['sch'='' @code{num=100}]
-Рисует поверхность @samp{z(x,y)} с координатами @samp{x}, @samp{y} в диапазоне x-,y-осей координат. Параметр @var{num} задает минимальное число точек по координатам для графика. См. также @ref{surf}.
-@end deffn
-
-@deffn {Команда MGL} fsurf 'x(u,v)' 'y(u,v)' 'z(u,v)' ['sch'='' @code{num=100}]
-Рисует параметрическую поверхность @{@samp{x(u,v)}, @samp{y(u,v)}, @samp{z(u,v)}@}, где координаты @samp{u}, @samp{v} меняются в диапазоне [0, 1]. Параметр @var{num} задает минимальное число точек по координатам для графика. См. также @ref{surf}.
-@end deffn
-
-
-@c ##################################################################
-@node Nonlinear fitting @MGL{}, Data create @MGL{}, Other plotting @MGL{}, MGL interface
-@section Nonlinear fitting @MGL{}
-
-Эти команды подбирают параметры функций для наилучшей аппроксимации данных, т.е. минимизируют сумму @math{\sum_i (f(x_i, y_i, z_i) - a_i)^2/s_i^2}. При этом аппроксимирующая функция @samp{f} может зависеть от одного аргумента @samp{x} (1D случай), от двух аргументов @samp{x,y} (2D случай) или от трех аргументов @samp{x,y,z} (3D случай). Функция @samp{f} также может зависеть от параметров. Список параметров задается строкой @var{var} (например, @samp{abcd}). Обычно пользователь должен предоставить начальные значения параметров в переменной @var{ini}. Однако, при его отсутствии используются нулевые значения.
-
-Команды @ref{fit} и @ref{fits} не рисуют полученные массивы. Они заполняют массив @var{fit} по формуле @samp{f} с найденными коэффициентами. При этом, координаты @samp{x,y,z} равно распределены в вдоль осей координат. Число точек в @var{fit} выбирается максимальным из размера массива @var{fit} и 100. Формулу с найденными коэффициентами можно вывести с помощью команды @ref{putsfit}. @sref{Fitting sample}
-
-Размерность массивов должны быть не меньше, чем число указанных массивов @var{xdat}, @var{ydat}, @var{zdat}. Также подбор коэффициентов будет осуществляться только вдоль указанных направлений (например, вдоль x и y если указаны только @var{xdat} и @var{ydat}). Если массив @var{xdat} не указан, то используется массив со значениями равно распределенными вдоль оси x.
-
-@cindex fits
-@anchor{fits}
-@deffn {Команда MGL} fits adat sdat 'func' 'var' [ini=0]
-@deffnx {Команда MGL} fits xdat adat sdat 'func' 'var' [ini=0]
-@deffnx {Команда MGL} fits xdat ydat adat sdat 'func' 'var' [ini=0]
-@deffnx {Команда MGL} fits xdat ydat zdat adat sdat 'func' 'var' [ini=0]
-"Подгоняют" формулу вдоль x-, y- и z-направлений для массива заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) с весовыми коэффициентами @var{sdat}[i,j,k].
-@end deffn
-
-@cindex fit
-@anchor{fit}
-@deffn {Команда MGL} fit adat 'func' 'var' [ini=0]
-@deffnx {Команда MGL} fit xdat adat 'func' 'var' [ini=0]
-@deffnx {Команда MGL} fit xdat ydat adat 'func' 'var' [ini=0]
-@deffnx {Команда MGL} fit xdat ydat zdat adat 'func' 'var' [ini=0]
-"Подгоняют" формулу вдоль x-, y- и z-направлений для массива заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) с весовыми коэффициентами равными 1.
-@end deffn
-
-@cindex putsfit
-@anchor{putsfit}
-@deffn {Команда MGL} putsfit @code{x y} ['pre'='' 'fnt'='' @code{size=-1}]
-Печатает последнюю подобранную формулу с найденными коэффициентами в точке @{@var{x}, @var{y}@}. Строка @var{pre} будет напечатана перед формулой. Все другие параметры такие же как в @ref{Text printing @MGL{}}.
-@end deffn
-
-
-@c ##################################################################
-@node Data create @MGL{}, Data filling @MGL{}, Nonlinear fitting @MGL{}, MGL interface
-@section Создание данных @MGL{}
-
-@cindex new
-@anchor{new}
-@deffn {Команда MGL} new dat [@code{nx=1 ny=1 nz=1}]
-Создает/пересоздает массив с именем @var{dat} данных указанного размера и заполняет его нулями. Ничего не делает при @var{nx}, @var{ny}, @var{nz} отрицательных или равных нулю.
-@end deffn
-
-@cindex var
-@anchor{var}
-@deffn {Команда MGL} var dat @code{num v1 [v2=nan]}
-Создает одномерный массив с именем @var{dat} размером @code{num} и заполняет его равномерно в диапазоне [@var{v1}, @var{v2}]. Если @var{v2}=@code{nan}, то используется @var{v2=v1}.
-@end deffn
-
-@cindex list
-@anchor{list}
-@deffn {Команда MGL} list dat @code{v1 ...}
-Создает массив с именем @var{dat} и заполняет его числовыми значениями аргументов @code{v1 ...}. Команда может создавать 1d- и 2d-массивы. Для создания 2d-массивов требуется указать разделитель строк данных @samp{|}. Размер массива будет [максимальное число чисел в строке * число строк]. Например, команда @code{list 1 | 2 3} создаст массив [1 0; 2 3]. Отмечу, что максимальное число аргументов 1000.
-@end deffn
-
-@deffn {Команда MGL} list dat d1 ...
-Создает массив с именем @var{dat} и заполняет его числами из массивов @code{d1 ...}. Команда может создавать 2d- и 3d-массивы (если аргументы 2d массивы). Младшие размерности всех массивов в аргументах должны быть равны размерности @var{d1}. Отмечу, что максимальное число аргументов 1000.
-@end deffn
-
-@cindex copy
-@anchor{copy}
-@deffn {Команда MGL} copy dat dat2 ['eq'='' @code{on_axis=on}]
-@deffnx {Команда MGL} copy dat @code{val}
-Создает массив с именем @var{dat} и копирует в него данные из массива @var{dat2}. При этом, если указан параметр @var{eq}, то данные будут изменены по формуле аналогично команде @ref{fill} (для @code{on_axis=on}) или @ref{modify} (для @code{on_axis=off}).
-@end deffn
-
-@cindex idset
-@anchor{idset}
-@deffn {Команда MGL} idset dat 'ids'
-Устанавливает символьные обозначения для колонок данных. Строка должна содержать символы 'a'...'z' один на колонку (без пробелов).
-@end deffn
-
-@cindex info
-@anchor{info}
-@deffn {Команда MGL} info dat [@code{detail=off}]
-Выводит информацию о массиве (размер, максимальное/минимальное значение, моменты и пр.). При @code{detail=off} показывается только краткая информация.
-@end deffn
-
-@deffn {Команда MGL} info 'text'
-Выводит текст @var{text} как информацию (предупреждение).
-@end deffn
-
-@c ------------------------------------------------------------------
-@node Data filling @MGL{}, Rearrange data @MGL{}, Data create @MGL{}, MGL interface
-@section Заполнение данных @MGL{}
-@cindex fill
-@cindex modify
-
-@cindex fill
-@anchor{fill}
-@deffn {Команда MGL} fill dat v1 v2 ['dir'='x']
-Заполняет значениями равно распределенными в диапазоне [@var{v1}, @var{v2}] в направлении @var{dir}=@{@samp{x},@samp{y},@samp{z}@}.
-@end deffn
-
-@deffn {Команда MGL} fill dat 'eq' [vdat=0 wdat=0]
-Заполняет значениями вычисленными по формуле @var{eq}. Формула представляет собой произвольное выражение, зависящее от переменных @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Координаты @samp{x}, @samp{y}, @samp{z} полагаются меняющимися в диапазоне осей координат (в отличие от @ref{modify}). Переменная @samp{u} -- значения исходного массива, переменные @samp{v}, @samp{w} -- значения массивов @var{vdat}, @var{wdat}. Последние могут быть опущены.
-@end deffn
-
-@cindex modify
-@anchor{modify}
-@deffn {Команда MGL} modify dat 'eq' [@code{dim=0}]
-@deffnx {Команда MGL} modify dat 'eq' vdat [wdat=0]
-Заполняет значениями вычисленными по формуле @var{eq}. Формула представляет собой произвольное выражение, зависящее от переменных @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Координаты @samp{x}, @samp{y}, @samp{z} полагаются меняющимися в диапазоне [0,1] (в отличие от @ref{fill}). Переменная @samp{u} -- значения исходного массива, переменные @samp{v}, @samp{w} -- значения массивов @var{vdat}, @var{wdat}. Последние могут быть опущены. Если указан @var{dim}>0, то изменяются только слои >=@var{dim}.
-@end deffn
-
-
-@cindex put
-@anchor{put}
-@deffn {MGL command} put dat @code{val [i=: j=: k=:]}
-Присваивает значения (под-)массива @var{dat}[@var{i}, @var{j}, @var{k}] = @var{val}. Индексы @var{i}, @var{j}, @var{k} равные @samp{:} задают значениия @var{val} для всего диапазона соответствующего направления(ий). Например, @code{put dat val : 0 :} задает @var{dat}[i,0,j]=@var{val} для i=0...(@var{dat}.nx-1), j=0...(@var{dat}.nz-1).
-@end deffn
-
-@deffn {MGL command} put dat vdat [@code{i=: j=: k=:}]
-Копирует значения из массива @var{vdat} в диапазон значений массива @var{dat}. Индексы @var{i}, @var{j}, @var{k} равные @samp{:} задают диапазон изменения значений в соответствующих направление(ях). Младшие размерности массива @var{vdat} должны быть больше выбранного диапазона массива @var{dat}. Например, @code{put dat v : 0 :} присвоит @var{dat}[i,0,j]=@var{vdat}.ny>@var{dat}.nz ? @var{vdat}[i,j] : @var{vdat}[i], где i=0...(@var{dat}.nx-1), j=0...(@var{dat}.nz-1) и условие vdat.nx>=dat.nx выполнено.
-@end deffn
-
-
-
-@c ------------------------------------------------------------------
-@node Rearrange data @MGL{}, File I/O @MGL{}, Data filling @MGL{}, MGL interface
-@section Изменение размеров данных @MGL{}
-
-@cindex rearrange
-@anchor{rearrange}
-@deffn {Команда MGL} rearrange dat @code{mx [my=0 mz=0]}
-Изменяет размерность данных без изменения самого массива данных, так что результирующий массив @var{mx}*@var{my}*@var{mz} < nx*ny*nz. Если один из параметров @var{my} или @var{mz} ноль, то он будет выбран оптимальным образом. Например, если @var{my}=0, то будет @var{my}=nx*ny*nz/@var{mx} и @var{mz}=1.
-@end deffn
-
-@cindex extend
-@anchor{extend}
-@deffn {Команда MGL} extend dat @code{n1 [n2=0]}
-Увеличивает размер данных путем вставки (|@var{n1}|+1) новых срезов после (для @var{n1}>0) или перед (для @var{n1}<0) существующими данными. Можно добавить сразу 2 размерности для 1d массива, используя второй параметр @var{n2}. Данные в новые срезы будут скопированы из существующих. Например, для @var{n1}>0 новый массив будет
-@iftex
-@math{a_{ij}^{new} = a_i^{old}} where j=0...@var{n1}. Соответственно, для @var{n1}<0 новый массив будет @math{a_{ij}^{new} = a_j^{old}}, где i=0...|@var{n1}|.
-@end iftex
-@ifnottex
-a_ij^new = a_i^old where j=0...@var{n1}. Соответственно, для @var{n1}<0 новый массив будет a_ij^new = a_j^old, где i=0...|@var{n1}|.
-@end ifnottex
-@end deffn
-
-@cindex transpose
-@anchor{transpose}
-@deffn {Команда MGL} transpose dat ['dim'='yxz']
-Транспонирует (меняет порядок размерностей) массив данных. Новый порядок размерностей задается строкой @var{dim}.
-@end deffn
-
-@cindex squeeze
-@anchor{squeeze}
-@deffn {Команда MGL} squeeze dat @code{rx [ry=1 rz=1 sm=off]}
-Уменьшает размер данных путем удаления элементов с индексами не кратными @var{rx}, @var{ry}, @var{rz} соответственно. Параметр @var{smooth} задает использовать сглаживания
-@iftex
-(т.е. @math{a_{out}[i]=\sum_{j=i,i+r}a[j]/r}) или нет (т.е. @math{a_{out}[i]=a[j*r]}).
-@end iftex
-@ifnottex
-(т.е. out[i]=\sum_@{j=i,i+r@} a[j]/r) или нет (т.е. out[i]=a[j*r]).
-@end ifnottex
-@end deffn
-
-@cindex crop
-@anchor{crop}
-@deffn {Команда MGL} crop dat @code{n1 n2} 'dir'
-Обрезает границы данных при @var{i}<@var{n1} и @var{i}>@var{n2} (при @var{n2}>0) или @var{i}>@code{n[xyz]}-@var{n2} (при @var{n2}<=0) вдоль направления @var{dir}.
-@end deffn
-
-@cindex delete
-@anchor{delete}
-@deffn {Команда MGL} delete dat
-Удаляет массив @var{dat} и освобождает использованную память. Может быть полезно для больших неиспользуемых массивов.
-@end deffn
-
-@deffn {Команда MGL} delete dat 'dir' @code{[pos=off num=0]}
-Удаляет @var{num} срезов вдоль направления @var{dir} с позиции @var{pos}.
-@end deffn
-
-@cindex insert
-@anchor{insert}
-@deffn {Команда MGL} insert dat 'dir' @code{[pos=off num=0]}
-Вставляет @var{num} срезов вдоль направления @var{dir} с позиции @var{pos} и заполняет их нулями.
-@end deffn
-
-@c ------------------------------------------------------------------
-@node File I/O @MGL{}, Make another data @MGL{}, Rearrange data @MGL{}, MGL interface
-@section Чтение/сохранение данных @MGL{}
-
-@cindex read
-@anchor{read}
-@deffn {Команда MGL} read dat 'fname'
-Читает данные из текстового файла с разделителями символом пробела/табуляции с автоматическим определением размера массива. Двойной перевод строки начинает новый срез данных (по направлению z).
-@end deffn
-
-@deffn {Команда MGL} read dat 'fname' @code{mx [my=1 mz=1]}
-Читает данные из текстового файла с заданными размерами. Ничего не делается если параметры @var{mx}, @var{my} или @var{mz} равны нулю или отрицательны.
-@end deffn
-
-@cindex readmat
-@anchor{readmat}
-@deffn {Команда MGL} readmat dat 'fname' [@code{dim=2}]
-Читает данные из текстового файла с размерами, указанными в первых @var{dim} числах файла. При этом переменная @var{dim} задает размерность (1d, 2d, 3d) данных.
-@end deffn
-
-@cindex readall
-@anchor{readall}
-@deffn {Команда MGL} readall dat 'templ' @code{v1 v2 [dv=1 slice=off]}
-Объединяет данные из нескольких текстовых файлов. Имена файлов определяются вызовом функции @code{sprintf(fname,templ,val);}, где @var{val} меняется от @var{v1} до @var{v2} с шагом @var{dv}. Данные загружаются один за другим в один и тот же срез данных (при @var{slice}=@code{off}) или срез-за-срезом (при @var{slice}=@code{on}).
-@end deffn
-
-@deffn {Команда MGL} readall dat 'templ' @code{[slice=off]}
-Объединяет данные из нескольких текстовых файлов, чьи имена удовлетворяют шаблону @var{templ} (например, @var{templ}=@code{"t_*.dat"}). Данные загружаются один за другим в один и тот же срез данных (при @var{slice}=@code{off}) или срез-за-срезом (при @var{slice}=@code{on}).
-@end deffn
-
-@cindex save
-@anchor{save}
-@deffn {Команда MGL} save dat 'fname'
-Сохраняет массив данных в текстовый файл.
-@end deffn
-
-@cindex readhdf
-@anchor{readhdf}
-@deffn {Команда MGL} readhdf dat 'fname' 'dname'
-Читает массив с именем @var{dname} из HDF5 или HDF4 файла @var{fname}.
-@end deffn
-
-@cindex savehdf
-@anchor{savehdf}
-@deffn {Команда MGL} savehdf dat 'fname' 'dname'
-Сохраняет массив под именем @var{dname} в HDF5 или HDF4 файл @var{fname}.
-@end deffn
-
-@cindex import
-@anchor{import}
-@deffn {Команда MGL} import dat 'fname' 'sch' [@code{v1=0 v2=1}]
-Читает данные из растрового файла. RGB значения пикселов преобразуются в число в диапазоне [@var{v1}, @var{v2}] используя цветовую схему @var{sch} (@pxref{Color scheme}).
-@end deffn
-
-@cindex export
-@anchor{export}
-@deffn {Команда MGL} export dat 'fname' 'sch' [@code{v1=0 v2=0}]
-Сохраняет данные в растровый файл. Числовые значения, нормированные в диапазон [@var{v1}, @var{v2}], преобразуются в RGB значения пикселов, используя цветовую схему @var{sch} (@pxref{Color scheme}). Если @var{v1}>=@var{v2}, то значения @var{v1}, @var{v2} определяются автоматически как минимальное и максимальное значение данных.
-@end deffn
-
-@c ------------------------------------------------------------------
-@node Make another data @MGL{}, Change data @MGL{}, File I/O @MGL{}, MGL interface
-@section Создание новых данных @MGL{}
-
-@cindex combine
-@anchor{combine}
-@deffn {Команда MGL} combine res adat bdat
-Возвращает в массиве данных @var{res} прямое произведение массивов (наподобие, res[i,j] = adat[i]*bdat[j] и т.д.).
-@end deffn
-
-@cindex evaluate
-@anchor{evaluate}
-@deffn {Команда MGL} evaluate res dat idat [@code{norm=on}]
-@deffnx {Команда MGL} evaluate res dat idat jdat [@code{norm=on}]
-@deffnx {Команда MGL} evaluate res dat idat jdat kdat [@code{norm=on}]
-Возвращает массив данных @var{res}, полученный в результате интерполяции исходного массива в точках других массивов (например, res[i,j]=dat[idat[i,j],jdat[i,j]]). Размеры массивов @var{idat}, @var{jdat}, @var{kdat} должны совпадать. Координаты в @var{idat}, @var{jdat}, @var{kdat} полагаются нормированными в диапазон [0,1] (при @var{norm}=@code{on}) или в диапазоны [0,nx], [0,ny], [0,nz] соответственно.
-@end deffn
-
-@cindex hist
-@anchor{hist}
-@deffn {Команда MGL} hist res dat @code{num v1 v2 [nsub=0]}
-@deffnx {Команда MGL} hist res dat wdat @code{num v1 v2 [nsub=0]}
-Возвращает распределение (гистограмму) @var{res} из @var{num} точек от значений массива @var{dat} в диапазоне [@var{v1}, @var{v2}]. Массив @var{wdat} задает веса элементов (все веса равны 1 если @var{wdat} не указан). Параметр @var{nsub} задает число дополнительных точек интерполяции (для сглаживания получившейся гистограммы).
-@end deffn
-
-@deffn {Команда MGL} hist res xdat adat
-@deffnx {Команда MGL} hist res xdat ydat adat
-@deffnx {Команда MGL} hist res xdat ydat zdat adat
-Возвращает распределение (гистограмму) @var{res} от значений массива @var{adat}, параметрически зависящего от координат @{@var{xdat},@var{ydat},@var{zdat}@} в диапазоне осей координат. Массив @var{adat} играет роль веса точки. Число точек в результате @var{res} -- максимум из размера @var{res} и 100.
-@end deffn
-
-
-@cindex momentum
-@anchor{momentum}
-@deffn {Команда MGL} momentum res dat 'how' ['dir'='z']
-Возвращает в массиве данных @var{res} момент (1d массив) данных @var{dat} вдоль направления @var{dir}. Строка @var{how} определяет тип момента. Момент определяется как
-@iftex
-@math{res_k = \sum_{ij} how(x_i,y_j,z_k) dat_{ij}/\sum_{ij} a_{ij}}
-@end iftex
-@ifnottex
-res_k = \sum_ij how(x_i,y_j,z_k) dat_ij/ \sum_ij a_ij
-@end ifnottex
-если @var{dir}=@samp{z} и т.д. Координаты @samp{x}, @samp{y}, @samp{z} -- индексы массива в диапазоне [0,1].
-@end deffn
-
-@cindex sum
-@anchor{sum}
-@deffn {Команда MGL} sum res dat 'dir'
-Возвращает в массиве данных @var{res} результат суммирования @var{dat} вдоль направления(ий) @var{dir}.
-@end deffn
-
-@cindex max
-@anchor{max}
-@deffn {Команда MGL} max res dat 'dir'
-Возвращает в массиве данных @var{res} максимальное значение @var{dat} вдоль направления(ий) @var{dir}.
-Gets array which is the maximal data values in given direction or direction(s).
-@end deffn
-
-@cindex min
-@anchor{min}
-@deffn {Команда MGL} min res dat 'dir'
-Возвращает в массиве данных @var{res} минимальное значение @var{dat} вдоль направления(ий) @var{dir}.
-@end deffn
-
-@cindex resize
-@anchor{resize}
-@deffn {Команда MGL} resize res dat @code{mx [my=1 mz=1]}
-Возвращает массив данных @var{res} размером @var{mx}, @var{my}, @var{mz} со значениями полученными интерполяцией значений массива @var{dat}.
-@end deffn
-
-@cindex subdata
-@anchor{subdata}
-@deffn {Команда MGL} subdata res dat @code{xx [yy=: zz=:]}
-Возвращает в @var{res} подмассив массива данных @var{dat} с фиксированными значениями индексов с положительными значениями. Например, @code{subdata a b : 2} выделяет третью строку (индексы начинаются с нуля), @code{subdata a b 4 :} выделяет 5-ую колонку, @code{subdata a b : : 3} выделяет 4-ый срез и т.д.
-@end deffn
-
-@cindex trace
-@anchor{trace}
-@deffn {Команда MGL} trace res dat
-Возвращает массив @var{ref} диагональных элементов @var{dat}[i,i] (для 2D данных) или @var{dat}[i,i,i] (для 3D данных) где i=0...nx-1. В 1D случае возвращается сам массив данных @var{dat}. Размеры массива данных должен быть @var{dat}.ny, @var{dat}.nz >= @var{dat}.nx или @var{dat}.ny, @var{dat}.nz = 1.
-@end deffn
-
-@cindex transform
-@anchor{transform}
-@deffn {Команда MGL} transform dat 'type' real imag
-Выполняет интегральное преобразование комплексных данных @var{real}, @var{imag} в выбранном направлении и возвращает модуль результата в @var{res}. Порядок и тип преобразований задается строкой @var{type}: первый символ для x-направления, второй для y-направления, третий для z-направления. Возможные символы: @samp{f} -- прямое преобразование Фурье, @samp{i} -- обратное преобразование Фурье, @samp{s} -- синус преобразование, @samp{c} -- косинус преобразование, @samp{h} -- преобразование Ханкеля, @samp{n} или @samp{ } -- нет преобразования.
-@end deffn
-
-@cindex transforma
-@anchor{transforma}
-@deffn {Команда MGL} transforma dat 'type' ampl phase
-Аналогично предыдущему с заданными амплитудой @var{ampl} и фазой @var{phase} комплексных чисел.
-@end deffn
-
-@cindex stfad
-@anchor{stfad}
-@deffn {Команда MGL} stfad res real imag @code{dn} ['dir'='x']
-Выполняет оконное преобразование Фурье длиной @var{dn} для комплексных данных @var{real}, @var{imag} и возвращает модуль результата в @var{res}. Например, для @var{dir}=@samp{x} результат будет иметь размер @{int(nx/dn), dn, ny@} и будет равен @math{res[i,j,k]=|\sum_d^dn exp(I*j*d)*(real[i*dn+d,k]+I*imag[i*dn+d,k])|/dn}.
-@end deffn
-
-@cindex pde
-@anchor{pde}
-@deffn {Команда MGL} pde res 'ham' ini_re ini_im [@code{dz=0.1 k0=100}]
-Решает уравнение в частных производных du/dz = i*k0*@var{ham}(p,q,x,y,z,|u|)[u], где p=-i/k0*d/dx, q=-i/k0*d/dy -- псевдо-дифференциальные операторы. Параметры @var{ini_re}, @var{ini_im} задают начальное распределение поля. Координаты в уравнении и в решении полагаются в диапазоне осей координат. Замечу, что внутри этот диапазон увеличивается в 3/2 раза для уменьшения отражения от границ расчетного интервала. Параметр @var{dz} задает шаг по эволюционной координате z. В данный момент использован упрощенный алгоритм, когда все ``смешанные'' члена (типа @samp{x*p}->x*d/dx) исключаются. Например, в 2D случае это функции типа @math{ham = f(p,z) + g(x,z,u)}. При этом допускаются коммутирующие комбинации (типа @samp{x*q}->x*d/dy). Переменная @samp{u} используется для обозначения амплитуды поля |u|. Это позволяет решать нелинейные задачи -- например, нелинейное уравнение Шредингера @code{ham='p^2+q^2-u^2'}. Также можно указать мнимую часть для поглощения (типа @code{ham = 'p^2+i*x*(x>0)'}), но только если зависимость от @samp{i} линейная, т.е. @math{ham = hre+i*him}. @sref{PDE sample}
-@end deffn
-
-@cindex ray
-@anchor{ray}
-@deffn {Команда MGL} ray res 'ham' @code{x0 y0 z0 p0 q0 v0 [dt=0.1 tmax=10]}
-Решает систему геометрооптических уравнений d@emph{r}/dt = d @var{ham}/d@emph{p}, d@emph{p}/dt = -d @var{ham}/d@emph{r}. Это гамильтоновы уравнения для траектории частицы в 3D случае. Гамильтониан @var{ham} может зависеть от координат @samp{x}, @samp{y}, @samp{z}, импульсов @samp{p}=px, @samp{q}=py, @samp{v}=pz и времени @samp{t}: @math{ham = H(x,y,z,p,q,v,t)}. Начальная точка (при @code{t=0}) задается переменными @{@var{x0}, @var{y0}, @var{z0}, @var{p0}, @var{q0}, @var{v0}@}. Параметры @var{dt} и @var{tmax} задают шаг и максимальное время интегрирования. Результат @var{res} -- массив @{x,y,z,p,q,v,t@} с размером @{7 * int(@var{tmax}/@var{dt}+1) @}. @sref{Beam tracing sample}
-@end deffn
-
-@cindex qo2d
-@anchor{qo2d}
-@deffn {Команда MGL} qo2d res 'ham' ini_re ini_im ray [@code{r=1 k0=100} xx=0 yy=0]
-Решает уравнение в частных производных du/dt = i*k0*@var{ham}(p,q,x,y,|u|)[u] в сопровождающей системе координат, где p=-i/k0*d/dx, q=-i/k0*d/dy -- псевдо-дифференциальные операторы. Параметры @var{ini_re}, @var{ini_im} задают начальное распределение поля. Параметр @var{ray} задает опорный луч для сопровождающей системы координат. Можно использовать луч найденный с помощью @code{ray}. Опорный луч должен быть достаточно гладкий, чтобы система координат была однозначной и для исключения ошибок интегрирования. Если массивы @var{xx} и @var{yy} указаны, то в них записываются декартовы координаты для каждой точки найденного решения. См. также @ref{pde}. @sref{Beam tracing sample}
-@end deffn
-
-@cindex jacobian
-@anchor{jacobian}
-@deffn {Команда MGL} jacobian res xdat ydat [zdat=0]
-Вычисляет якобиан преобразования @{i,j,k@} в @{@var{xdat},@var{ydat},@var{zdat}@}, где координаты @{i,j,k@} полагаются нормированными в интервал [0,1]. Якобиан находится по формуле det||@math{dr_\alpha/d\xi_\beta}||, где @math{r}=@{@var{xdat},@var{ydat},@var{zdat}@} и @math{\xi}=@{i,j,k@}. Все размерности всех массивов должны быть одинаковы. Данные должны быть трехмерными если указаны все 3 массива @{@var{xdat},@var{ydat},@var{zdat}@} или двумерными если только 2 массива @{@var{xdat},@var{ydat}@}.
-@end deffn
-
-
-
-@c ------------------------------------------------------------------
-@node Change data @MGL{}, Operators @MGL{}, Make another data @MGL{}, MGL interface
-@section Изменение данных @MGL{}
-
-Эти команды изменяют данные вдоль заданного направления(ий) типа например дифференцирования, интегрирования и т.д. Направление указывается строкой @var{dir}, которая может содержать символы @samp{x}, @samp{y} и/или @samp{z}, вдоль которых изменения будут применены.
-
-@cindex cumsum
-@anchor{cumsum}
-@deffn {Команда MGL} cumsum dat 'dir'
-Суммирует с накоплением в выбранном направлении(ях).
-@end deffn
-@cindex integrate
-@anchor{integrate}
-@deffn {Команда MGL} integrate dat 'dir'
-Выполняет интегрирование (подобно суммированию с накоплением) в выбранном направлении(ях).
-@end deffn
-@cindex diff
-@anchor{diff}
-@deffn {Команда MGL} diff dat 'dir'
-Выполняет дифференцирование в выбранном направлении(ях).
-@end deffn
-@deffn {Команда MGL} diff dat xdat ydat [zdat=0]
-Выполняет дифференцирование данных @var{dat}, параметрически зависящих от координат, в направлении @var{xdat} с @var{ydat}, @var{zdat}=constant. Параметр @var{zdat} может быть опущен, что соответствует 2D случаю. Используются следующие формулы (2D случай): @math{da/dx = (a_j*y_i-a_i*y_j)/(x_j*y_i-x_i*y_j)}, где @math{a_i=da/di, a_j=da/dj} обозначает дифференцирование вдоль 1-ой и 2-ой размерности. Похожие формулы используются и в 3D случае. Порядок аргументов можно менять -- например, если данные a(i,j) зависят от координат @{x(i,j), y(i,j)@}, то обычная производная по @samp{x} будет равна @code{diff a x y}, а обычная производная по @samp{y} будет равна @code{diff a y x}.
-@end deffn
-
-@cindex diff2
-@anchor{diff2}
-@deffn {Команда MGL} diff2 dat 'dir'
-Выполняет двойное дифференцирование (как в операторе Лапласа) в выбранном направлении(ях).
-@end deffn
-
-@cindex sinfft
-@anchor{sinfft}
-@deffn {Команда MGL} sinfft dat 'dir'
-Выполняет синус преобразование в выбранном направлении(ях). Синус преобразование есть @math{\sum a_i \sin(k i)}.
-@end deffn
-@cindex cosfft
-@anchor{cosfft}
-@deffn {Команда MGL} cosfft dat 'dir'
-Выполняет косинус преобразование в выбранном направлении(ях). Синус преобразование есть @math{\sum a_i \cos(k i)}.
-@end deffn
-@cindex hankel
-@anchor{hankel}
-@deffn {Команда MGL} hankel dat 'dir'
-Выполняет преобразование Ханкеля в выбранном направлении(ях). Преобразование Ханкеля есть @math{\sum a_i J_0(k i)}.
-@end deffn
-
-
-@cindex swap
-@anchor{swap}
-@deffn {Команда MGL} swap dat 'dir'
-Меняет местами левую и правую части данных в выбранном направлении(ях). Полезно для отображения результата FFT.
-@end deffn
-@cindex roll
-@anchor{roll}
-@deffn {Команда MGL} roll dat 'dir' num
-Сдвигает данные на @var{num} ячеек в выбранном направлении(ях). Соответствует замене индекса на @var{i}->(@var{i}+@var{num})%@var{n}.
-@end deffn
-
-@cindex mirror
-@anchor{mirror}
-@deffn {Команда MGL} mirror dat 'dir'
-Отражает данные в выбранном направлении(ях). Соответствует замене индекса на @var{i}->@var{n}-@var{i}.
-@end deffn
-
-@cindex sew
-@anchor{sew}
-@deffn {Команда MGL} sew dat ['dir'='xyz' @code{da=2*pi}]
-Удаляет скачки данных (например, скачки фазы после обратных тригонометрических функций) с периодом @var{da} в выбранном направлении(ях).
-@end deffn
-
-@cindex smooth
-@anchor{smooth}
-@deffn {Команда MGL} smooth data @code{type} ['dir'='xyz']
-Сглаживает данные в выбранном направлении(ях) методом @var{type}. Сейчас поддерживаются 4 метода: @code{0} ничего не делает, @code{1} линейное усреднение по 3 точкам, @code{2} линейное усреднение по 5 точкам, @code{3} квадратичное усреднение по 5 точкам.
-@end deffn
-
-@cindex envelop
-@anchor{envelop}
-@deffn {Команда MGL} envelop dat ['dir'='x']
-Находит огибающую данных в выбранном направлении. Только одно направление может быть выбрано за раз.
-@end deffn
-
-@cindex normsl
-@anchor{normsl}
-@deffn {Команда MGL} normsl dat @code{v1 v2} ['dir'='z' @code{keep=on sym=off}]
-Нормирует данные срез-за-срезом в выбранном направлении @var{dir} в интервал [@var{v1},@var{v2}]. Если @var{sym}=@code{on}, то используется симметричный интервал [-max(|v1|,|v2|), max(|v1|,|v2|)]. Если @var{keep}=@code{on}, то максимальное значение k-го среза ограничено величиной
-@iftex
-@math{\sqrt{\sum a_{ij}(k)/\sum a_{ij}(0)}}.
-@end iftex
-@ifnottex
-@math{\sqrt@{\sum a_ij(k)/\sum a_ij(0)@}}.
-@end ifnottex
-@end deffn
-
-@cindex norm
-@anchor{norm}
-@deffn {Команда MGL} norm dat @code{v1 v2 [sym=off dim=0]}
-Нормирует данные в интервал [@var{v1},@var{v2}]. Если @var{sym}=@code{on}, то используется симметричный интервал [-max(|v1|,|v2|), max(|v1|,|v2|)]. Изменения применяются только к срезам >=@var{dim}.
-@end deffn
-
-@c ------------------------------------------------------------------
-@node Operators @MGL{}, Program flow @MGL{}, Change data @MGL{}, MGL interface
-@section Операторы @MGL{}
-
-@cindex multo
-@anchor{multo}
-@deffn {Команда MGL} multo dat dat2
-Поэлементно умножает массив @var{dat} на @var{dat2}.
-@end deffn
-@deffn {Команда MGL} multo dat @code{val}
-Умножает каждый элемент на число.
-@end deffn
-
-@cindex divto
-@anchor{divto}
-@deffn {Команда MGL} divto dat dat2
-Поэлементно делит массив @var{dat} на @var{dat2}.
-@end deffn
-@deffn {Команда MGL} divto dat @code{val}
-Делит каждый элемент на число.
-@end deffn
-
-@cindex addto
-@anchor{addto}
-@deffn {Команда MGL} addto dat dat2
-Поэлементно прибавляет @var{dat2} к массиву @var{dat}.
-@end deffn
-@deffn {Команда MGL} addto dat @code{val}
-Прибавляет число к каждому элементу.
-@end deffn
-
-@cindex subto
-@anchor{subto}
-@deffn {Команда MGL} subto dat dat2
-Поэлементно вычитает @var{dat2} из массива @var{dat}.
-@end deffn
-@deffn {Команда MGL} subto dat @code{val}
-Вычитает число из каждого элемента.
-@end deffn
-
-@c ------------------------------------------------------------------
-@node Program flow @MGL{}, Command options @MGL{}, Operators @MGL{}, MGL interface
-@section Программирование @MGL{}
-
-Эти команды управляют порядком выполнения других команд (условия, циклы, подпрограммы), (пере-)определяют аргументы скрипта и пр.
-
-@cindex chdir
-@anchor{chdir}
-@deffn {Команда MGL} chdir 'path'
-Переходит в папку @var{path}.
-@end deffn
-
-@cindex define
-@anchor{define}
-@deffn {Команда MGL} define $N smth
-Задает @var{N}-ый аргумент скрипта равным @var{smth}. Отмечу, что @var{smth} используется как есть (с символами @samp{'} если присутствуют). Выполняется только подстановка других макроопределений $0...$9, $a...$z. Здесь @var{N} это цифра (0...9) или буква (a...z).
-@end deffn
-@deffn {Команда MGL} define name smth
-Определяет константу (скаляр) с именем @code{name} и числовым значением @code{smth}. Позднее она может быть использована как обычное число.
-@end deffn
-@cindex defchr
-@anchor{defchr}
-@deffn {Команда MGL} defchr $N smth
-Задает @var{N}-ый аргумент скрипта равным символу с UTF кодом @var{smth}. Здесь @var{N} это цифра (0...9) или буква (a...z).
-@end deffn
-@cindex defnum
-@anchor{defnum}
-@deffn {Команда MGL} defnum $N smth
-Задает @var{N}-ый аргумент скрипта равным числовому значению @var{smth}. Здесь @var{N} это цифра (0...9) или буква (a...z).
-@end deffn
-@cindex defpal
-@anchor{defpal}
-@deffn {Команда MGL} defpal $N smth
-Задает @var{N}-ый аргумент скрипта равным символу палитры с индексом, найденным из @var{smth}. Здесь @var{N} это цифра (0...9) или буква (a...z).
-@end deffn
-
-@cindex call
-@anchor{call}
-@deffn {Команда MGL} call 'fname' [ARG1 ARG2 ... ARG9]
-Переходит к выполнению (вызывает) подпрограммы @var{fname} (или внешнего скрипта, если функция не была найдена). Опциональные аргументы передаются в подпрограмму. См. также @ref{func}.
-@end deffn
-@cindex func
-@anchor{func}
-@deffn {Команда MGL} func 'fname' [narg=0]
-Определяет подпрограмму с именем @var{fname} и задает число требуемых аргументов. Аргументы будут помещены в параметры скрипта $1, $2, ... $9. Отмечу, что выполнение основной программы должно быть остановлено до начала определений подпрограмм. См. также @ref{stop}, @ref{return}.
-@end deffn
-@cindex return
-@anchor{return}
-@deffn {Команда MGL} return
-Возвращается из подпрограммы.
-@end deffn
-
-
-@cindex if
-@anchor{if}
-@deffn {Команда MGL} if dat 'cond'
-Начинает блок команд, выполняемый если каждый элемент @var{dat} удовлетворяет условию @var{cond}.
-@end deffn
-@deffn {Команда MGL} if @code{val}
-Начинает блок команд, выполняемый если @code{val} не ноль.
-@end deffn
-@cindex elseif
-@anchor{elseif}
-@deffn {Команда MGL} elseif dat 'cond'
-Начинает блок команд, выполняемый если предыдущий @code{if} или @code{elseif} не был выполнен и каждый элемент @var{dat} удовлетворяет условию @var{cond}.
-@end deffn
-@deffn {Команда MGL} elseif @code{val}
-Начинает блок команд, выполняемый если предыдущий @code{if} или @code{elseif} не был выполнен и @code{val} не ноль.
-@end deffn
-@cindex else
-@anchor{else}
-@deffn {Команда MGL} else
-Начинает блок команд, выполняемый если предыдущий @code{if} или @code{elseif} не был выполнен.
-@end deffn
-@cindex endif
-@anchor{endif}
-@deffn {Команда MGL} endif
-Заканчивает определение блока @code{if/elseif/else}.
-@end deffn
-
-@cindex for
-@anchor{for}
-@deffn {Команда MGL} for $N @code{v1 v2 [dv=1]}
-Начинает блок команд, выполняемый в цикле с $@var{N}-ым аргументом изменяющимся от @var{v1} до @var{v2} с шагом @var{dv}. Здесь @var{N} это цифра (0...9) или буква (a...z).
-@end deffn
-@deffn {Команда MGL} for $N dat
-Начинает блок команд, выполняемый в цикле с $@var{N}-ым аргументом пробегающим значения массива @var{dat}. Здесь @var{N} это цифра (0...9) или буква (a...z).
-@end deffn
-@cindex next
-@anchor{next}
-@deffn {Команда MGL} next
-Заканчивает блок цикла @code{for}.
-@end deffn
-
-@cindex once
-@anchor{once}
-@deffn {Команда MGL} once @code{val}
-Определяет код (между @code{once on} и @code{once off}) который будет выполнен только один раз. Полезно для работы с большими данными в программах типа UDAV.
-@end deffn
-@cindex stop
-@anchor{stop}
-@deffn {Команда MGL} stop
-Останавливает выполнение скрипта.
-@end deffn
-
-@c ------------------------------------------------------------------
-@node Command options @MGL{}, Suffixes, Program flow @MGL{}, MGL interface
-@section Опции команд
-
-Опции команд позволяют легко настроить вид отдельного графика не меняя глобальных настроек для все рисунка. Опции указываются после команды. Каждая опция отделяется от предыдущей символом @samp{;}. Опции работают так, что запоминают текущие настройки рисунка, применяют собственные настройки, выполняют команду и возвращают глобальные настройки обратно. Поэтому использование опций для команд обработки данных или настройки графика бесполезно.
-
-Наиболее часто используемые опции -- @code{xrange, yrange, zrange}, устанавливающие границы изменения осей координат (и тем самым автоматических массивов). Например, команда @code{plot y; xrange 0.1 0.9} построит кривую с x-координатой равно распределенной в интервале 0.1 ... 0.9, а не вдоль текущей оси x.
-
-Полный список опций:
-@cindex alpha
-@cindex alphadef
-@deffn {Опция MGL} alpha @code{val}
-@deffnx {Опция MGL} alphadef @code{val}
-Задает величину прозрачности поверхности. Значение должно быть в диапазоне [0, 1]. См. также @ref{alphadef}
-@end deffn
-@cindex ambient
-@deffn {Опция MGL} ambient @code{val}
-Задает яркость фонового освещения. Значение должно быть в диапазоне [0, 1]. См. также @ref{ambient}
-@end deffn
-@cindex crange
-@deffn {Опция MGL} crange @code{val1 val2}
-Задает границы цветовой шкалы. См. также @ref{crange}
-@end deffn
-@cindex xrange
-@deffn {Опция MGL} xrange @code{val1 val2}
-Задает границы изменения координаты x. См. также @ref{xrange}
-@end deffn
-@cindex yrange
-@deffn {Опция MGL} yrange @code{val1 val2}
-Задает границы изменения координаты y. См. также @ref{yrange}
-@end deffn
-@cindex zrange
-@deffn {Опция MGL} zrange @code{val1 val2}
-Задает границы изменения координаты z. См. также @ref{zrange}
-@end deffn
-@cindex cut
-@deffn {Опция MGL} cut @code{val}
-Задает обрезание точек за пределами осей координат. См. также @ref{cut}
-@end deffn
-@cindex fontsize
-@deffn {Опция MGL} fontsize @code{val}
-Задает размер текста. См. также @ref{font}
-@end deffn
-@cindex marksize
-@deffn {Опция MGL} marksize @code{val}
-Задает размер маркеров. См. также @ref{marksize}
-@end deffn
-@cindex meshnum
-@deffn {Опция MGL} meshnum @code{val}
-Задает ориентировочное число линий, стрелок, ячеек и пр. См. также @ref{meshnum}
-@end deffn
-@cindex legend
-@deffn {Опция MGL} legend 'txt'
-Добавляет строку 'txt' во внутренний массив записей легенды. Стиль линии и маркера аргумента последней вызванной команды построения @ref{1D plotting @MGL{}}. См. также @ref{legend}
-@end deffn
-
-@c ------------------------------------------------------------------
-@node Suffixes, Utilities, Command options @MGL{}, MGL interface
-@section Суффиксы переменных
-
-Суффиксы позволяют быстро получить числовую характеристику (размер, максимальное или минимальное значение, сумму элементов и т.д.) массива данных и использовать ее как число (скаляр) в аргументах. Суффиксы начинаются с точки @samp{.} сразу после (без пробелов) имени переменной и временного массива. Например, @code{a.nx} даст размер массива @var{a} по оси х, @code{b(1).max} даст максимальное значение второй строки массива @var{b}, @code{(c(:,0)^2).sum} даст сумму квадратов элементов первой колонки массива @var{c} и т.д.
-
-Полный список суффиксов:
-@table @strong
-@item nx, ny, nz
-Размер массива в направлении x, y, z соответственно.
-@item max
-Максимальное значение массива.
-@item min
-Минимальное значение массива.
-@item sum
-Сумма элементов массива.
-@item a
-Первый элемент массива (элемент с индексами 0,0,0).
-@item fst
-Первое не нулевое значение массива.
-@item lst
-Последнее не нулевое значение массива.
-@item mx, my, mz
-Положение максимума в направлении x, y, z соответственно.
-@item ax, ay, az, aa
-Положение центра масс в направлении x, y, z соответственно или среднее значение массива.
-@item wx, wy, wz, wa
-Ширина в направлении x, y, z соответственно или дисперсия элементов массива.
-@item sx, sy, sz, sa
-Асимметрия в направлении x, y, z соответственно или элементов массива.
-@item kx, ky, kz, ka
-Эксцесс в направлении x, y, z соответственно или элементов массива.
-@end table
-
-@c ------------------------------------------------------------------
-@node Utilities, , Suffixes, MGL interface
-@section Утилиты для MGL
-
-MathGL содержит несколько программ для работы со скриптами MGL. Есть утилита для сохранения в растровое (@code{mgl2png}, @code{mgl2gif}) или векторное (@code{mgl2eps}, @code{mgl2svg}) изображения. Программа @code{mglview} показывает результат выполнения скрипта MGL и позволяет вращать и настраивать график. Также можно транслировать MGL скрипт в C++ файл с помощью программы @code{mgl2cpp}.
-
-Все эти программы имеют схожий набор аргументов. Первым идет имя скрипта, а вторым идет имя выходного файлы (может быть опущено), последние аргументы -- опции скрипта и программы. К опциям относятся параметры скрипта (это @code{$0, $1, ... $9}) и настройки локали. Параметры скрипта имеют формат @samp{-Nval}, где N=0,1...9 -- номер параметра, val -- его значние. Например, опция @samp{-1test} заменит @code{$1} на @samp{test} в скрипте. Опция -Lval устанавливает локаль в значение val. Например, @samp{-Lutf8} будет использовать UTF-8 в скрипте.
-
-Также можно создавать анимированные изображения GIF или набор JPEG файлов с именами @samp{frameNNNN.jpg} (где @samp{NNNN} -- номер кадра). Для этого в скрипте надо указать параметры анимации для каждого кадра (строками с коментариями @code{##a val} или опциями @samp{-Aval}) или в цикле (строкой с комментарием @code{##с v1 v2 [dv]} или опцию @samp{-Cn1:n2}), которые будут подставлены в качестве параметра @code{$0} при последовательном вызове скрипта. Для сохранения кадров в JPEG просто добавьте команду @code{write ''} в конце скрипта.
-
-
@menu
* Overview::
* Examples::
+* MGL scripts::
+* General concepts::
* MathGL core::
* Data processing::
-* Samples::
* Copying This Manual::
* Index::
@end menu
@rmacro sref {arg}
-@xref{\arg\}, for sample code and picture.
@end rmacro
@macro tdref{nam}
-@uref{http://mathgl.sourceforge.net/pdf_u3d/\nam\.pdf, 3D pdf}
@end macro
@set UDAV
+
@node Overview, Examples, , Top
@include overview_en.texi
-@node Examples, MathGL core, Overview, Top
+@node Examples, MGL scripts, Overview, Top
@include ex_mgl_en.texi
-@node MathGL core, Data handling, Examples, Top
+@node MGL scripts, General concepts, Examples, Top
+@include parse_en.texi
+
+@node General concepts, MathGL core, MGL scripts, Top
+@include concept_en.texi
+
+@node MathGL core, Data processing, General concepts, Top
@include core_en.texi
-@node Data processing, Samples, MathGL core, Top
+@node Data processing, Copying This Manual, MathGL core, Top
@include data_en.texi
-@node Samples, Copying This Manual, Data handling, Top
-@include samples_en.texi
-
-@node Copying This Manual, Index, Samples, Top
+@node Copying This Manual, Index, Data processing, Top
@appendix GNU Free Documentation License
@include fdl.texi
* mglColor class::
* mglPoint class::
* mglFont class::
-* mglVar class::
-* mglCommand class::
-* mglArg class::
@end menu
Compare with another color
@end deftypemethod
+@deftypemethod mglColor @code{bool} operator*= (@code{float} v)
+Multiplies color components by number @var{v}.
+@end deftypemethod
+
+@deftypemethod mglColor @code{bool} operator+= (@code{const mglColor &}c)
+Adds color @var{c} component by component.
+@end deftypemethod
+
+@deftypemethod mglColor @code{bool} operator-= (@code{const mglColor &}c)
+Subtracts color @var{c} component by component.
+@end deftypemethod
+
@deftypefn {Library Function} {mglColor} operator+ (@code{const mglColor &}a, @code{const mglColor &}b)
Adds colors by its RGB values.
@end deftypefn
@c ------------------------------------------------------------------
-@node mglFont class, mglVar class, mglPoint class, Other classes
+@node mglFont class, , mglPoint class, Other classes
@section mglFont class
@cindex mglFont
Note: the closing contour line is done automatically (so the last segment may be absent). For starting new contour use a point with coordinates @code{@{0x3fff, 0x3fff@}}.
-@c ------------------------------------------------------------------
-@node mglVar class, mglCommand class, mglFont class, Other classes
-@section mglVar class
-@cindex mglVar
-
-Structure describes variable of type @code{mglData} and its name in MGL script. This structure is used by @code{mglParse} and is defined in @code{#include <mgl/parser.h>}. This class is accessible only from C++ (and only from GNU compilers in default binary files).
-
-@deftypecv {Parameter} mglVar @code{mglData} d
-Data itself
-@end deftypecv
-@deftypecv {Parameter} mglVar @code{std::wstring} s
-Data name
-@end deftypecv
-@deftypecv {Parameter} mglVar @code{void *} o
-Pointer to external object for function @var{func}.
-@end deftypecv
-@deftypecv {Parameter} mglVar @code{mglVar *} next
-Pointer to next instance in list
-@end deftypecv
-@deftypecv {Parameter} mglVar @code{mglVar *} prev
-Pointer to prev instance in list
-@end deftypecv
-@deftypecv {Parameter} mglVar @code{bool} temp
-Flag for temporar variable. Temporal variables will be destroyed after script execution.
-@end deftypecv
-@deftypecv {Parameter} mglVar @code{void (*} func @code{)(void *)}
-Callback function for destroying non-temporal variable.
-@end deftypecv
-
-@deftypemethod mglVar @code{void} MoveAfter (@code{mglVar *}var)
-Move variable after @var{var} and copy @code{func} from @code{var} (if @code{func} is not 0)
-@end deftypemethod
-
-
-@c ------------------------------------------------------------------
-@node mglCommand class, mglArg class, mglVar class, Other classes
-@section mglCommand class
-@cindex mglCommand
-
-Structure describes MGL command, its name, short description, executable and export functions. The structure is used by @code{mglParse} and is defined in @code{#include <mgl/parser.h>}. This class is accessible only from C++ (and only from GNU compilers in default binary files).
-
-@deftypecv {Parameter} mglCommand @code{const wchar_t *} name
-Name of command.
-@end deftypecv
-@deftypecv {Parameter} mglCommand @code{const wchar_t *} desc
-Short command description (can be NULL).
-@end deftypecv
-@deftypecv {Parameter} mglCommand @code{const wchar_t *} form
-Format of command arguments (can be NULL).
-@end deftypecv
-@deftypecv {Parameter} mglCommand @code{int (*} exec @code{)(mglGraph *gr, long n, mglArg *a, int k[10])const wchar_t *}
-Function for executing (plotting) the command using grapher @var{gr} and having @var{n}-th arguments @var{a}. Function must return 0 if all is OK; or 1 if arguments are wrong.
-@end deftypecv
-@deftypecv {Parameter} mglCommand @code{void (*} save @code{)(wchar_t out[1024], long n, mglArg *a, int k[10])const wchar_t *}
-Function for exporting in C++ (can be NULL).
-@end deftypecv
-
-
-@c ------------------------------------------------------------------
-@node mglArg class, , mglCommand class, Other classes
-@section mglArg class
-@cindex mglArg
-
-Structure describes arguments of functions in the stucture @code{mglCommand}. It is defined in @code{#include <mgl/parser.h>}. This class is accessible only from C++ (and only from GNU compilers in default binary files).
-
-@deftypecv {Parameter} mglArg @code{int} type
-Type of argument: 0-data, 1-string, 2-number.
-@end deftypecv
-@deftypecv {Parameter} mglArg @code{mglData *} d
-Pointer to data (used if type=0).
-@end deftypecv
-@deftypecv {Parameter} mglArg @code{std::wstring} w
-String with parameters (used if type=1 or if type=0 as variable name).
-@end deftypecv
-@deftypecv {Parameter} mglArg @code{std::string} s
-String with parameters (used if type=1).
-@end deftypecv
-@deftypecv {Parameter} mglArg @code{float} v
-Numerical value (used if type==2)
-@end deftypecv
-
* mglGraph class is single plotter class instead of mglGraphZB, mglGraphPS and so on.
* Text style and text color positions are swapped. I.e. text style @samp{r:C} give red centered text, but not roman dark cyan text as for v.1.*.
-
+* ColumnPlot() indexing is reverted.
@c ------------------------------------------------------------------
@node Utilities, Thanks, Changes from v.1, Overview
MathGL library supports the simplest scripts for data handling and plotting. These scripts can be used independently (with the help of UDAV, mglconv, mglview programs and others, @pxref{Utilities}) or in the frame of the library using.
+@ifclear UDAV
@menu
* MGL definition::
* Program flow commands::
* mglParse class::
@end menu
+@end ifclear
+
+@ifset UDAV
+@menu
+* MGL definition::
+* Program flow commands::
+@end menu
+@end ifset
@c ------------------------------------------------------------------
@node MGL definition, Program flow commands, , MGL scripts
@section MGL definition
-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 sufficient, i.e. variables @var{a} and @var{A} are different variables. Symbol @samp{#} starts the comment (all characters after # will be ignored). The exception is situation when @samp{#} is a part of some string. Also options can be specified after symbol @samp{;} (@pxref{Command options}). Symbol @samp{:} starts new command (like new line character) if it is not placed inside a string or inside brackets.
+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 important, i.e. variables @var{a} and @var{A} are different variables. Symbol @samp{#} starts the comment (all characters after # will be ignored). The exception is situation when @samp{#} is a part of some string. Also options can be specified after symbol @samp{;} (@pxref{Command options}). Symbol @samp{:} starts new command (like new line character) if it is not placed inside a string or inside brackets.
If string contain references to external parameters (substrings @samp{$0}, @samp{$1} ... @samp{$9}) or definitions (substrings @samp{$a}, @samp{$b} ... @samp{$z}) then before execution the values of parameter/definition will be substituted instead 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.
+Argument can be a string, a variable (data arrays) or a number (scalars).
@itemize @bullet
@item
-The string is any symbols between ordinary marks @samp{'}.
+The string is any symbols between ordinary marks @samp{'}. Long strings can be concatenated from several lines by @samp{\} symbol. I.e. the string @samp{'a +'\<br>' b'} will give string @samp{'a + b'} (here @samp{<br>} is newline).
@item
Usually variable have a name which is arbitrary combination of symbols (except spaces and @samp{'}) started from a letter and with length less than 64. A temporary array can be used as variable:
@end itemize
Before the first using all variables must be defined with the help of commands, like, @ref{new}, @ref{var}, @ref{list}, @ref{copy}, @ref{read}, @ref{hist}, @ref{sum} and so on (see sections @ref{Data constructor}, @ref{Data filling} and @ref{Make another data}).
-Command may have several set of possible arguments (for example, @code{plot ydat} and @code{plot xdat ydat}). All command arguments for a selected set must be specified. However, some arguments can have default values. These argument are printed in [], like @code{plot ydat ['stl'='' zval=nan]}. At this, the record @code{[arg1 arg2 arg3 ...]} means @code{[arg1 [arg2 [arg3 ...]]]}, i.e. you can omit only tailing arguments if you agree with its default values. For example, @code{plot ydat '' 1} or @code{plot ydat ''} is correct, but @code{plot ydat 1} is incorrect (argument @code{'stl'} is missed).
+Command may have several set of possible arguments (for example, @code{plot ydat} and @code{plot xdat ydat}). All command arguments for a selected set must be specified. However, some arguments can have default values. These argument are printed in [], like @code{text ydat ['stl'='']} or @code{text x y 'txt' ['fnt'='' size=-1]}. At this, the record @code{[arg1 arg2 arg3 ...]} means @code{[arg1 [arg2 [arg3 ...]]]}, i.e. you can omit only tailing arguments if you agree with its default values. For example, @code{text x y 'txt' '' 1} or @code{text x y 'txt' ''} is correct, but @code{text x y 'txt' 1} is incorrect (argument @code{'fnt'} is missed).
@c ------------------------------------------------------------------
@node Program flow commands, MGL definition, MGL scripts
@section Program flow commands
-Below I show commands to control program flow, like, conditions, cycles, define script arguments and so on. Other commands can be found in chapters @ref{MathGL core} and @ref{Data processing}.
+Below I show commands to control program flow, like, conditions, loops, define script arguments and so on. Other commands can be found in chapters @ref{MathGL core} and @ref{Data processing}.
@cindex chdir
@anchor{chdir}
Changes the current directory to @var{path}.
@end deftypefn
+@cindex ask
+@anchor{ask}
+@deftypefn {MGL command} {} ask $N 'question'
+Sets @var{N}-th script argument to answer which give the user on the @var{question}. Usually this show dialog with question where user can enter some text as answer. Here @var{N} is digit (0...9) or alpha (a...z).
+@end deftypefn
+
@cindex define
@anchor{define}
@deftypefn {MGL command} {} define $N smth
Terminate execution.
@end deftypefn
+@ifclear UDAV
@c ------------------------------------------------------------------
@node mglParse class, , Program flow commands, MGL scripts
@section mglParse class
Class for parsing and executing MGL script. This class is defined in @code{#include <mgl/mgl.h>}.
-Class mglParse is the interpreter for MGL scripts (@pxref{MGL interface}). The main function of mglParse class is @code{Parse()}. Exactly this function parses and executes the script string-by-string. Also there are two subservient functions for the finding and creation of a variable. These functions can be useful for displaying values of variables (arrays) in some external program (in window, for example). The variable @var{DataList} contains full list of variables in script. Flag @var{AllowSetSize} allows one to prevent changing the size of the picture inside the script (forbids the MGL command @code{setsize}).
+Class mglParse is the interpreter for MGL scripts. The main function of mglParse class is @code{Execute()}. Exactly this function parses and executes the script string-by-string. Also there are subservient functions for the finding and creation of a variable. These functions can be useful for displaying values of variables (arrays) in some external program (in window, for example). Function @code{AllowSetSize()} allows one to prevent changing the size of the picture inside the script (forbids the MGL command @code{setsize}).
@c Note an important feature -- if user defines function @var{func} in variable then it will be called before the destroying of this variable (@pxref{mglVar class}).
@deftypefn {Constructor on @code{mglParse}} @code{} mglParse (@code{bool} setsize=@code{false})
+@deftypefnx {Constructor on @code{mglParse}} @code{} mglParse (@code{HMPR} pr)
+@deftypefnx {Constructor on @code{mglParse}} @code{} mglParse (@code{mglParse &}pr)
@deftypefnx {C function} @code{HMPR} mgl_create_parser ()
Constructor initializes all values with zero and set @var{AllowSetSize} value.
@end deftypefn
Destructor delete parser
@end deftypefn
-@deftypefn {Method on @code{mglParse}} @code{int} Parse (@code{mglGraph *}gr, @code{const char *}str, @code{long} pos=@code{0})
-@deftypefnx {Method on @code{mglParse}} @code{int} Parse (@code{mglGraph *}gr, @code{const wchar_t *}str, @code{long} pos=@code{0})
-@deftypefnx {C function} @code{int} mgl_parse (@code{HMGL} gr, @code{HMPR} p, @code{const char *}str, @code{int} pos)
-@deftypefnx {C function} @code{int} mgl_parsew (@code{HMGL} gr, @code{HMPR} p, @code{const wchar_t *}str, @code{int} pos)
-Main function in the class. It parses the string @var{str} and executes it by using @var{gr} as a graphics plotter. Returns the value depending on an error presence in the string @var{str}: 0 -- no error, 1 -- wrong command argument(s), 2 -- unknown command, 3 -- string is too long. Optional argument @var{pos} allows to save the string position in the document (or file) for using @code{for|next} command.
+@deftypefn {Method on @code{mglParse}} @code{HMPR} Self ()
+Returns the pointer to internal object of type @code{HMPR}.
+@end deftypefn
+
+@deftypefn {Method on @code{mglParse}} @code{void} Execute (@code{mglGraph *}gr, @code{const char *}text)
+@deftypefnx{Method on @code{mglParse}} @code{void} Execute (@code{mglGraph *}gr, @code{const wchar_t *}text)
+@deftypefnx {C function} @code{void} mgl_parse_text (@code{HMGL} gr, @code{HMPR} p, @code{const char *}text)
+@deftypefnx {C function} @code{void} mgl_parsew_text (@code{HMGL} gr, @code{HMPR} p, @code{const wchar_t *}text)
+Main function in the class. Function parse and execute line-by-line MGL script in array @var{text}. Lines are separated by newline symbol @samp{\n} as usual.
@end deftypefn
@deftypefn {Method on @code{mglParse}} @code{void} Execute (@code{mglGraph *}gr, @code{FILE *}fp, @code{bool} print=@code{false})
-@deftypefnx {C function} @code{int} mgl_parsew (@code{HMGL} gr, @code{HMPR} p, @code{FILE *}fp, @code{int} print)
-Function parse and execute line-by-line MGL script in file @var{fp}. If @var{print}=@code{true} then all warnings and information will be printed in stdout.
+@deftypefnx {C function} @code{int} mgl_parse_file (@code{HMGL} gr, @code{HMPR} p, @code{FILE *}fp, @code{int} print)
+The same as previous but read script from the file @var{fp}. If @var{print}=@code{true} then all warnings and information will be printed in stdout.
@end deftypefn
-@deftypefn {Method on @code{mglParse}} @code{void} Execute (@code{mglGraph *}gr, @code{const char *}text, @code{void (*} error @code{)(int line, int kind, char *mes)=NULL})
-@deftypefnx{Method on @code{mglParse}} @code{void} Execute (@code{mglGraph *}gr, @code{const wchar_t *}text, @code{void (*} error @code{)(int line, int kind, char *mes)=NULL})
-@deftypefnx {C function} @code{void} mgl_parse_text (@code{HMGL} gr, @code{HMPR} p, @code{const char *}text, @code{void (*} error @code{)(int line, int kind, char *mes)})
-@deftypefnx {C function} @code{void} mgl_parsew_text (@code{HMGL} gr, @code{HMPR} p, @code{const wchar_t *}text, @code{void (*} error @code{)(int line, int kind, char *mes)})
-Function parse and execute line-by-line MGL script in array @var{text}. Lines are separated by newline symbol @samp{\n} as usual. If @var{error} is not @code{NULL} then this function will be called for all warnings, information and other messages.
+@deftypefn {Method on @code{mglParse}} @code{int} Parse (@code{mglGraph *}gr, @code{const char *}str, @code{long} pos=@code{0})
+@deftypefnx {Method on @code{mglParse}} @code{int} Parse (@code{mglGraph *}gr, @code{const wchar_t *}str, @code{long} pos=@code{0})
+@deftypefnx {C function} @code{int} mgl_parse (@code{HMGL} gr, @code{HMPR} p, @code{const char *}str, @code{int} pos)
+@deftypefnx {C function} @code{int} mgl_parsew (@code{HMGL} gr, @code{HMPR} p, @code{const wchar_t *}str, @code{int} pos)
+Function parses the string @var{str} and executes it by using @var{gr} as a graphics plotter. Returns the value depending on an error presence in the string @var{str}: 0 -- no error, 1 -- wrong command argument(s), 2 -- unknown command, 3 -- string is too long. Optional argument @var{pos} allows to save the string position in the document (or file) for using @code{for|next} command.
@end deftypefn
-@deftypefn {Method on @code{mglParse}} @code{bool} AddParam (@code{int} n, @code{const char *}str, @code{bool} isstr=@code{true})
-@deftypefnx {Method on @code{mglParse} (C++)} @code{bool} AddParam (@code{int} n, @code{const wchar_t *}str, @code{bool} isstr=@code{true})
+
+@deftypefn {Method on @code{mglParse}} @code{void} AddParam (@code{int} n, @code{const char *}str)
+@deftypefnx {Method on @code{mglParse}} @code{void} AddParam (@code{int} n, @code{const wchar_t *}str)
@deftypefnx {C function} @code{void} mgl_add_param (@code{HMPR} p, @code{int} id, @code{const char *}val)
@deftypefnx {C function} @code{void} mgl_add_paramw (@code{HMPR} p, @code{int} id, @code{const wchar_t *}val)
-Function set the value of @var{n}-th parameter as string @var{str} (@var{n}=0, 1 ... 9). It return @code{true} for success.
+Function set the value of @var{n}-th parameter as string @var{str} (@var{n}=0, 1 ... 'z'-'a'+10). String @var{str} shouldn't contain @samp{$} symbol.
@end deftypefn
@deftypefn {Method on @code{mglParse}} @code{mglData *} FindVar (@code{const char *}name)
@end deftypefn
-@deftypefn {Method on @code{mglParse}} @code{void} Stop ()
-@deftypefnx {C function} @code{void} mgl_parser_stop (@code{HMPR} p)
-Sends stop signal which terminate execution at next command.
+@deftypefn {Method on @code{mglParse}} @code{int} CmdType (@code{const char *}name)
+@deftypefnx {C function} @code{int} mgl_cmd_type (@code{HMPR} p, @code{const char *}name)
+Return the type of MGL command @var{name}. Type of commands are: 0 -- not the command, 1 - data plot, 2 - other plot, 3 - setup, 4 - data handle, 5 - create data, 6 - define subplot, 7 - program flow.
+@end deftypefn
+
+@deftypefn {Method on @code{mglParse}} @code{const char *} CmdFormat (@code{const char *}name)
+@deftypefnx {C function} @code{const char *} mgl_cmd_frmt (@code{HMPR} p, @code{const char *}name)
+Return the format of arguments for MGL command @var{name}.
@end deftypefn
+
+@deftypefn {Method on @code{mglParse}} @code{const char *} CmdDesc (@code{const char *}name)
+@deftypefnx {C function} @code{const char *} mgl_cmd_desc (@code{HMPR} p, @code{const char *}name)
+Return the description of MGL command @var{name}.
+@end deftypefn
+
+@end ifclear
@cindex window
@cindex widgets
-There are set of ``window'' classes for making a window with MathGL graphics: @code{mglCavasW} and derived for developers, @code{mglWindow} and @code{mglGLUT} for user-level, @code{Fl_MathGL} and @code{QMathGL} as widgets. All these classes allow user to show, rotate, export, and change view of the plot using keyboard. Most of them (except @code{mglGLUT}) also have toolbar and menu for simplifying plot manipulation. All window classes have mostly the same set of functions.
+There are set of ``window'' classes for making a window with MathGL graphics: @code{mglWindow} and @code{mglGLUT} for whole window, @code{Fl_MathGL} and @code{QMathGL} as widgets. All these classes allow user to show, rotate, export, and change view of the plot using keyboard. Most of them (except @code{mglGLUT}) also have toolbar and menu for simplifying plot manipulation. All window classes have mostly the same set of functions.
-For callback drawing you can use: @code{NULL} pointer if you'll update plot manually, global function of type @code{int draw(@code{HMGL} gr, @code{void *}p)} or @code{int draw(@code{mglGraph *}gr)}, or instance of class derived from @code{mglDraw} class. This class is defined in @code{#include <mgl/define.h>} and have only 2 methods:
+For callback drawing you can use: @code{NULL} pointer if you'll update plot manually, global function of type @code{int draw(@code{HMGL} gr, @code{void *}p)} or @code{int draw(@code{mglGraph *}gr)}, or instance of class derived from @code{mglDraw} class. This class is defined in @code{#include <mgl/window.h>} and have only 2 methods:
@verbatim
class mglDraw
{
virtual void Reload() {};
};
@end verbatim
-You should inherit yours class from @code{mglDraw} and reimplement one or both functions for drawing.
+You should inherit yours class from @code{mglDraw} and re-implement one or both functions for drawing.
@menu
* mglWindow class::
@cindex window
@c @cindex mglDraw
-This class is derived from mglGraph class (@pxref{MathGL core}). It provide many methods for handling window with MathGL graphics.
+This class is derived from mglGraph class (@pxref{MathGL core}). It provide methods for handling window with MathGL graphics.
@deftypefn {Constructor on @code{mglWindow}} {} mglWindow (@code{int} kind=@code{0}, @code{int} (*draw)(@code{HMGL} gr, @code{void *}p)=@code{NULL}, @code{const char *}title=@code{"MathGL"}, @code{void *}par=@code{NULL})
@deftypefnx {Constructor on @code{mglWindow}} {} mglWindow (@code{int} kind=@code{0}, @code{int} (*draw)(@code{mglGraph *}gr), @code{const char *}title=@code{"MathGL"})
Creates a window for plotting. Parameter @var{draw} sets a pointer to drawing function (this is the name of function) or instance of @code{mglDraw} class. There is support of a list of plots (frames). So as one can prepare a set of frames at first and redraw it fast later (but it requires more memory). Function should return positive number of frames for the list or zero if it will plot directly. Note, that @var{draw} can be @code{NULL} for displaying static bitmaps only (no animation or slides). Parameter @var{title} sets the title of the window. Parameter @var{par} contains pointer to data for the plotting function @var{draw}. Parameter @var{kind} may have following values: @samp{0} -- use FLTK window, @samp{1} -- use Qt window.
There are some keys handles for manipulating by the plot: 'a', 'd', 'w', 's' for the rotating; ',', '.' for viewing of the previous or next frames in the list; 'r' for the switching of transparency; 'f' for the switching of lightning; 'x' for hiding (closing) the window.
-
-@strong{IMPORTANT!!!} You need to add a call of Rotate() (@pxref{Transformation matrix}) function for having possibility of plot rotation. If plot should be unrotated by default just add @code{Rotate(0,0)} in drawing function.
@end deftypefn
@deftypefn {Method on @code{mglWindow}} @code{void} Run ()
@deftypefnx {C function} @code{int} mgl_wnd_toggle_rotate (@code{HMGL} gr)
Switch on/off rotation by mouse. Usually, left button is used for rotation, middle button for shift, right button for zoom/perspective.
@end deftypefn
+@deftypefn {Method on @code{mglWindow}} @code{void} ToggleZoom ()
+@deftypefnx {C function} @code{int} mgl_wnd_toggle_zoom (@code{HMGL} gr)
+Switch on/off zooming by mouse. Just select rectangular region by mouse and it will be zoomed in.
+@end deftypefn
@deftypefn {Method on @code{mglWindow}} @code{void} ToggleNo ()
@deftypefnx {C function} @code{int} mgl_wnd_toggle_no (@code{HMGL} gr)
Switch off all zooming and rotation and restore initial state.
@end deftypefn
@deftypefn {Method on @code{mglWindow}} @code{void} Update ()
@deftypefnx {C function} @code{int} mgl_wnd_update (@code{HMGL} gr)
-Update window contents.
+Update window contents. This is very useful function for manual updating the plot while long calculation was running in parallel thread.
@end deftypefn
@deftypefn {Method on @code{mglWindow}} @code{void} ReLoad ()
@deftypefnx {C function} @code{int} mgl_wnd_reload (@code{HMGL} gr)
Class is FLTK widget which display MathGL graphics (defined in @code{#include <mgl/fltk.h>}).
@float
-@image{fltk, 7cm}
+@image{../fltk, 7cm}
@caption{Example of FLTK window with MathGL plot.}
@end float
@deftypemethodx Fl_MathGL @code{void} set_draw (@code{mglDraw *}draw)
Sets drawing function as global function as one from a class @code{mglDraw}. There is support of a list of plots (frames). So as one can prepare a set of frames at first and redraw it fast later (but it requires more memory). Function should return positive number of frames for the list or zero if it will plot directly. Parameter @var{par} contains pointer to data for the plotting function @var{draw}.
@end deftypemethod
-@deftypemethod Fl_MathGL @code{void} update (@code{mglGraph *}gr=@code{NULL})
-Update (redraw) plot using grapher @var{gr} (built-in by default).
+@deftypemethod Fl_MathGL @code{void} update ()
+Update (redraw) plot.
@end deftypemethod
@deftypemethod Fl_MathGL @code{void} set_angle (@code{float} t, @code{float} p)
Set angles for additional plot rotation
@deftypemethod Fl_MathGL @code{void} set_flag (@code{int} f)
Set bitwise flags for general state (1-Alpha, 2-Light)
@end deftypemethod
-@deftypemethod Fl_MathGL @code{void} set_state (@code{bool} r)
+@deftypemethod Fl_MathGL @code{void} set_state (@code{bool} r, @code{bool} z)
Set flags for handling mouse:
-@c @var{z}=@code{true} allow zooming,
+@var{z}=@code{true} allow zooming,
@var{r}=@code{true} allow rotation/shifting/perspective and so on.
@end deftypemethod
+@deftypemethod Fl_MathGL @code{void} set_zoom (@code{float} X1, @code{float} Y1, @code{float} X2, @code{float} Y2)
+Set zoom in/out region
+@end deftypemethod
+@deftypemethod Fl_MathGL @code{void} get_zoom (@code{float *}X1, @code{float *}Y1, @code{float *}X2, @code{float *}Y2)
+Get zoom in/out region
+@end deftypemethod
+
@deftypemethod Fl_MathGL @code{void} set_popup (@code{const Fl_Menu_Item *}pmenu, @code{Fl_Widget *}w, @code{void *}v)
Set popup menu pointer
@end deftypemethod
Class is Qt widget which display MathGL graphics (defined in @code{#include <mgl/qt.h>}).
@float
-@image{qt, 7cm}
+@image{../qt, 7cm}
@caption{Example of Qt window with MathGL plot.}
@end float
@deftypemethod QMathGL @code{bool} getLight ()
Get lightning state.
@end deftypemethod
+@deftypemethod QMathGL @code{bool} getZoom ()
+Get mouse zooming state.
+@end deftypemethod
@deftypemethod QMathGL @code{bool} getRotate ()
Get mouse rotation state.
@end deftypemethod
@deftypefn {Slot on @code{QMathGL}} @code{void} refresh ()
Redraw saved bitmap without executing drawing function.
@end deftypefn
-@deftypefn {Slot on @code{QMathGL}} @code{void} update (@code{mglCanvas *}gr=@code{NULL})
+@deftypefn {Slot on @code{QMathGL}} @code{void} update ()
Update picture by executing drawing function.
@end deftypefn
@deftypefn {Slot on @code{QMathGL}} @code{void} copy ()
Copy graphics to clipboard.
@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} copyClickCoor ()
+Copy coordinates of click (as text).
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} print ()
+Print current picture.
+@end deftypefn
+
+@deftypefn {Slot on @code{QMathGL}} @code{void} stop ()
+Send signal to stop drawing.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} adjust ()
+Adjust image size to fit whole widget.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} nextSlide ()
+Show next slide.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} prevSlide ()
+Show previous slide.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} animation (@code{bool} st=@code{true})
+Start/stop animation.
+@end deftypefn
+
@deftypefn {Slot on @code{QMathGL}} @code{void} setPer (@code{int} val)
Set perspective value.
@end deftypefn
@deftypefn {Slot on @code{QMathGL}} @code{void} setLight (@code{bool} val)
Switch on/off lightning.
@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} setGrid (@code{bool} val)
+Switch on/off drawing of grid for absolute coordinates.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} setZoom (@code{bool} val)
+Switch on/off mouse zooming.
+@end deftypefn
@deftypefn {Slot on @code{QMathGL}} @code{void} setRotate (@code{bool} val)
Switch on/off mouse rotation.
@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} zoomIn ()
+Zoom in graphics.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} zoomOut ()
+Zoom out graphics.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} shiftLeft ()
+Shift graphics to left direction.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} shiftRight ()
+Shift graphics to right direction.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void}shiftUp ()
+Shift graphics to up direction.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} shiftDown ()
+Shift graphics to down direction.
+@end deftypefn
@deftypefn {Slot on @code{QMathGL}} @code{void} restore ()
Restore zoom and rotation to default values.
@end deftypefn
@deftypefn {Slot on @code{QMathGL}} @code{void} exportSVG (@code{QString} fname=@code{""})
Export current picture to SVG file.
@end deftypefn
+
+@deftypefn {Slot on @code{QMathGL}} @code{void} exportGIF (@code{QString} fname=@code{""})
+Export current picture to GIF file.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} exportTEX (@code{QString} fname=@code{""})
+Export current picture to LaTeX/Tikz file.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} exportTGA (@code{QString} fname=@code{""})
+Export current picture to TGA file.
+@end deftypefn
+
+@deftypefn {Slot on @code{QMathGL}} @code{void} exportXYZ (@code{QString} fname=@code{""})
+Export current picture to XYZ/XYZL/XYZF file.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} exportOBJ (@code{QString} fname=@code{""})
+Export current picture to OBJ/MTL file.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} exportSTL (@code{QString} fname=@code{""})
+Export current picture to STL file.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} exportOFF (@code{QString} fname=@code{""})
+Export current picture to OFF file.
+@end deftypefn
+@deftypefn {Slot on @code{QMathGL}} @code{void} exportX3D (@code{QString} fname=@code{""})
+Export current picture to X3D file.
+@end deftypefn
+
@deftypefn {Slot on @code{QMathGL}} @code{void} exportIDTF (@code{QString} fname=@code{""})
Export current picture to IDTF file.
@end deftypefn
@deftypefn {Slot on @code{QMathGL}} @code{void} setMGLFont (@code{QString} path)
Restore (@var{path}=@code{""}) or load font for graphics.
@end deftypefn
-@deftypefn {Slot on @code{QMathGL}} @code{void} print ()
-Print current picture
-@end deftypefn
+
@deftypefn {Slot on @code{QMathGL}} @code{void} about ()
Show about information.
@end deftypefn
@deftypefn {Signal on @code{QMathGL}} @code{void} lightChanged (@code{bool} val)
Lighting changed (by toolbar).
@end deftypefn
+@deftypefn {Signal on @code{QMathGL}} @code{void} gridChanged (@code{bool} val)
+Grid drawing changed (by toolbar).
+@end deftypefn
+@deftypefn {Signal on @code{QMathGL}} @code{void} zoomChanged (@code{bool} val)
+Zooming changed (by toolbar).
+@end deftypefn
@deftypefn {Signal on @code{QMathGL}} @code{void} rotateChanged (@code{bool} val)
Rotation changed (by toolbar).
@end deftypefn
+@deftypefn {Signal on @code{QMathGL}} @code{void} mouseClick (@code{float} x, @code{float} y, @code{float} z)
+Mouse click take place at position @{x,y,z@}.
+@end deftypefn
+@deftypefn {Signal on @code{QMathGL}} @code{void} frameChanged (@code{int} val)
+Need another frame to show.
+@end deftypefn
+@deftypefn {Signal on @code{QMathGL}} @code{void} showWarn (@code{QString} warn)
+Need to show warning.
+@end deftypefn
+@deftypefn {Signal on @code{QMathGL}} @code{void} posChanged (@code{QString} pos)
+Position of mouse click is changed.
+@end deftypefn
+@deftypefn {Signal on @code{QMathGL}} @code{void} objChanged (@code{int} id)
+Object id is changed (due to mouse click).
+@end deftypefn
+@deftypefn {Signal on @code{QMathGL}} @code{void} refreshData ()
+Data can be changed (drawing is finished).
+@end deftypefn
+
+
@deftypecv {QMathGL option} QMathGL @code{QString} appName
Application name for message boxes.
@end deftypecv
Allow auto resizing (default is false).
@end deftypecv
-
3. Check export to MGLD/TeX/OBJ/XGL/X3D/STL.
4. add XInitThreads() from #include <X11/Xlib.h> into all GUI
5. Check MGLD in mglview
+6. check Hankel()
============= NEW =============
6. Add help about cmake and GIF/JPEG to the "Installation and using"
7. On which things the subplot influence
8. About unrotated text
+9. Add mglBase, mglCanvas in other_en.texi + small comments about developing new plots.
10. New samples + update old ones
11. Parallelization:
- * user level -- SetDrawReg(), PutDrawReg() -- remove!?!
* MPI level -- Combine()
* MathGL level -- pthread in mglData, ???
12. Boxs() styles: '#' for wire, '@' for full box.
-13. mglData::SetVal(), GetVal()
-14. Add mgl_label_xyz(), mgl_label_xy(), mgl_label_y(). Possible numbers are: "%x" for x-coor, "%y" for y-coor, "%z" for z-coor.
+13. Add mgl_label_xyz(), mgl_label_xy(), mgl_label_y(). Possible numbers are: "%x" for x-coor, "%y" for y-coor, "%z" for z-coor.
15. Check mglData::Insert(): now copy values from original array (x[i] -> x[2*i], x[2*i+1], ...)
16. Symbol '!' denote sharp colors even in 1d plots (like different colors for points)
17. Check export to LaTeX.
18. mglview can preview MGLD files too -- check it
19. Handle mglBase::Stop everywhere
20. Number of frames can be changed at reload + manual call of draw_func if number of frames is 0.
-21. Symbol '\' at the end continue string in MGL script
-22. Add mgl_data_sort(HMDT dat, long idx); -- sort rows of x-y table (or slices of 3D data) by value of idx-column (and idy-row for nz>1). Not thread safe!!!
23. Add mgl_tape_*(), Tape() -- draw tapes which rotate as (bi)normale of curve. Width by value or depend on BarWidth
24. Flow() and FlowP() draw tape of (bi)normales if character 'x' and/or 'z' is specified.
-25. Add MGL command "ask $N 'question'" -- like interactive "define". User (UDAV) must set mgl_ask_func to some non-zero value
-26. Cones() -- like Bars() but by Cone(). Support 'a' for above.
+25. Cones() -- like Bars() but by Cone(). Support 'a' for above.
27. Add Class diagram for MathGL core
-28. Add mglBase, mglCanvas in other_en.texi + small comments about developing new plots.
============= BUGS =============
4.17 Data manipulation
? 4.18 IDTF
- 5. Widget classes
- 5.1 mglWindow class
- 5.2 Fl_MathGL class
- 5.3 QMathGL class
-
- 6. Data processing
- 6.1 Public variables
- 6.2 Data constructor
- 6.3 Data resizing
- 6.4 Data filling
- 6.5 File I/O
- 6.6 Make another data
- 6.7 Data changing
- 6.8 Interpolation
- 6.9 Data information
- 6.10 Operators
- 6.11 Global functions
-
- 7. MGL scripts
- 7.1 MGL definition
- 7.2 Program flow commands
- 7.3 mglParse class
++ 5. Widget classes
++ 5.1 mglWindow class
++ 5.2 Fl_MathGL class
++ 5.3 QMathGL class
+
++ 6. Data processing
++ 6.1 Public variables
++ 6.2 Data constructor
++ 6.3 Data resizing
++ 6.4 Data filling
++ 6.5 File I/O
++ 6.6 Make another data
++ 6.7 Data changing
++ 6.8 Interpolation
++ 6.9 Data information
++ 6.10 Operators
++ 6.11 Global functions
+
++ 7. MGL scripts
++ 7.1 MGL definition
++ 7.2 Program flow commands
++ 7.3 mglParse class
8. Other classes (c++ only)
8.1 mglBase class
8.2 mglDataA class
8.3 mglCanvas class
- 8.4 mglFormula class
- 8.5 mglColor class
- 8.6 mglPoint class
- 8.7 mglFont class (format)
++ 8.4 mglFormula class
++ 8.5 mglColor class
++ 8.6 mglPoint class
++ 8.7 mglFont class (format)
}
int mgl_fltk_run() { return Fl::run(); }
//-----------------------------------------------------------------------------
-uintptr_t mgl_create_graph_fltk_(const char *title, int l)
-{
- char *s = new char[l+1]; memcpy(s,title,l); s[l]=0;
- uintptr_t t = uintptr_t(mgl_create_graph_fltk(0,s,0));
- delete []s; return t;
-}
-int mgl_fltk_run_() { return mgl_fltk_run(); }
-//-----------------------------------------------------------------------------
void *mgl_fl_tmp(void *) { Fl::run(); return 0; }
/*void mgl_fltk_thread()
* {
}
int mgl_qt_run() { return (qApp)?qApp->exec():-1; }
//-----------------------------------------------------------------------------
-uintptr_t mgl_create_graph_qt_(const char *title, int l)
-{
- char *s = new char[l+1]; memcpy(s,title,l); s[l]=0;
- uintptr_t t = uintptr_t(mgl_create_graph_qt(0,s,0));
- delete []s; return t;
-}
-int mgl_qt_run_() { return mgl_qt_run(); }
-//-----------------------------------------------------------------------------
void *mgl_qt_tmp(void *) { mgl_qt_run(); return 0; }
/*void mgl_qt_thread()
* {
#ifndef HAVE_FLTK\r
HMGL mgl_create_graph_fltk(int (*)(HMGL gr, void *p), const char *, void *)\r
{ return NULL; }\r
-void mgl_fltk_run(){}\r
+int mgl_fltk_run(){return 0;}\r
+#endif\r
//-----------------------------------------------------------------------------\r
uintptr_t mgl_create_graph_fltk_(const char *title, int l)\r
{\r
uintptr_t t = uintptr_t(mgl_create_graph_fltk(0,s,0));\r
delete []s; return t;\r
}\r
-void mgl_fltk_run_() { mgl_fltk_run(); }\r
-#endif\r
+int mgl_fltk_run_() { return mgl_fltk_run(); }\r
//-----------------------------------------------------------------------------\r
#ifndef HAVE_QT\r
HMGL mgl_create_graph_qt(int (*)(HMGL gr, void *p), const char *, void *)\r
{ return NULL; }\r
-void mgl_qt_run(){}\r
+int mgl_qt_run(){return 0;}\r
+#endif\r
//-----------------------------------------------------------------------------\r
uintptr_t mgl_create_graph_qt_(const char *title, int l)\r
{\r
uintptr_t t = uintptr_t(mgl_create_graph_qt(0,s,0));\r
delete []s; return t;\r
}\r
-void mgl_qt_run_() { mgl_qt_run(); }\r
-#endif\r
+int mgl_qt_run_() { return mgl_qt_run(); }\r
//-----------------------------------------------------------------------------\r
int mgl_draw_class(mglBase *gr, void *p)\r
{ mglGraph g(gr); return p ? ((mglDraw *)p)->Draw(&g) : 0; }\r
}\r
//-----------------------------------------------------------------------------\r
void *mgl_draw_calc(void *p)\r
-{ ((mglDraw *)p)->Calc(); }\r
+{\r
+#ifdef HAVE_PTHREAD\r
+ ((mglDraw *)p)->Calc();\r
+#endif\r
+}\r
//-----------------------------------------------------------------------------\r
void mgl_draw_thr(void *p)\r
{\r