if((enable-langall OR enable-python) AND (NOT enable-lgpl) )
set(MGL_HAVE_PYTHON 1)
-# include(FindPythonInterp)
-# if(NOT PYTHONLIBS_FOUND)
-# if(use_python)
-# message(SEND_ERROR "Couldn't find python interpreter.")
-# endif(use_python)
-# endif(NOT PYTHONINTERP_FOUND)
+ FIND_PACKAGE(PythonInterp)
+ if(NOT PYTHONINTERP_FOUND)
+ message(SEND_ERROR "Couldn't find python interpreter.")
+ endif(NOT PYTHONINTERP_FOUND)
FIND_PACKAGE(PythonLibs)
if(NOT PYTHONLIBS_FOUND)
message(SEND_ERROR "Couldn't find python development libraries.")
+++ /dev/null
-2.0.b Released 23 August 2011
-
-1.11.2 Released 30 May 2011
-1.11.1 Released 28 March 2011
-1.11 Released 8 November 2010
-1.10.2.1 Released 27 March 2010
-1.10.2 Released 22 March 2010
-1.10.1 Released 8 March 2010
-1.10 Released 28 December 2009
-1.9 Released 8 July 2009
-1.8.1 Released 4 March 2009
-1.8 Released 27 November 2008
-1.7 Released 5 June 2008
-1.6.2 Released 5 April 2008
-1.6.1 Released 2 April 2008
-1.6 Released 17 March 2008
-1.5 Released 11 January 2008
-1.4.3.1 Released 24 December 2008
-1.4.3 Released 18 December 2008
-1.4.2 Released 27 November 2007
-1.4.1 Released 14 November 2007
-1.4 Released 30 October 2007
-1.3 Released 15 October 2007
-1.2.2 Released 26 September 2007
-1.2.1 Released 14 September 2007
-1.2 Released 10 September 2007
-1.1 Released 23 May 2007
-1.0 Released 2 April 2007
-0.9 Last beta version of the MathGL library. Released 2 March 2007
-0.8.1 Released 19 Febriary 2007
-0.8.0 First public release (24 January 2007)
+++ /dev/null
- MathGL for v.2.0
-
-
-1. Colorbar: print more digits for manual arrays ... but avoid overlapping ???
-2. Miss MAJOR labels or decrease its fontsize if labels too close.
- Also check that enough digits is printed to distingush the labels
- Also allow "time"-labels -- like "%d/%m/%Y %H:%M:%S"
- Also allow rotate labels if they too dense
-3. Legend in OpenGL mode
-4. Add plot Circle() as Error() but with marks instead of error boxes (default 'o') + alpha-transpared if filled
-5. Export to LaTeX formats - (pgf/tikz) or metapost if possible (like EPS).
-6. Use '~' for old style textual arguments!!!
-7. Pipes in mgl2png, mgl2eps, ... (stdin, stdout)
-8. Multithreading
-9. Number of proc from get_nprocs_conf() (#include <sys/sysinfo.h>)
-10.Arbitrary line/curve coordinates if z=nan
-11.Add apperture for light (partially is done)
-12.Add diffusive light (no dependence of normale but have direction)
-13. утилиты (mgl2png и пр.) вылетают, если в коментариях русские буквы
-14. Last ' isn't send as call argument!!!
-15. MGL docs -- text what formulas are applicable for scalars too.
-16. Manual labels in string with '\n' separator
-17. Venn() diagram-like -- transparent circles with manual colors and sizes -- may be a variant of Mark()???
-
-11. Update STIX fonts (new release) + create PWT fonts
-12. Problem with \calB and so on (\calH, ...) -- they are present only in italic font :(.
-
-21. INCOMPATIBLE CHANGES!!! swap color and font style in text option ('bR:r' -> 'r:bR')
-22. INCOMPATIBLE CHANGES!!! hide 'dir' argument as ':[xyz]' for cont3, dens3, contf3, grid3 + remove conta, densa, grida, contfa
-23. INCOMPATIBLE!!! Allow slice definition as real: sl<1 ? sl=int(n*sl) : int(sl);
-24. INCOMPATIBLE CHANGES!!! tune colors as {} -- for example, 'b{3}'
-25. INCOMPATIBLE CHANGES!!! hide unused arguments (like "size")
-26. Quaternary diagrams plotted in a tetrahedron: equivalent to ternary diagrams, but in 3D.
-27. Export to X3D
-28. Save glyph then it is used for mglGraphPS -- allow different font family in EPS|SVG ??!
-29. Multithreading by "subplots" -- for parser first of all !!!
-
-30. Sample about pthread using.
-31. Add help about cmake and GIF/JPEG to the "Installation and using"
-32. Regroup pictures in WWW by big classes + combo plots
-
-=========================
- Later
-
-1. Plot for isolines of vector fields ???
-2. Named arguments in MGL ???
-3. \dfrac for normal size and centering (sample \big\big{\frac{1}{2}}) ???
-4. "Chaos" in area.png (near axis) ???
-5. save data coordinates in picture??? -- NO -- slow + a lot of memory!
-6. "Cut off" curves if text is printed along it (for contour labels) ?!?
-7. Allow interpolation in MGL if argument is not integer ???
-8. Check if widget functions can be added to mgl_w.h !?! -- use #define ??!
-9. Add '[' as separator in string ???
-10. Save id of subplots and axis for getting value of click coordinates arbitrary inplot -- fill only part which is overlapped. Clear it at Clf() + update for any Rotate, Aspect, InPlot, SetRanges,
-11. Surface by interpolation for arbitrary points {x,y,z} -- seems to be too complicated :(
-12. Rename 'stl'->'style', 'sch'->'scheme' in MGL docs ???
-13. Add option ':[xyzd]' in color scheme for coloring along coordinate (default 'z') ?!?
-14. Save ALL plot styles for each curve (0...N) for each subplot (0...M) in format \leg{N_M} ?!?
-15. Add TeX command \leg{plot style} for line+mark of specified style.
-16. Import/Export via GIF (as 3d data) ??? + 16bit PNG ?!!
-17. Contour label should not rotated on ~180 degree ?!
-18. The same function for ticks of axis and colorbar ???
-13. Add "colorbar x y ['sch'='' w=1 h=1]" + "colorbar x y dat ['sch'='' w=1 h=1]" -- NO because need w,h !
-
-
- MathGL (for v.2.?) ???
-
-1. GTK window ???
-11. Use Hershey as built-in font ???
-
- FAQ
-
-1. On which things the subplot influence
-2. About unrotated text
-3. Add "Howto" section in web site.
-
- Web
-
-1. "Data plotting", "Data plot", "Scientific visualtization", "Surface", "Cloud",
- "Plot", "statistical graphics"
-2. Examples of animation
-3. Example of inverted axis, minus-log axis
-if(use_gsl)
-# target_link_libraries(mgl ${GSL_LIB} ${GSL_CBLAS_LIB} )
- add_definitions(-DHAVE_GSL)
+if(MGL_HAVE_GSL)
include_directories(${GSL_INCLUDE_DIR})
-else(use_gsl)
- add_definitions(-DNO_GSL)
-endif(use_gsl)
+endif(MGL_HAVE_GSL)
add_executable(mgl_example wnd_samples.cpp full_test.cpp)
target_link_libraries(mgl_example mgl)
RUNTIME DESTINATION bin
)
-if(use_fltk)
+if(MGL_HAVE_FLTK)
add_executable(mgl_fltk_example wnd_samples.cpp fltk_example.cpp)
target_link_libraries(mgl_fltk_example mgl-wnd)
install(
TARGETS mgl_fltk_example
RUNTIME DESTINATION bin
)
-endif(use_fltk)
+endif(MGL_HAVE_FLTK)
-if(use_glut)
+if(MGL_HAVE_GLUT)
add_executable(mgl_glut_example wnd_samples.cpp glut_example.cpp)
target_link_libraries(mgl_glut_example mgl-glut)
install(
TARGETS mgl_glut_example
RUNTIME DESTINATION bin
)
-endif(use_glut)
+endif(MGL_HAVE_GLUT)
-if(use_wx)
+if(MGL_HAVE_WX)
include(${wxWidgets_USE_FILE})
add_executable(mgl_wx_example wnd_samples.cpp wx_example.cpp)
target_link_libraries(mgl_wx_example ${wxWidgets_LIBRARIES} mgl-wnd)
TARGETS mgl_wx_example
RUNTIME DESTINATION bin
)
-endif(use_wx)
+endif(MGL_HAVE_WX)
-if(use_qt)
+if(MGL_HAVE_QT)
include(${QT_USE_FILE})
qt_wrap_cpp(mgl_qt_example MGL_MOC_EX_FILES ../include/mgl/qt.h)
add_executable(mgl_qt_example wnd_samples.cpp qt_example.cpp ${MGL_MOC_EX_FILES})
TARGETS mgl_qt_example
RUNTIME DESTINATION bin
)
-endif(use_qt)
+endif(MGL_HAVE_QT)
#include "mgl/mgl.h"\r
#include "mgl/eval.h"\r
//#include <mgl/mgl_idtf.h>\r
-#include "mgl/parser.h"\r
+//#include "mgl/parser.h"\r
//-----------------------------------------------------------------------------\r
void mgls_prepare1d(mglData *y, mglData *y1=0, mglData *y2=0, mglData *x1=0, mglData *x2=0);\r
void mgls_prepare2d(mglData *a, mglData *b=0, mglData *v=0);\r
void save(mglGraph *gr,const char *name,const char *suf);\r
void test(mglGraph *gr)\r
{\r
- int i, n=1000;\r
- mglData x(n),y(n),z(n);\r
- for(i=0;i<n;i++)\r
- {\r
- float t=M_PI*(mgl_rnd()-0.5), f=2*M_PI*mgl_rnd();\r
- x.a[i] = 0.9*cos(t)*cos(f);\r
- y.a[i] = 0.9*cos(t)*sin(f);\r
- z.a[i] = 0.6*sin(t);\r
- }\r
- if(!mini) gr->Title("Dots sample");\r
- gr->Rotate(50,60); gr->Box(); gr->Dots(x,y,z);\r
- return;\r
- \r
mglParse par;\r
par.AllowSetSize(true);\r
- FILE *fp=fopen("/home/balakin/mgl/att/put.mgl","rt");\r
+ setlocale(LC_CTYPE, "");\r
+ FILE *fp=fopen("/home/balakin/progr/sfnet/mathgl/mathgl-2x/examples/test.mgl","r");\r
par.Execute(gr,fp,true);\r
fclose(fp);\r
}\r
gr->Radar(yr,"#");\r
}\r
//-----------------------------------------------------------------------------\r
-const char *mmgl_candle="new y 30 'sin(2*pi*x)^2':copy y1 y/2:copy y2 (y+1)/2\n"\r
+const char *mmgl_candle="new y 30 'sin(pi*x/2)^2':copy y1 y/2:copy y2 (y+1)/2\n"\r
"subplot 1 1 0 '':title 'Candle plot (with grid, \\\'\\#\\\')'\nyrange 0 1:box:candle y y1 y2\n";\r
void smgl_candle(mglGraph *gr)\r
{\r
- mglData y(30); gr->Fill(y,"sin(2*pi*x)^2");\r
+ mglData y(30); gr->Fill(y,"sin(pi*x/2)^2");\r
mglData y1(30); gr->Fill(y1,"v/2",y);\r
mglData y2(30); gr->Fill(y2,"(1+v)/2",y);\r
if(!mini) { gr->SubPlot(1,1,0,""); gr->Title("Candle plot (default)"); }\r
gr->Puts(mglPoint(-0.9, -1.3), "fitted:", "r:L");\r
gr->PutsFit(mglPoint(0, -1.8), "y = ", "r");\r
gr->Puts(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "b");\r
- gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(0,0,0);\r
+// gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(0,0,0);\r
}\r
//-----------------------------------------------------------------------------\r
const char *mmgl_vect="subplot 3 2 0 '':title 'Vect plot (default)':box:vect a b\n"\r
void smgl_cones(mglGraph *gr)\r
{\r
mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");\r
- if(!mini) gr->Title("Cones plot");\r
- gr->Rotate(50,60); gr->Light(true);\r
- gr->SetOrigin(0,0,0); gr->Box(); gr->Cones(ys);\r
+ gr->Light(true); gr->SetOrigin(0,0,0);\r
+ if(!mini) { gr->SubPlot(2,2,0); gr->Title("Cones plot"); }\r
+ gr->Rotate(50,60); gr->Box(); gr->Cones(ys);\r
+ if(mini) return;\r
+ gr->SubPlot(2,2,1); gr->Title("2 colors");\r
+ gr->Rotate(50,60); gr->Box(); gr->Cones(ys,"cbgGyr");\r
+ gr->SubPlot(2,2,2); gr->Title("'#' style");\r
+ gr->Rotate(50,60); gr->Box(); gr->Cones(ys,"#");\r
+ gr->SubPlot(2,2,3); gr->Title("'a' style");\r
+ gr->SetRange('z',-2,2); // increase range since summation can exceed [-1,1]\r
+ gr->Rotate(50,60); gr->Box(); gr->Cones(ys,"a");\r
}\r
//-----------------------------------------------------------------------------\r
const char *mmgl_aspect="subplot 2 2 0:box:text -1 1.1 'Just box' ':L'\ninplot 0.2 0.5 0.7 1:box:text 0 1.2 'InPlot example'\n"\r
+++ /dev/null
--3.3581 2.5732 1.4934
--3.25778 2.29243 1.45965
--3.0802 2.59925 1.42197
--3.60356 2.40362 1.47383
-5.24516 2.4206 1.30072
-5.42469 2.656 1.27697
-5.12897 2.59593 1.5162
-5.08074 2.17454 1.29715
-5.35839 2.30541 1.03706
-0.314234 -1.24668 0.771201
-0.199285 -1.50489 0.79399
-0.483944 -1.39477 0.994998
-0.524797 -1.06853 0.885649
-0.403729 -0.936904 0.66078
-0.153642 -1.20314 0.54891
--2.62536 -1.39779 -0.911055
--2.35472 -1.36992 -1.01849
--2.54319 -1.64629 -0.821542
--2.84156 -1.45618 -0.730945
--2.83523 -1.16641 -0.829628
--2.56462 -1.11861 -0.996259
-2.87418 -1.98581 -0.595092
-2.84061 -1.79479 -0.820509
-3.02393 -1.75897 -0.534522
-2.91054 -2.09024 -0.323686
-2.72903 -2.24064 -0.612428
-2.65841 -2.10037 -0.856363
-6.31265 3.7305 0.24011
-6.18759 3.47647 0.325652
-6.17274 3.70564 -0.0800137
-6.39293 3.9878 0.0618956
-6.43139 3.86463 0.513914
-3.84975 3.4648 -0.925588
-3.59431 3.38247 -0.854213
-3.7798 3.72419 -0.811975
-4.15893 3.53106 -0.98144
-4.04251 3.24415 -1.01833
-3.74788 3.12439 -0.98844
-2.14197 -3.04583 0.410968
-1.84122 -3.14536 0.550241
-2.04639 -3.17918 0.196293
-2.06812 -2.94437 0.670076
--1.70186 0.504321 0.61956
--1.78475 0.777293 0.610411
--1.84891 0.493439 0.83798
--1.62424 0.245735 0.631356
--1.57339 0.417303 0.359742
--1.66868 0.674163 0.369577
--2.57164 1.21584 -0.743756
--2.31566 1.10419 -0.659823
--2.67611 0.983431 -0.816759
--2.79675 1.43868 -0.754294
--2.50683 1.49307 -0.640831
--2.85831 3.80577 0.187588
--3.03589 3.87076 -0.0420329
--3.02189 4.04633 0.275546
--2.86124 3.90599 0.492198
--2.72507 3.64261 0.458894
--2.74828 3.53887 0.158063
--2.43307 -0.105483 -0.964569
--2.47392 0.184546 -0.924879
--2.16794 -0.0213592 -0.912387
--2.17618 -0.310149 -0.97579
--2.53774 -0.34641 -0.982996
--2.72644 0.0266272 -0.926894
-2.55741 -2.698 0.173276
-2.54559 -2.57237 0.442127
-2.3705 -2.89048 0.304438
-2.72431 -2.41899 0.18726
-1.9329 0.782115 1.33228
-2.07372 0.536763 1.46386
-2.17214 0.8611 1.45373
--2.80681 0.525011 1.2573
--2.61929 0.28831 1.22734
--2.56131 0.690348 1.24508
--2.81006 0.863312 1.29461
--3.07437 0.682266 1.25198
--2.93388 0.253786 1.19793
--4.08497 3.06658 -0.477188
--3.9929 3.34994 -0.508473
--3.80453 3.03208 -0.563298
--4.32072 3.17934 -0.355717
-0.71429 -2.43755 1.13125
-0.577457 -2.64302 0.937117
-0.916566 -2.69839 1.07919
-1.07048 -2.51173 1.22284
-0.932491 -2.24372 1.27808
-0.704217 -2.07408 1.22076
-0.481325 -2.21307 1.06654
-6.77633 5.96032 -0.178714
-6.94684 5.97403 0.117185
-6.85821 5.65343 -0.186667
-6.74866 6.24283 0.0139289
--0.304946 -1.70022 0.0742084
--0.249086 -1.9323 0.145158
--0.175199 -1.63268 0.361055
--0.279403 -1.43671 -0.0334712
--0.301889 -1.66287 -0.225311
--0.26584 -1.92808 -0.226154
-0.270686 -1.89609 -1.12178
-0.42664 -1.58342 -1.20414
-0.507389 -1.87036 -1.30753
-0.28771 -2.24099 -1.08346
-0.0698602 -2.00793 -0.891812
-0.105249 -1.71433 -0.931758
--2.72748 -0.893247 -0.928846
--2.95372 -0.801654 -0.793391
--2.62174 -0.629936 -0.977214
--2.41176 -0.845681 -1.03904
-3.2547 3.60003 1.33696
-3.29474 3.85307 1.22717
-3.09766 3.64218 1.09161
-3.04951 3.38036 1.22149
-3.23911 3.34028 1.44699
-3.45528 3.52774 1.55405
-3.46952 3.81241 1.45288
-2.13552 -2.31356 -1.26343
-2.34225 -2.141 -1.16648
-2.28978 -2.52288 -1.03898
-2.03955 -2.64332 -1.1659
-1.87917 -2.44238 -1.35687
--2.64685 -1.13203 0.96817
--2.55545 -1.40087 0.932776
--2.39014 -1.08724 1.05705
--2.64858 -0.806068 1.04884
--2.84983 -0.905987 0.93024
--2.90094 -1.172 0.793946
-5.46206 6.53047 1.67055
-5.44747 6.32229 1.84814
-5.73482 6.51078 1.7131
-5.46571 6.70016 1.4559
-5.2019 6.49508 1.61418
--2.96176 -0.204601 1.08273
--2.8961 -0.493623 1.03199
--2.63601 -0.263771 1.15631
--2.78725 0.00189162 1.1791
--3.14333 0.0936235 1.08365
--3.24797 -0.110431 0.945928
--3.1717 -0.386754 0.894612
--3.47346 -0.289085 -0.310649
--3.48661 -0.0033554 -0.433021
--3.29665 -0.329489 -0.568534
--3.34481 -0.573148 -0.399182
--3.47098 -0.522645 -0.0868477
--3.58443 -0.227542 -0.00380224
--3.62173 0.00490325 -0.168243
--1.93493 0.792305 0.843012
--1.9404 1.06144 0.740219
--2.14063 0.908349 1.02228
--2.05697 0.575826 1.01327
--1.1033 -0.875587 -0.562918
--1.11228 -0.651707 -0.389252
--0.933491 -0.97847 -0.367397
--1.0533 -1.17043 -0.58353
--1.25204 -1.11933 -0.765217
--1.3032 -0.811943 -0.73879
--1.57893 -0.781166 0.910529
--1.35595 -0.684519 0.716635
--1.53384 -0.481856 0.810603
--1.74273 -0.510285 0.963317
--1.38004 -0.994104 0.826356
-4.7433 5.04488 -0.75171
-4.97556 5.22104 -0.771439
-4.92056 4.82521 -0.848154
-4.65312 4.73047 -0.812904
-4.45911 4.93155 -0.673453
-4.52679 5.19667 -0.599115
-4.75085 5.36744 -0.645883
-1.32843 0.246516 1.03312
-1.28601 -0.0533061 1.12775
-1.55188 0.148591 1.26028
-1.47741 0.5427 1.03714
-1.29585 0.50176 0.830034
-1.1235 0.279323 0.739795
-1.12678 0.0331439 0.925816
--3.41184 -0.662462 0.317813
--3.26844 -0.823944 0.529039
--3.40921 -0.47132 0.541786
--3.52609 -0.401529 0.228077
--3.39951 -0.771987 0.0583163
--3.29761 -0.985696 0.273689
--2.44003 -1.74416 0.77911
--2.40321 -1.93882 0.574524
--2.16401 -1.86492 0.727302
--2.33647 -1.56288 0.932501
--3.19536 -1.22835 -0.271192
--3.29573 -1.04903 -0.0607735
--3.2039 -0.996262 -0.430891
--3.04013 -1.31067 -0.560577
--3.07055 -1.49746 -0.361095
--3.15817 -1.44404 -0.059781
--2.33749 -0.254451 1.15692
--2.08626 -0.459199 1.10064
--2.13336 -0.0834085 1.11195
--2.47607 0.0220306 1.19255
--2.34752 -0.544654 1.13367
--4.06515 1.14606 0.0939439
--3.98855 0.87721 0.208124
--4.10693 1.20843 0.381695
--4.10764 1.40389 -0.0430838
--3.94837 1.06503 -0.169509
--3.74035 0.213102 0.0356933
--3.66615 -0.0230989 0.21915
--3.76119 0.273481 0.35934
--3.84289 0.488681 0.0952445
--3.67135 0.296679 -0.26498
--1.73488 0.824535 -0.0694358
--1.88074 0.984935 -0.269929
--1.81166 1.08 0.0503476
--1.73262 0.898408 0.237072
--1.6277 0.622408 0.0997399
--1.71963 0.630373 -0.25725
--4.44731 2.9857 1.23889
--4.47648 3.31286 1.27093
--4.63912 3.15007 1.045
--4.60983 2.87466 0.943018
--4.39756 2.70469 1.15202
--4.18898 2.86288 1.38837
--4.26454 3.17889 1.42879
--3.1185 2.88722 1.42872
--2.9835 2.29036 1.39026
--2.82421 2.55737 1.28856
--3.62914 0.945485 1.07069
--3.85799 1.03371 0.875528
--3.64957 0.663368 0.923775
--3.34893 0.870816 1.21064
--3.46287 1.17338 1.24476
--3.78027 1.26236 1.07779
--4.10144 1.80983 1.01471
--3.93356 1.92953 1.22535
--4.23873 2.08417 0.996568
--3.87802 1.60653 1.14086
--2.41342 2.76212 0.52291
--2.51387 3.05685 0.485706
--2.51421 2.89601 0.771281
--2.34972 2.47078 0.684162
--2.32 2.51869 0.386456
--2.40892 2.69099 0.171889
--2.49363 2.94328 0.228462
--4.1901 1.67887 0.779085
--4.18138 1.47216 0.555497
--4.01052 1.4394 0.914544
--4.33252 1.98544 0.734667
--4.30575 1.76904 0.476773
--2.14148 2.02084 0.292344
--2.04327 1.74933 0.271785
--2.1878 2.01728 0.0156825
--2.24237 2.27722 0.21845
--2.23397 2.23757 0.523243
--2.1242 1.90144 0.538474
--2.6618 1.7117 1.27036
--2.42223 1.65463 1.12153
--2.57037 1.99444 1.18305
--2.85219 1.92206 1.34625
--2.84725 1.49189 1.34055
--2.55483 1.38925 1.23605
--3.24773 2.89115 -0.563582
--3.13442 3.16171 -0.454071
--2.97275 2.87675 -0.457286
--2.97087 0.910323 -0.830011
--2.8625 0.64601 -0.863657
--3.22997 0.77024 -0.766962
--3.25406 1.08882 -0.760944
--2.94461 1.2067 -0.80286
--3.19264 3.76303 -0.268807
--3.35685 3.98887 -0.189947
--3.09926 3.48731 -0.325277
--3.35013 3.51948 -0.448783
--3.49897 3.80852 -0.379837
--4.13442 2.78485 -0.432249
--4.25185 2.54973 -0.303828
--4.37806 2.88588 -0.257884
--3.85371 2.74253 -0.55972
--3.97769 2.47611 -0.496416
--3.01366 4.06086 0.677485
--3.24816 4.19348 0.803642
--3.00824 3.95263 0.934934
--3.16861 4.19158 0.469881
--3.90096 4.1833 -0.0258327
--4.04109 3.99704 -0.207144
--4.19113 4.15901 0.127059
--3.94038 4.2978 0.268172
--3.6627 4.29 0.171202
--3.68087 4.0663 -0.203356
-1.28305 -0.86711 1.33316
-1.30099 -1.16771 1.37218
-1.57065 -0.909317 1.43042
-1.26322 -0.582139 1.27146
-1.01719 -0.784363 1.17406
-1.04084 -1.07869 1.25768
-4.61406 2.89864 1.84366
-4.57573 2.60027 1.78141
-4.91371 2.83506 1.73841
-4.71687 3.17893 1.88327
-5.72202 6.92474 0.418179
-5.69642 6.94662 0.712281
-5.99169 6.90788 0.535534
-5.89825 6.85722 0.213565
-5.50061 6.84127 0.155097
-5.44399 6.90241 0.40192
-0.581409 -2.87223 -0.92502
-0.728407 -2.72758 -1.16272
-0.861693 -3.02699 -0.941028
-0.738898 -3.13304 -0.678139
-0.378696 -2.85371 -0.713403
-0.399734 -2.57893 -1.02076
-3.53052 -0.877647 -0.465663
-3.51352 -1.0597 -0.221438
-3.36463 -1.08418 -0.576949
-3.37807 -0.814161 -0.768259
-3.5536 -0.61055 -0.671499
-3.6844 -0.728219 -0.274886
-1.66648 -2.62611 -1.34184
-1.48294 -2.32996 -1.49719
-1.84384 -2.83942 -1.12664
-1.47647 -2.85299 -1.22432
-1.33369 -2.63388 -1.37994
-4.50489 1.11766 -0.575304
-4.6655 1.10628 -0.317977
-4.4713 0.844402 -0.419463
-4.28758 0.88656 -0.693971
-4.42024 1.33553 -0.773128
-4.642 1.44308 -0.605366
--1.48623 0.266598 0.170936
--1.49197 0.126599 0.44517
-2.59359 1.53659 -1.07994
-2.52661 1.77098 -0.957494
-2.84365 1.69255 -1.11866
-2.75375 1.31356 -1.19128
-2.46659 1.23055 -1.13156
-2.327 1.45432 -0.98216
--1.07958 -0.561411 -0.0782097
--1.22408 -0.302384 0.00216391
--1.16863 -0.450934 0.22295
--1.02182 -0.682806 0.179951
--0.942777 -0.791918 -0.151739
--1.22775 -0.400658 -0.287671
-1.04695 0.428301 0.327244
-0.971641 0.174597 0.547138
-1.18354 0.549623 0.562124
-1.17307 0.667302 0.263656
-0.98696 0.369718 0.0352485
-0.894835 0.17772 0.283671
-1.26046 -3.38529 -0.241607
-1.16375 -3.37391 0.0781727
-0.961899 -3.33669 -0.253097
-1.31991 -3.31777 -0.563354
-1.58084 -3.35511 -0.331871
-1.50026 -3.38331 -0.00924776
-4.04168 0.775803 1.34296
-3.81296 0.709911 1.45215
-3.82908 0.414927 1.30645
-4.04688 0.393213 1.1022
-4.17992 1.04431 1.38411
-3.93074 1.11424 1.54997
-1.3473 0.802046 0.626675
-1.32412 0.897541 0.381628
-1.46867 0.794179 0.862163
-1.53267 1.08047 0.705362
-3.29336 1.60053 -1.20303
-3.01545 1.48076 -1.2014
-3.09149 1.85641 -1.13924
-3.40073 1.90025 -1.16993
-3.61126 1.59045 -1.18161
-3.33546 1.29132 -1.22525
-5.62358 2.75262 1.0777
-5.77933 2.84311 0.844079
-5.71859 3.03221 1.21844
-5.55879 2.51885 0.898668
-2.47127 2.79266 -0.0777182
-2.42757 2.81723 0.207235
-2.61609 3.03572 -0.0597707
-2.55071 2.7506 -0.316665
-2.33466 2.51481 -0.17884
-2.30551 2.58302 0.0698644
-1.08521 -2.96288 0.91248
-1.36802 -3.05436 0.843495
-1.25744 -2.73844 1.12404
-0.782819 -2.86576 0.886446
-0.844871 -3.09661 0.641085
-1.14979 -3.18763 0.631905
-3.84648 4.33926 1.56949
-3.65213 4.33729 1.37287
-3.73725 4.0621 1.58499
-3.9693 4.1196 1.7283
-4.08582 4.41464 1.72363
-3.99229 4.62724 1.57908
-3.79036 4.58072 1.39268
-5.03437 1.68215 0.891902
-4.84435 1.43156 0.950179
-5.01579 1.49595 0.605661
-5.18484 1.79583 0.665614
-5.14934 1.99853 1.0553
-4.91913 1.76111 1.16106
-2.46454 -2.30791 -0.969099
-2.55173 -2.45591 -0.735053
-3.19021 3.92141 0.982738
-3.0572 3.81201 0.783917
-3.30079 4.16977 0.923489
-3.16722 4.05353 0.673037
-2.7189 -2.40157 -0.393726
-2.70971 -2.48726 -0.121874
-2.5635 -2.65427 -0.444955
-5.45084 2.25177 0.71766
-5.60454 2.46208 0.564752
-4.35675 1.89842 1.64482
-4.62399 2.09368 1.59515
-4.21343 2.113 1.75005
-3.9289 2.02877 1.77861
-4.61179 1.77743 1.45836
-3.14759 2.91117 1.52961
-3.02628 3.1289 1.33969
-2.93803 2.78965 1.40907
-3.08742 2.59319 1.57805
-3.41822 2.89885 1.68978
-3.31105 3.13485 1.575
-1.71171 -3.282 0.327746
-1.48737 -3.21386 0.594408
-1.37689 -3.3338 0.321419
-1.76916 -3.32425 0.0337589
-5.75579 2.71789 0.577461
-5.94258 3.03736 0.615121
-5.92602 3.12933 0.936607
-2.43954 2.2637 -0.607328
-2.5586 2.09251 -0.822849
-2.25817 2.04781 -0.56517
-2.25449 2.26809 -0.342304
-2.44527 2.48975 -0.420863
-2.67582 2.37823 -0.754694
-3.58753 2.45763 -1.10037
-3.37175 2.63871 -1.01289
-3.75839 2.7216 -1.07499
-3.9273 2.45569 -1.11191
-3.75132 2.17725 -1.14135
-3.42295 2.18566 -1.12784
-3.27519 4.26533 0.369612
-3.29396 4.28355 0.645469
-3.41113 4.49746 0.394895
-3.38743 4.36706 0.105512
-3.21926 4.10526 0.129837
-3.12959 4.02135 0.386715
-4.59978 6.05501 1.47473
-4.75672 6.00052 1.68133
-4.75382 6.28774 1.46787
-4.55922 6.20962 1.26715
-4.40091 5.91249 1.27753
-4.49943 5.81285 1.50403
--3.32642 3.74365 1.39215
--3.22072 3.4678 1.43697
--3.10095 3.7764 1.22664
--3.45644 3.98474 1.27466
--3.56871 3.64471 1.5077
-5.08133 4.10986 1.99889
-5.10824 3.79546 1.94206
-5.37527 4.10865 1.95805
-5.18142 4.44088 2.03637
-4.9002 4.37881 2.01722
-4.78193 4.05296 1.99051
-6.68639 5.22605 -0.36527
-6.88973 5.33685 -0.146801
-6.74693 4.93943 -0.17742
-6.50258 4.8874 -0.405334
-6.47977 5.39359 -0.555216
-6.66063 5.6248 -0.410682
-4.32157 5.62849 1.39112
-4.48352 5.55662 1.62522
-4.67681 5.75341 1.71701
-5.41299 2.46472 -0.265353
-5.25421 2.19126 -0.291126
-5.2031 2.46474 -0.540816
-5.3945 2.71948 -0.468382
-5.58851 2.57376 -0.0245429
-5.44063 2.27668 0.0201241
-4.17483 4.76697 -0.580916
-3.987 4.81406 -0.399019
-4.24679 5.02406 -0.497258
-4.38076 4.64899 -0.742947
-4.14359 4.48225 -0.692783
-3.92838 4.54649 -0.515749
-0.575086 -0.319375 0.137793
-0.426735 -0.549375 0.137022
-0.629651 -0.33705 0.411925
-0.747772 -0.0724315 0.27667
-0.664209 -0.167025 -0.0539383
-0.454213 -0.499526 -0.141241
--2.23743 0.183221 1.14406
--2.03553 0.303864 1.03692
--2.35352 2.4442 0.0314378
--2.32934 2.20449 -0.134264
--2.50272 2.48893 -0.211964
--3.37402 4.26158 0.279124
--3.43338 4.30651 0.596241
--1.87524 0.528798 -0.551478
--1.88602 0.762518 -0.433466
--1.73349 0.300054 -0.521238
--1.96498 0.303381 -0.724441
--2.12399 0.560175 -0.730776
--1.34324 -0.0638205 -0.0106493
--1.36259 -0.139144 -0.264176
--1.46066 0.167177 -0.0902646
--1.38353 0.00229609 0.231181
-3.26654 0.0517979 1.45709
-3.57829 0.203283 1.36573
-3.33354 0.35086 1.52647
-3.28727 -0.220293 1.34572
-3.56133 -0.067779 1.24567
--3.61696 0.37237 0.801219
--3.41898 0.600701 1.09081
--4.52311 2.36306 0.419571
--4.459 2.28875 0.715226
--4.61206 2.62362 0.582494
--4.60245 2.65124 0.262696
--4.47308 2.39624 0.101525
--4.41781 2.06891 0.43754
-4.83961 4.17782 -0.936775
-4.53058 4.12255 -0.923979
-4.74213 4.47107 -0.88896
-5.03151 4.46844 -0.906508
-5.14509 4.12191 -0.911607
-4.70785 3.87509 -0.967311
-5.50273 3.5124 1.71626
-5.40921 3.7919 1.8622
-5.18609 3.48348 1.84489
-5.31664 3.20545 1.68799
-5.59982 3.23616 1.50582
-5.7491 3.72678 1.66339
-6.99501 5.09825 1.19778
-7.1119 5.30977 0.944185
-6.98701 5.36939 1.32907
-6.83424 5.32885 1.56402
-6.81141 4.89449 1.39749
-6.92195 4.81256 1.07474
-7.06381 5.01224 0.807921
-5.43954 5.82508 2.07466
-5.73637 5.85909 2.08593
-5.53675 6.09281 1.9949
-5.23955 6.05765 1.94353
-5.16759 5.77041 2.0121
-5.40793 5.54383 2.10897
--2.86183 -0.526187 -0.881125
--2.32645 -0.553547 -1.02275
-2.21361 -2.78034 -0.906335
-1.47907 1.15197 0.434454
-1.36601 1.01447 0.12676
--2.97617 -1.69783 0.27075
--2.89925 -1.62673 0.525337
--3.11257 -1.4446 0.297451
--3.03623 -1.67693 0.00900469
--2.78326 -1.90367 0.225312
-6.25054 6.07188 -0.544069
-6.29252 6.31472 -0.368969
-6.55818 6.0203 -0.373311
-6.43253 5.80054 -0.54681
-6.07033 5.87985 -0.684812
-5.99506 6.26478 -0.527538
--3.63492 0.112787 0.575716
--3.78282 0.486513 0.586754
--3.69946 1.11331 -0.511145
--3.49857 0.892962 -0.632369
--3.77758 0.873102 -0.360233
--3.90739 1.29016 -0.336133
--3.7357 1.45884 -0.540173
--3.4879 1.25244 -0.670554
--2.62358 1.09068 1.27055
--3.09687 1.00106 1.30549
--1.70743 0.0728551 -0.619782
--1.68071 -0.194106 -0.728164
--1.91822 0.0349975 -0.793812
--1.52584 0.124315 -0.337607
--1.51563 -0.0964405 -0.504099
-5.47299 2.93282 1.42801
-5.22021 2.88501 1.60005
-2.5936 -1.6175 1.12672
-2.39091 -1.48471 1.28828
-2.37107 -1.85049 1.1555
-2.64336 -1.8804 0.93882
-2.83566 -1.67922 0.884339
-2.72542 -1.34267 1.17395
-3.24538 -0.925467 0.996022
-3.41791 -0.661114 1.00507
-3.11867 -0.739574 1.21044
--3.33699 -0.810996 -0.24462
-6.24747 4.70483 -0.539291
-5.93087 4.58114 -0.695508
-6.07499 4.91581 -0.685446
--2.95848 -1.72577 -0.267067
--2.86093 -1.65338 -0.558676
--2.74173 -1.88936 -0.362926
--2.82237 -1.9036 -0.0532058
-6.90693 4.77945 0.277344
-6.73574 4.66411 0.0214382
-6.94069 5.04888 0.0572767
-7.06979 5.0969 0.398044
-6.97763 4.80168 0.586328
-6.72735 4.4468 0.294997
--4.18283 1.72571 -0.0951115
--4.29739 1.79113 0.175601
--4.25773 2.02849 -0.121083
--4.06312 1.93244 -0.345216
--4.01319 1.56669 -0.294298
--3.84245 0.768694 0.713488
--3.98523 0.940984 0.515952
--4.6946 3.41935 0.935589
--4.76331 3.19011 0.728442
--3.70859 3.88878 1.3952
--3.88063 3.64395 1.50821
--3.60964 1.45595 1.25828
--3.33752 1.53579 1.36266
--3.64858 1.76612 1.32713
--4.35719 2.36099 1.00197
--4.52455 2.58589 0.867578
--2.65809 3.12868 0.93932
--2.60143 3.23586 0.689814
--2.78144 3.41075 1.01399
--2.83656 3.15778 1.18379
--2.65611 2.85603 1.05981
--4.71472 2.93161 0.357783
--4.70858 2.90754 0.660347
--4.78036 3.21658 0.405898
--4.61173 2.9052 0.0586183
--2.37413 2.26119 0.88467
--2.53193 2.29605 1.08505
--2.3734 1.94616 1.00572
--2.23997 2.05196 0.74335
--2.473 2.62022 0.87297
--3.05776 1.66242 1.38696
--3.18443 1.29657 1.34317
--3.1144 1.99968 1.41874
--3.36284 1.83392 1.40931
--2.93151 3.26702 -0.281744
--2.79929 3.02039 -0.270622
--2.76433 3.32045 -0.0580593
--3.19015 1.40848 -0.764239
--3.4701 1.55582 -0.68822
--4.15944 3.75397 -0.332298
--4.30116 3.96941 -0.058793
--3.80281 3.87197 -0.365872
--4.65055 3.79444 0.387216
--4.58019 3.90963 0.629851
--4.44185 4.0304 0.264238
--4.54924 3.80352 0.0883825
--4.74073 3.52963 0.316487
--4.7667 3.48666 0.599309
--4.67957 3.68312 0.770349
--3.6832 4.34775 0.45773
--3.66027 4.31012 0.800976
--4.16663 4.2224 0.7658
--3.90905 4.23887 0.95564
--3.92208 4.32679 0.622962
--4.16666 4.25078 0.434266
--4.39195 4.11526 0.538737
--4.39364 4.0416 0.857433
--4.1591 4.08814 1.06713
-0.9963 -0.54777 1.07884
-0.798767 -0.552889 0.890631
-0.817338 -0.956563 1.08861
--0.897974 -0.913917 0.179808
--0.986451 -0.986288 0.423002
--0.805115 -1.24111 0.166609
--0.816121 -1.04002 -0.0394137
-0.337806 -0.710791 -0.320536
-0.253942 -0.774728 0.00422765
-0.540335 -0.508611 -0.488465
-0.448634 -0.746107 -0.637475
-0.246884 -0.948563 -0.546828
-0.134343 -0.939422 -0.209397
-1.79182 -0.204334 -1.33122
-1.68044 -0.4419 -1.36272
-1.44567 -0.249134 -1.22029
-1.60329 -0.000688109 -1.20015
-1.86527 0.106519 -1.26752
-2.06888 -0.168414 -1.37421
-1.19518 -0.31502 1.15156
-0.974081 -0.276952 0.929857
-3.20761 0.0327246 -1.19272
-2.96251 -0.17737 -1.26434
-2.93481 0.141685 -1.29712
--1.79135 0.217624 0.857041
--1.89763 0.0174474 0.985016
--1.62781 -0.0164725 0.754094
-1.46163 0.730054 -0.670306
-1.63882 1.02086 -0.649026
-1.6978 0.838746 -0.848748
-1.57397 0.528616 -0.931397
-1.3707 0.473812 -0.77019
-1.26709 0.664551 -0.411118
-1.45798 0.943274 -0.440726
--1.39036 -0.336555 -0.516422
-1.99929 -2.54494 1.05919
-2.27284 -2.39304 0.947648
-2.097 -2.22734 1.1457
-1.80719 -2.34419 1.23004
-1.71359 -2.67017 1.11246
-1.90525 -2.83286 0.910082
-2.19068 -2.68021 0.831294
-6.20235 4.78057 1.87097
-6.3039 4.52233 1.68014
-6.4737 4.88409 1.74998
-6.20783 5.10743 1.98666
-5.92748 4.93304 2.02664
-5.93317 4.60645 1.92894
-4.37438 0.937406 1.1491
-4.42457 1.24506 1.30721
-4.15353 1.35912 1.53929
-5.03429 5.84506 -0.598155
-4.82043 5.91127 -0.445293
-5.10817 6.1067 -0.523355
-5.2629 5.73942 -0.713593
-4.9171 5.59072 -0.638849
-2.22149 1.63674 -0.815198
-2.05914 1.34602 -0.851874
-1.9747 1.55622 -0.621752
-2.10863 1.80549 -0.580732
-2.35931 1.8914 -0.779278
-6.35807 5.10049 -0.575905
-6.12564 5.2591 -0.710731
-5.80907 5.74225 -0.765336
-5.96024 5.50578 -0.767455
-5.50449 5.61488 -0.780989
-5.57882 5.91706 -0.724244
-6.09713 3.55251 1.15161
-6.11286 3.38233 0.836733
-6.292 3.755 1.00323
-5.90052 3.30628 1.2147
-6.95067 6.21531 0.633089
-6.89447 6.22777 0.321251
-6.76468 6.46966 0.642755
-6.90718 6.23708 0.949329
-7.06949 5.94046 0.787405
-7.06007 5.92689 0.443362
-6.08301 3.26753 0.497863
-6.27733 3.60827 0.67259
-2.02755 -2.96523 -0.869759
-1.67022 -3.03059 -1.00326
-2.68833 3.20102 0.680903
-2.75949 3.12449 0.975179
-2.80978 3.39339 0.733275
-2.58434 2.98402 0.739033
-4.42104 6.21925 0.562537
-4.6125 6.44923 0.413904
-4.47513 6.22947 0.310465
-4.32365 6.00536 0.363303
-4.27068 5.97012 0.619123
-4.44879 6.25959 0.811764
-4.58856 6.45642 0.689479
-0.107136 -0.99435 0.159022
--0.0106347 -1.21232 0.309946
-0.248245 -0.957804 0.435146
--0.058333 -1.13786 -0.049878
-4.83131 2.0991 -0.724842
-4.90236 2.39951 -0.773425
-5.07388 2.18804 -0.533646
-4.96941 1.89848 -0.485867
-4.62437 1.96303 -0.833869
-4.60885 2.33426 -0.930307
-2.84663 2.97084 1.22597
-2.89375 3.32192 1.03006
-2.66517 2.87245 1.04304
-2.64159 2.6459 1.1744
-2.80541 2.59759 1.37161
-3.65375 1.79993 1.76306
-3.58772 2.08755 1.78362
-3.3391 1.78086 1.74387
-3.52565 1.52231 1.73333
-3.94732 1.72612 1.71845
-5.52262 2.32271 0.288816
-5.6928 2.62698 0.256876
-5.39341 2.0934 0.462297
-5.30964 1.96214 0.236401
-2.8995 3.14617 -0.448658
-2.71267 3.03107 -0.283407
-2.84308 3.31154 -0.189996
-7.01691 5.6767 0.0975724
-3.4304 4.41893 0.902934
-3.43314 4.52598 0.647929
--2.86137 2.86663 1.27065
--3.05112 3.19167 1.36447
--3.31083 3.13624 1.5009
--3.43484 2.85095 1.5236
-5.4209 6.92367 0.664981
-5.16593 6.85103 0.595611
-2.41874 -2.69942 -0.718325
-2.27546 -2.94078 -0.592459
--2.0369 -1.38819 -1.03681
--2.26334 -1.60707 -0.933447
--2.26556 -1.11954 -1.07572
-2.49148 -1.59898 -1.23192
-2.39095 -1.3633 -1.33635
-2.74193 -1.39493 -1.11909
-2.73321 -1.64696 -1.02613
-2.37726 -1.88255 -1.22685
-2.18817 -1.73092 -1.3686
-3.8192 -0.400994 0.664269
-3.78649 -0.582894 0.436741
-3.95287 -0.325134 0.396717
-3.16898 3.12614 -0.719385
-3.25505 2.90951 -0.872861
-2.96878 2.94109 -0.665912
-3.09038 3.32178 -0.530885
-3.32818 3.38129 -0.700023
-3.44367 3.14194 -0.874567
-4.45667 4.39209 -0.848395
--1.91008 -0.272296 1.02624
--1.67769 -0.222704 0.86507
--2.44932 1.76129 -0.510931
--2.24364 1.60529 -0.391285
--2.7169 1.73209 -0.667163
--2.63854 2.01499 -0.54661
--2.38762 2.00168 -0.344863
--2.81091 3.77364 0.758511
--2.70216 3.50251 0.743846
--2.62764 3.37006 0.420453
--2.64722 0.406292 -0.900401
--2.89253 0.288019 -0.878955
--2.57831 0.708483 -0.850487
--2.36099 0.506001 -0.844763
-0.895645 0.171274 -0.213596
-0.808775 0.071615 0.0141342
-2.95261 0.0533246 1.54838
-2.99107 -0.240328 1.46408
-3.03735 0.338434 1.5919
-2.63866 0.106192 1.58832
-2.6756 -0.192832 1.54374
--3.58223 2.65527 -0.621348
--3.52167 2.96061 -0.590865
--3.71607 2.36708 -0.605868
-0.841079 -3.29945 0.0570917
-0.703276 -3.17306 0.35051
-0.572289 -3.17949 -0.0760034
-1.0237 -3.28325 0.368892
--0.0436037 -2.16221 -0.666844
-0.0329734 -2.47362 -0.567815
--0.143812 -2.21657 -0.374294
--0.173622 -1.93198 -0.50391
-0.135903 -2.33125 -0.866569
-5.36833 6.88996 0.927571
-5.63207 6.91207 0.986224
-5.11699 6.81666 0.884737
-5.22879 6.7857 1.16229
-5.51667 6.82769 1.22651
-0.492167 -2.17619 -1.27108
--3.06244 -0.219382 -0.79153
--3.03797 0.058671 -0.825575
--2.80057 -0.242033 -0.915327
--3.10368 -0.500938 -0.721575
--3.29542 -0.0443823 -0.640957
-3.54889 4.08056 1.40061
-1.89931 1.86609 -0.0710804
-1.84867 1.8375 0.241004
-2.02355 2.08502 -0.0307164
-1.9512 1.79016 -0.346736
-1.76372 1.65781 -0.0281872
--2.77906 -1.43475 0.785394
--3.00396 -1.36739 0.581025
-6.79416 4.48297 0.585706
-6.55862 4.1324 0.324986
-6.5515 4.33336 0.00538146
--3.0134 -0.702942 0.892845
--2.06307 1.41118 0.774104
--1.93006 1.29222 0.559759
--2.06566 1.64776 0.621783
--2.24012 1.49421 0.984831
--2.11375 1.17309 0.935011
-6.70855 6.46824 0.321907
-6.53738 6.66604 0.550523
-5.90359 6.87948 1.05218
-5.80869 6.8038 1.29069
-6.1261 6.7588 1.23687
-5.9791 6.91136 0.797835
-5.67244 4.00024 1.82601
-2.34523 0.0107702 1.56627
-2.05768 -0.0918584 1.51666
-2.36946 -0.289348 1.54743
-2.17102 0.257142 1.52927
--1.8031 -1.60722 0.889516
--2.01207 -1.41379 1.01376
--2.08253 -1.6673 0.895646
--1.87399 -1.85814 0.708345
--1.59652 -1.73724 0.716683
--1.584 -1.43783 0.888191
--3.17749 -0.739618 -0.584753
--3.03525 -1.04684 -0.662182
--2.38331 -0.827782 1.0985
--2.12203 -0.798324 1.09728
--4.20614 1.49573 0.233274
--3.61411 0.633831 -0.48362
--3.39191 0.541088 -0.661285
--3.50872 0.294484 -0.506347
--3.76867 0.554207 -0.223808
--2.2153 1.83113 -0.214637
--2.06518 1.51113 -0.190998
--3.99563 3.17577 1.54105
--3.78575 3.36682 1.57729
--4.12587 3.46106 1.48822
--2.61949 2.56123 1.10863
--2.8799 1.21924 1.33147
--3.70273 2.68702 1.50827
--3.87829 2.34639 1.38825
--2.53738 2.75205 -0.0886397
--2.71644 2.73588 -0.323424
--2.62841 3.0223 -0.0456433
--2.20901 1.75641 0.851081
--2.83704 2.23367 -0.582315
--2.93351 1.95043 -0.682603
--3.10037 2.33017 -0.643582
--2.73793 2.47912 -0.446965
--2.54364 2.25594 -0.38073
--2.35631 0.847093 -0.758055
--3.69009 3.29975 -0.550726
--3.64114 3.57544 -0.501258
--3.39702 3.23965 -0.527561
--4.54791 3.13128 -0.136918
--4.70613 3.22278 0.11291
--4.50048 3.42477 -0.196072
--2.88642 3.69011 1.03273
-2.38341 -2.1121 1.0194
-2.58797 -2.15508 0.800023
--0.00727345 -1.46213 0.536091
-4.57144 6.37544 1.00845
-4.32135 6.02922 0.855065
-4.42716 6.11782 1.08185
-2.39279 -1.02531 -1.37731
-2.28842 -0.736083 -1.41546
-2.66636 -0.877484 -1.2903
-2.65438 -1.17224 -1.24008
-2.12365 -1.16551 -1.44273
-0.947029 -0.0676544 0.751482
-3.54806 0.717383 -1.14804
-3.26958 0.598035 -1.23219
-3.40579 0.990112 -1.21566
-3.72564 1.00003 -1.1139
-3.83236 0.672323 -0.990881
-3.59199 0.426335 -1.07442
--1.12135 -0.718676 0.451641
-1.76789 -2.19618 -1.47054
-1.6378 -1.9417 -1.52956
-2.04021 -2.03279 -1.38621
-4.89006 3.45344 1.90968
-4.80873 3.75814 1.96531
-4.57393 3.50312 1.93919
-5.02 3.13923 1.79711
-1.22207 0.764637 0.0237609
-1.11716 0.562235 -0.119853
-5.49632 5.05005 -0.840496
-5.45755 4.73547 -0.856039
-5.17699 5.03477 -0.842001
-5.36126 5.31798 -0.814108
-5.82673 5.13193 -0.789
-5.75662 4.82527 -0.79249
-4.27014 0.178337 0.280502
-4.14421 -0.0251091 0.0243485
-4.34647 0.31634 0.0786384
-4.32143 0.32691 0.523987
-4.16118 0.1212 0.630855
-4.13256 -0.049425 0.305982
-1.6762 1.06075 0.963286
-1.73561 1.30879 0.859707
-1.65399 0.821687 1.08005
-1.87511 1.03272 1.19798
-2.83629 2.21114 -0.94015
-2.77105 1.94909 -1.01002
-5.02174 3.83418 -0.932701
-4.7044 3.56095 -0.986351
-4.42314 3.69439 -0.982837
-2.56565 3.04872 0.206605
-2.71708 3.26519 0.0829693
-2.03043 -0.8711 -1.45222
-2.08516 -1.46157 -1.43855
-1.8015 -1.08762 -1.48027
-5.0922 5.49635 2.02208
-4.89824 5.31474 1.96835
-5.27685 5.27503 2.08709
-4.89356 5.68995 1.89298
-5.01736 3.52753 -0.920366
-5.3179 3.50334 -0.797628
-5.02054 3.211 -0.885717
-6.49044 5.18705 1.85741
-6.61018 5.45154 1.80496
-6.27207 5.4244 2.01129
-6.72143 5.07267 1.61992
-3.71843 4.98606 0.794463
-3.84339 5.14079 0.946246
-3.83521 5.22737 0.582445
-3.70232 5.00076 0.545876
-3.5726 4.76918 0.644592
-3.70954 4.85213 1.01705
-5.20016 6.80911 0.279993
-4.97813 6.74239 0.422076
-4.91738 6.7294 0.743521
--1.30572 -0.230387 0.328422
--1.26269 -0.493418 0.49699
-4.94289 2.91628 -0.873557
-5.26455 2.91831 -0.677222
-5.07041 2.66266 -0.736423
-4.73056 2.64784 -0.926718
-4.63012 2.98139 -0.995705
-4.18763 2.41065 1.81447
-3.88454 2.33543 1.81838
-4.49948 2.31866 1.72578
-4.27902 2.68544 1.84945
-3.94758 2.66118 1.84511
-2.22773 -3.08715 -0.225525
-2.01225 -3.23091 -0.102127
-2.07452 -3.13061 -0.499213
-2.42395 -2.88864 -0.318726
-2.32791 -3.00243 0.0388688
-2.84437 2.10419 1.55233
-2.83202 2.3593 1.47806
-2.56001 2.11758 1.35314
-2.65597 1.91368 1.4878
-3.02213 1.92534 1.66125
-3.06792 2.30441 1.62743
-4.31478 0.38661 -0.228882
-4.47424 0.617429 -0.131772
-4.20269 0.136258 -0.144758
-4.16407 0.402035 -0.541856
-4.33324 0.612366 -0.446985
-2.63416 2.58818 -0.578693
-2.85448 2.66115 -0.735651
-2.96732 2.44879 -0.91125
-3.55803 4.74165 0.379557
-3.51793 4.60146 0.152682
-4.1725 5.76945 0.401769
-4.1198 5.71311 0.615241
-4.1742 5.77275 0.847412
--4.08181 3.80618 1.3755
-1.0643 0.392978 -0.327417
-1.20075 0.43481 -0.569611
-0.980424 0.158047 -0.490146
-0.162038 -2.61938 0.479033
-0.366356 -2.7069 0.688263
-0.177495 -2.41249 0.69027
-0.351842 -3.0032 -0.272337
-0.692377 -3.22119 -0.344686
-3.54396 -0.97595 0.439956
-3.69933 -0.786986 0.238805
-3.64407 -0.722773 0.600385
-3.37903 -1.04083 0.722992
-3.35584 -1.24202 0.506966
-3.5348 -1.07558 0.157881
-2.39197 2.71538 0.580599
-2.30652 2.50145 0.704393
-2.49901 2.75981 0.838906
-2.29916 2.60419 0.356278
-3.03314 3.48015 -0.329609
-3.0013 3.63469 -0.0882887
-3.19085 3.7252 -0.324681
-3.28809 3.60354 -0.534505
-2.91907 -1.42618 0.976741
-3.10603 -1.46338 0.720405
-3.03567 -1.16423 1.03796
--1.89338 -0.686378 1.0458
--2.98717 2.59789 -0.546802
--2.91852 3.59598 -0.103188
--2.10196 0.802975 -0.627258
--2.07143 1.04115 -0.494572
-3.71608 0.214891 -0.928515
-3.52728 0.0117537 -1.00289
-3.9196 0.432453 -0.841141
-3.79378 -0.0216493 -0.745151
--3.39165 0.28215 0.990615
--3.46821 0.049142 0.804971
--3.17466 0.429606 1.16422
--4.31576 2.31431 -0.156922
--4.08933 2.23466 -0.386964
-0.489774 -3.04492 -0.528126
--0.0491051 -2.47482 -0.284572
--0.106816 -2.38719 -0.00617952
-4.10808 0.133857 -0.393448
-4.00834 -0.200317 -0.168604
-3.966 -0.0939444 -0.434348
-3.96944 0.193297 -0.662922
--1.97006 -1.08846 -1.07646
--2.11733 -0.841206 -1.06313
--1.79887 -0.797267 -1.00332
--1.69038 -1.06764 -1.00967
-3.01407 3.82122 0.51079
-1.70308 -3.02515 0.807143
-1.50625 -2.85997 1.02444
--2.44454 -1.98341 -0.488616
--2.56059 -2.04087 -0.204201
--2.62185 -1.80532 -0.627859
-6.06827 4.3494 -0.555338
-5.99951 4.06054 -0.506586
-5.76495 4.2196 -0.709571
-6.30883 4.42189 -0.38052
-6.3331 4.17427 -0.211343
--2.26998 0.652422 1.13866
--2.39119 0.946479 1.18099
--2.38171 0.417202 1.19089
--1.31138 -0.580318 -0.605914
-4.96424 6.43441 1.52176
-4.93994 6.57882 1.29737
-4.93025 6.20864 1.6971
-2.98566 -1.89651 0.402875
-2.99504 -1.71947 0.629113
-2.80832 -1.98483 0.65407
-2.81584 -2.18673 0.372125
-2.94659 -2.06608 0.132394
-3.11419 -1.77568 0.181057
-3.40603 -0.49194 -0.910627
-3.34842 -0.210649 -1.05994
-3.60165 -0.278384 -0.817812
-3.18387 -0.663541 -1.03314
-5.34814 3.81044 -0.833436
-5.60963 3.60887 -0.649464
-5.49652 4.06618 -0.807599
--2.29419 -1.84626 -0.739208
-4.27438 5.84754 1.07025
--3.89592 0.631513 0.356508
--1.85793 1.23741 0.272008
--2.984 3.48143 1.25566
--4.03153 1.21798 0.708225
--2.74645 2.22476 1.27591
--3.02474 1.65309 -0.747063
--4.41029 3.70975 -0.17619
--4.24984 3.46726 -0.388549
--3.9372 4.02485 1.2545
--3.69259 4.14444 1.14672
--4.52043 3.81682 0.985501
--4.31262 3.86658 1.18948
--4.5472 3.57001 1.13125
-2.44903 -1.19904 1.35848
-2.1307 -1.35446 1.40226
-2.13544 -1.68333 1.31809
-1.42649 -1.36861 -1.50427
-1.49517 -1.09155 -1.46585
-1.78291 -1.39196 -1.50053
-1.57302 -1.63208 -1.53184
-1.26792 -1.69797 -1.54083
-1.14698 -1.30492 -1.44573
-2.55436 -2.74804 -0.0997885
-0.921482 -0.354725 -0.900431
-1.15208 -0.420503 -1.12993
-0.857148 -0.620642 -1.01832
-0.664955 -0.576517 -0.780862
-0.745309 -0.321461 -0.640641
-1.59308 -0.806716 -1.42613
-1.30754 -0.787314 -1.34896
-1.41082 -0.525132 -1.30332
-1.83431 -0.672451 -1.43214
-2.42403 0.251906 -1.33976
-2.32673 0.539772 -1.27671
-2.6952 0.391476 -1.32637
-2.65679 0.0367015 -1.34841
-2.37856 -0.108905 -1.37896
-2.15656 0.129054 -1.33176
--1.18888 -0.91227 0.646598
-0.882412 -0.0881433 -0.609349
-0.770957 -0.0798789 -0.342377
-2.52635 1.48861 1.51161
-2.25694 1.59913 1.30019
-2.37271 1.25519 1.47863
-2.66099 1.21726 1.60642
-2.81597 1.47105 1.63468
-2.79342 1.72577 1.59674
-2.4746 1.72046 1.42371
-4.91798 1.28038 0.273861
-5.0631 1.52727 0.316951
-4.86126 1.27644 0.681867
-4.80274 1.09753 0.442662
-4.75925 1.02914 0.111535
-4.9793 1.45803 -0.000749401
-1.84918 -3.27852 -0.353527
-1.87097 -3.13772 -0.730805
-1.79138 1.54489 -0.338139
-1.81327 1.33966 -0.599624
-3.78526 4.68329 -0.270443
-3.85384 4.92469 -0.140512
-4.05985 5.06709 -0.291874
-2.06778 -1.96345 1.25563
-3.70795 4.43073 -0.38155
-3.62239 4.61083 -0.0906214
-7.05587 5.36537 0.173371
-2.17179 2.35933 0.483175
-2.12679 2.18635 0.686334
-2.15588 2.35987 0.214716
-1.99257 2.04606 0.475675
-1.4513 1.10998 -0.128141
-1.32219 0.866066 -0.210534
-1.52076 1.27825 0.175661
-7.12196 5.61765 0.432257
-7.13462 5.63835 0.79101
-7.13779 5.3273 0.595929
-1.96244 1.88422 0.690245
-2.00865 2.11079 0.237972
-3.22209 2.39594 -1.03568
-3.09851 2.70525 -0.874481
-3.54576 2.88453 -0.996488
-5.97331 4.01783 1.655
-6.23816 4.18383 1.52577
-6.04459 4.34565 1.77096
-6.03504 3.75551 1.43031
-4.85426 1.95583 1.36929
-4.88441 2.27495 1.52269
-2.16662 2.30798 -0.0584886
-2.85463 3.48906 0.0797035
-4.36641 5.55982 -0.261211
-4.30659 5.70868 -0.048627
-4.54324 5.77112 -0.29545
-4.5239 5.46645 -0.465143
-3.56399 4.66754 0.890619
-3.63094 4.58997 1.15028
-1.31461 0.223415 -0.891566
-3.49211 -0.812993 0.779936
-3.20112 -1.23358 0.802344
-4.43517 2.7246 -1.03336
-4.13248 2.67651 -1.0835
-4.29889 3.03756 -1.04986
-4.32493 2.41509 -1.04704
--2.28032 1.36122 -0.539877
--2.07389 1.27868 -0.367909
--1.91479 -0.240171 -0.882894
--1.80039 -0.486833 -0.911414
-3.8584 -0.527549 0.166608
-4.00153 -0.283244 0.10977
-3.8231 -0.563548 -0.0719835
-7.07053 5.59914 1.12616
-6.93117 5.76231 1.38495
-4.4582 0.519046 0.423817
-4.48699 0.548742 0.152924
-4.62911 0.787241 0.227771
-4.04256 -0.111969 0.554354
--3.08706 -0.963685 0.706624
--2.21908 -2.10991 0.280895
--1.87545 -2.0957 0.296578
--2.08609 -2.02663 0.505274
--2.29524 -2.13855 -0.00481676
--2.01344 -2.15349 0.0464491
--3.26443 0.245008 -0.711839
--1.81299 1.01893 0.471673
-2.44308 -2.45355 0.732953
--3.15642 -1.15528 0.477426
--3.22291 -1.24522 0.14199
--2.0714 1.7205 0.0107002
--2.63485 -0.54142 1.10784
--4.00284 2.61531 1.40843
--4.21123 2.49355 1.23522
--3.89522 2.91285 1.5159
--3.73421 2.07515 1.37392
--2.61346 3.22496 0.187374
--2.33161 1.24054 1.11659
--3.20136 2.06015 -0.699392
--3.41658 2.33951 -0.663894
--3.2846 2.61073 -0.62382
--3.92793 3.62917 -0.467471
-0.932763 -1.33349 1.2523
-1.21468 -1.43739 1.3647
-0.697173 -1.20466 1.085
-0.702247 -1.51257 1.17191
-0.984833 -1.65444 1.3132
-4.29148 5.35702 1.52648
-4.48527 5.30227 1.72982
-4.70681 5.48 1.83156
--1.13707 -1.18549 0.635993
--0.940551 -1.26767 0.405044
-3.17393 -0.948401 -0.923305
-2.93503 -0.799032 -1.16505
-3.13595 -0.392096 -1.14549
-3.05366 1.16856 -1.24781
-3.64599 1.29417 -1.16887
-2.19474 1.14273 -1.04246
-1.86283 1.13158 -0.812356
-2.71438 -1.08043 1.29166
-2.46136 -0.881258 1.43992
-2.176 -1.04017 1.45652
-3.57308 1.21911 1.67994
-3.29939 1.06231 1.68362
-3.69656 0.955089 1.58606
-3.84272 1.42387 1.67103
-3.24597 1.37705 1.71614
-3.09243 2.12565 -1.07241
-5.60786 3.32385 -0.547914
-5.85521 3.40983 -0.329565
-5.55673 3.04266 -0.465128
-5.31726 3.20608 -0.728994
-3.51775 4.38546 -0.163124
-3.33964 4.15832 -0.103068
-3.9345 3.83269 1.77134
-4.20448 4.11555 1.84824
-5.80742 3.13501 -0.193377
-5.61141 2.81739 -0.242531
-1.62973 1.20718 -0.446421
-2.34045 -2.75764 0.581962
-2.65502 -2.31421 0.552283
-0.807092 -0.12324 0.548428
-5.62661 4.47492 -0.805358
-5.03009 5.07086 2.03718
-4.77233 4.9352 1.9674
-5.07227 4.76557 2.05017
-5.33643 4.99678 2.08818
-4.1407 5.38491 1.30771
-4.19171 5.62116 1.17016
-3.99973 5.33233 1.08836
-4.03717 5.13834 1.3446
--2.0196 -1.70639 -0.879159
--1.94131 -1.90515 -0.684687
--1.76841 -1.58993 -0.905342
-4.72516 6.44662 1.21841
-4.73792 6.57493 0.915771
-3.68287 4.18187 -0.526314
-3.50624 4.1701 -0.351124
-3.90995 4.2848 -0.642594
-3.70735 3.95738 -0.66932
-2.93633 -1.07939 -1.07913
--3.20956 4.09792 0.063764
--3.50183 4.17958 -0.0142002
-3.91306 -0.155595 0.788118
--4.39097 2.09575 0.146491
-0.184576 -2.77154 -0.463524
-0.0870141 -2.71703 -0.193715
-0.219426 -2.60801 -0.775769
-4.20285 3.82822 1.88007
-4.25872 3.538 1.90751
-4.49702 3.79386 1.94889
--1.57328 -2.03973 -0.222727
--1.7838 -2.02128 -0.456646
--1.49434 -1.90895 -0.46828
--0.957513 -1.3728 -0.447891
--1.20402 -1.4363 -0.67009
-6.83616 6.17327 1.25295
-7.00706 5.93239 1.10711
--3.41004 -0.242093 0.708752
--3.56609 -0.173589 0.451116
--3.90355 0.773166 -0.0564864
-3.3433 -1.3011 -0.351382
-3.25465 -1.53753 -0.15651
-3.19202 -1.43629 -0.547186
-3.41507 -1.27939 -0.0436594
-2.98183 -0.522819 1.37626
-5.9832 3.18839 0.141472
-5.77964 2.88845 0.0259852
--2.13926 -2.01567 -0.53657
--1.9672 -2.11993 -0.265938
--2.25909 -2.10993 -0.274683
--1.79485 -0.94831 1.02389
--1.57427 -1.12795 0.944994
--2.06365 -1.07664 1.07462
--1.80838 -1.26245 1.01602
--3.83176 2.09083 -0.547069
--3.86997 1.74371 -0.481612
--1.94632 1.44485 0.0887583
--1.96622 1.51643 0.384777
--4.32638 3.59105 1.34152
--3.22813 4.02811 1.09674
--4.08072 2.20495 1.22251
--3.46697 2.1126 1.44245
--3.29245 1.78538 -0.723477
--3.63377 1.80859 -0.628613
--3.51612 2.06123 -0.667671
--3.46311 4.20389 0.989019
-1.49452 -0.115509 1.29499
-1.75305 -0.0357478 1.41123
-0.768827 -1.40298 -1.34296
-0.556678 -1.30991 -1.18129
-0.898478 -1.15196 -1.30738
-1.01361 -1.54357 -1.47238
-0.702543 -1.68077 -1.39488
-1.09328 -0.664853 -1.20743
-1.18661 -1.02369 -1.3797
--1.42558 -0.33841 0.641049
-6.05708 6.63049 1.50038
-6.41749 6.64977 1.16437
-6.22387 6.81625 0.942876
-3.09076 1.62294 1.70022
-4.52234 1.67209 -0.815015
-4.28146 1.77505 -0.987945
-4.7855 1.72238 -0.598852
-2.49956 2.93473 0.47466
-2.64666 3.19735 0.414795
-5.36114 4.70226 2.06292
-5.6335 4.97865 2.08567
-5.28675 2.02038 0.791557
-2.77353 3.41595 0.378211
-2.95748 3.57676 0.873368
-2.88726 3.59112 0.567287
-5.71434 5.57136 2.13322
-5.60691 5.27755 2.12246
-3.97017 3.55059 1.82765
-4.10181 3.25591 1.87995
-4.41362 3.24039 1.9119
-4.15012 5.50191 -0.00880473
-4.30526 5.8667 0.152321
-4.4775 5.92667 -0.0920593
--3.48564 3.36832 1.55142
--3.64021 3.07456 1.56285
-1.19266 -0.18378 -1.03496
-1.35133 0.0175528 -1.04411
-0.221046 -1.87146 0.890689
-0.227082 -2.15703 0.861571
-0.450742 -1.91364 1.08247
-0.382439 -1.64119 1.00028
-0.0408999 -1.72004 0.681575
-0.0321474 -2.01193 0.663585
-4.94411 6.68435 1.06579
-2.12227 1.99626 0.902725
-2.2774 2.30864 0.883211
-3.47658 3.86628 -0.539858
-3.53121 3.63415 -0.711546
-0.383882 -2.43701 0.904313
--0.0119596 -2.44544 0.307758
-0.0438695 -2.63832 0.0917509
-0.0047199 -2.24636 0.530223
--0.141071 -2.1755 0.263726
-0.952041 -1.84257 -1.50654
-0.745924 -2.07318 -1.4291
-1.07238 -2.11443 -1.52431
--2.67241 -1.67249 0.712594
--2.69159 -1.85502 0.484789
--1.74437 -2.11499 -0.0390346
--1.59144 -2.04819 0.192405
--3.23048 -0.613651 0.726188
--3.1003 0.484134 -0.812179
--1.73891 -1.97595 0.500675
--2.26099 -1.31324 1.03791
--1.92367 1.23808 -0.129631
--4.64713 3.51719 0.0411152
-1.80291 -2.0016 1.32456
-1.85548 -1.59922 1.39789
-4.70161 5.67007 -0.485873
-4.31853 5.26837 -0.413047
-6.47695 4.35871 1.38263
-6.57226 4.6753 1.52743
-2.04855 -0.472272 -1.41666
-4.00005 0.924923 -0.951886
-2.25363 0.848354 -1.17504
-1.97693 0.94876 -1.00173
-1.63528 -3.25353 -0.648317
-4.19376 0.656773 1.13759
-4.35117 0.605262 0.880451
-4.23031 0.368505 0.823966
-4.49884 0.67108 0.643434
-4.20074 4.22861 -0.813157
-4.19619 5.10754 1.55477
-4.38704 5.0511 1.74036
-3.99278 4.88077 1.4551
-4.18852 4.84039 1.66155
-2.59518 -1.9158 -1.03502
-1.8139 1.71736 0.507648
-1.6818 1.54618 0.289751
-0.336473 -0.750648 0.31608
-5.87675 2.93202 0.325721
-3.67806 2.98568 1.78283
-3.53653 3.25716 1.6805
-3.65639 2.68115 1.79697
-3.98036 2.95554 1.85837
-3.81875 3.25468 1.80484
-2.36931 1.92379 1.26401
-2.15654 1.79216 1.10497
-1.95369 1.69345 0.886935
-2.00576 1.52792 1.08257
-2.0952 2.04456 -0.309954
-4.51107 0.874528 0.904642
-0.610712 -0.311749 -0.307799
--1.74496 -1.33763 -0.997484
--1.45212 -1.25074 -0.889817
-0.661269 -1.04324 -1.11131
-0.634762 -0.824682 -0.948262
-0.918939 -0.88082 -1.20299
-0.372291 -1.21874 -0.975902
-2.58019 -0.607671 -1.35187
-2.87306 -0.523565 -1.25403
-2.34672 -0.40951 -1.40023
-2.67291 -0.281842 -1.3442
--4.46605 2.6595 -0.0750197
-3.64734 -0.497828 0.857082
-3.52848 -0.351629 1.10692
-3.28093 -0.491017 1.22485
--0.213742 -2.13849 -0.0684245
--1.48472 -0.937236 -0.902424
--1.56183 -0.668097 -0.857501
-1.63334 1.38087 0.535899
-1.63206 1.44375 -0.0133946
--2.48138 -2.03242 0.336024
--1.2438 -1.85587 -0.27945
--1.68491 -1.80091 -0.719222
--1.41968 -1.70717 -0.658728
-2.95214 -0.959692 1.21211
-2.75378 -0.766303 1.38522
-4.66517 5.16481 1.88339
-1.87003 -0.939994 1.47548
-1.86338 -1.26014 1.44671
-2.1231 -0.721096 1.50286
-1.82562 -0.617931 1.47843
--1.34774 -1.30235 0.793023
--1.14457 -1.46044 0.574023
--1.45534 -0.113742 0.557684
-1.79229 1.53257 0.740421
-3.43772 0.802948 1.61639
-3.20445 0.640149 1.6245
-3.56751 0.536357 1.5004
-1.59329 0.376284 1.21677
-1.73238 0.635661 1.2334
-5.22833 6.33029 -0.43389
-4.96776 6.38157 -0.23813
-5.1791 6.547 -0.200233
-5.44141 6.49044 -0.364217
-5.51654 6.24094 -0.571262
-2.92746 3.66704 0.275867
-6.34654 6.54281 1.43326
-3.25039 -1.5602 0.11322
-2.85944 -2.23279 -0.0732012
-4.38275 2.07604 -0.991394
-4.09042 2.18951 -1.09581
-5.75814 4.29225 1.89287
-2.74832 2.85199 -0.505114
-3.68766 4.82552 0.0631025
-3.83732 5.08283 0.0925874
-3.69807 4.9538 0.298257
-1.55969 0.266167 -1.0613
-2.91261 0.661908 1.64556
-3.02363 0.943336 1.67299
-2.71551 0.953587 1.63465
-2.60253 0.688273 1.61557
-2.74231 0.398447 1.61799
-6.48291 4.13995 1.12826
-6.70707 4.56524 1.22483
-0.504343 -0.578583 0.460941
-0.0467313 -1.11571 -0.419416
-0.169507 -1.20597 -0.739227
--0.0723879 -1.34365 -0.513731
--0.177271 -1.31162 -0.246719
-4.90379 6.17759 -0.356758
-5.3405 6.02825 -0.644789
-2.78225 1.00994 -1.2548
-3.13091 -1.69876 -0.320607
-4.47499 4.07246 1.94158
-0.412326 -0.980694 -0.828668
-3.34711 3.95865 -0.327486
-3.37465 -1.32531 0.249912
-3.19526 -1.53907 0.43947
--2.2061 0.251646 -0.857804
-0.247761 -2.9145 -0.0117359
-0.455752 -3.07293 0.163174
-0.219303 -2.8124 0.28056
--1.48099 -1.50251 -0.829242
-5.93164 3.68532 -0.40056
-6.05283 3.4355 -0.0316498
-6.79265 5.63829 1.61471
-6.6083 5.84948 1.74583
-5.951 6.69825 -0.100776
-5.75294 6.59186 -0.28301
-5.71199 6.79355 0.0184065
-6.05111 6.49981 -0.316511
--0.999869 -1.56258 0.343525
-2.67989 -0.484584 1.48402
-2.39535 -0.594343 1.50711
-6.29584 6.36949 1.66271
-6.57645 6.28739 1.50741
-6.01081 6.43817 1.73173
-6.13006 6.19322 1.87146
-6.45407 6.10996 1.74697
-0.730679 -0.395163 0.688005
-2.87083 0.71092 -1.29382
-3.12719 0.869261 -1.26455
-3.02126 0.42801 -1.28565
-2.57405 0.67679 -1.28791
-4.12177 0.651651 -0.747676
-0.586553 -2.46589 -1.23518
-1.89981 0.176955 1.44263
-0.555262 -0.703911 0.683419
-3.34187 0.283585 -1.17247
-6.18166 6.82179 0.350148
-6.16875 6.72622 0.0688665
-3.82576 0.111321 1.13027
-5.74637 3.87107 -0.634074
-3.65573 -0.864897 -0.0280244
--2.03556 -0.58493 -1.00781
--0.962678 -1.58874 -0.308596
--1.18427 -1.67338 -0.492639
--0.787314 -1.42904 -0.102052
--1.0209 -1.73883 -0.101643
--1.37145 -1.59448 0.686084
--1.23301 -1.73376 0.442084
-4.84478 2.5234 1.65528
-6.46945 3.96742 0.835967
-6.62786 4.19802 0.655412
-4.71108 3.26124 -0.986653
-1.30906 -1.7287 1.38482
-1.61143 -1.80982 1.38709
-1.54339 -1.48862 1.4185
-1.29118 -2.01526 1.36748
-4.65175 6.3784 0.141357
-4.82002 6.59405 0.263494
-4.85959 6.47672 -0.0217641
-4.69028 6.24067 -0.0947652
-4.4889 6.1068 0.083698
-4.40184 3.33694 -1.02265
--1.56747 0.433475 -0.0436031
--1.63338 0.389874 -0.302603
--0.197666 -1.59359 -0.459092
--0.0779926 -1.7566 -0.692614
-1.4817 -0.365115 1.34121
-5.89633 6.08441 1.98954
-6.27472 5.93005 1.93426
-4.01904 0.114727 0.901652
-3.75072 -0.182644 0.995939
-2.45719 2.54729 0.980497
-0.693332 -0.804017 0.916064
-1.1272 0.176144 -0.715731
-3.00945 -1.5491 -0.759985
-3.18123 -1.20069 -0.769402
-0.0274662 -1.46365 -0.748285
--2.56225 -2.0567 0.0780375
-1.58256 -1.2015 1.43451
-3.05691 -1.88918 -0.116947
-3.98267 2.93008 -1.0623
-4.6792 6.03583 -0.248493
-2.43685 0.363819 1.5864
-3.70348 3.52556 1.71342
-1.83603 0.411313 1.36829
-5.65818 4.66438 2.02439
-3.8853 5.05031 1.16876
-4.65334 0.869003 0.51696
-6.53091 4.59908 -0.233095
-6.75779 6.01931 1.50915
-6.63874 6.43303 1.24419
-3.60485 2.39428 1.79237
-3.33376 2.35303 1.72613
-5.03487 6.65485 0.0779902
-5.29225 6.72323 -0.00264884
-0.682554 -1.77132 1.21017
-5.51032 6.67496 -0.162077
--1.35356 -1.96607 -0.0531971
--1.33195 -1.92089 0.21685
--1.4832 -1.88243 0.477699
-5.73332 6.39403 -0.474629
-2.97807 1.23731 1.6815
-3.50333 4.35091 1.14806
-1.24969 -2.30845 1.31772
-1.48173 -2.51244 1.2417
-1.55307 -2.18502 1.33192
-0.431625 -2.95125 0.442724
-2.07865 -0.396464 1.52085
-4.21847 1.47618 -0.959538
-3.93133 1.58264 -1.1044
-4.21127 1.13045 -0.866204
-3.95771 1.26871 -1.05316
-4.82686 1.23036 -0.0898065
-4.61541 0.865908 -0.120677
-4.78625 1.39445 -0.375139
-4.20963 1.65646 1.62192
-4.45 1.51805 1.43825
-3.9058 5.31517 0.79878
-6.26591 3.9462 1.29562
-6.53298 6.28967 -0.20737
-6.53832 6.5005 0.0566181
-5.2032 1.76706 0.403345
-5.13831 1.71867 0.0509462
-5.12024 1.87673 -0.232021
-5.28893 2.02777 -0.0236116
-2.50009 0.962039 -1.21678
-2.03612 0.676161 -1.14653
-5.75137 6.29458 1.88841
-6.15442 3.93536 -0.286305
--1.09909 -1.78527 0.138912
--0.86237 -1.54507 0.114611
-5.17196 6.2783 1.78999
-4.97714 5.96315 1.8617
-4.0028 5.50798 0.687783
-3.98686 5.46925 0.434364
-3.81488 4.81064 1.26534
-4.50567 4.8653 1.86085
-2.62118 2.36918 1.30126
-4.28542 4.64589 1.78728
-4.33502 4.36976 1.86662
-4.5518 4.60332 1.92335
-4.04779 3.78449 -0.895859
-3.9688 4.04129 -0.780688
-4.29203 3.95453 -0.916237
-6.2876 6.81621 0.640181
-3.68368 3.79203 1.63444
-4.81931 4.65532 2.00249
-1.88246 -1.74879 -1.47807
-4.76888 6.62329 0.57421
-1.12509 -3.16951 -0.84588
-1.90506 1.29572 1.09971
-2.15641 1.36484 1.30612
-4.61852 4.32858 1.96643
-6.7159 6.48222 0.952146
-4.12571 5.62118 0.224686
-3.98719 5.36739 0.167796
-1.34817 -2.00593 -1.55841
-3.05651 3.84653 0.148626
-3.1696 3.89738 -0.0939009
-5.75799 6.68102 1.50991
-1.79773 0.653071 -1.02854
-2.29958 2.10351 1.08738
--0.128184 -1.90268 0.439787
-3.26969 2.06654 1.72671
-5.19114 6.66123 1.38853
-5.91983 5.24911 2.09809
-3.86438 -0.399574 -0.28046
-3.70682 -0.53187 -0.484605
-3.78908 -0.274399 -0.578751
-2.44256 2.32066 1.13015
--1.55262 -0.424198 -0.738876
-6.05052 5.80848 2.05129
-2.07142 0.401857 -1.24737
-4.02043 1.88971 -1.1004
-3.71078 1.88293 -1.16101
-3.84766 5.21151 0.332386
-1.77662 -0.317695 1.45267
-0.989911 -1.94255 1.32892
-2.41566 0.976127 1.54442
-2.33499 0.63801 1.55087
-5.49068 4.38816 1.99693
-4.95415 1.60811 -0.276694
-5.80811 6.08693 -0.657578
-5.8141 3.47802 1.46329
-5.1395 5.46839 -0.750583
-5.67682 5.37944 -0.807399
-3.34488 2.64026 1.69784
-0.23951 -1.48039 -1.0031
-3.39468 4.10375 1.18297
-5.18786 4.71238 -0.881035
-5.34286 4.36839 -0.87583
-6.67348 4.35049 0.962775
-4.7061 1.52652 1.2247
-6.2992 6.54826 -0.12266
-6.5045 6.67914 0.867196
-3.99441 5.21358 -0.0625023
-4.1803 5.3428 -0.213286
-4.06848 5.54374 0.950084
-6.85965 4.62002 0.860343
-6.42626 6.67904 0.269565
-1.00366 -3.2753 -0.567987
-1.60287 1.31145 -0.22993
-6.01536 5.53762 2.09694
-4.62302 1.213 1.0716
-4.68684 1.06266 0.793353
-6.41069 5.6685 1.9289
-1.01531 -2.64462 -1.33261
-1.16134 -2.37991 -1.47818
-1.27247 -2.99597 -1.09768
-1.0272 -2.88095 -1.16509
-0.586194 -2.92571 0.674941
-1.43883 -3.16763 -0.87223
-1.05392 -0.07426 -0.833896
-0.831701 -2.37767 -1.39552
--0.178126 -1.37501 0.202387
-2.10804 1.10872 1.35497
-1.80263 0.372686 -1.15221
-1.54626 -0.628755 1.40473
--0.821186 -1.21034 -0.252178
-6.25101 5.59041 -0.675114
-4.29624 2.96824 1.88425
-2.96901 -1.34288 -0.937122
+#ifndef _MGL_CONFIG_H_
+#define _MGL_CONFIG_H_
+
/* This define enables double precision in MathGL */
#define MGL_USE_DOUBLE ${MGL_USE_DOUBLE}
#define MGL_HAVE_PYTHON ${MGL_HAVE_PYTHON}
#define MGL_HAVE_OCTAVE ${MGL_HAVE_OCTAVE}
#define MGL_HAVE_DOC ${MGL_HAVE_DOC}
+
+#endif
//-----------------------------------------------------------------------------\r
struct mglTexture\r
{\r
- mglColor col[514];\r
- long n; ///< Number of initial colors along u\r
+ mglColor col[514]; ///< Colors itself\r
+ long n; ///< Number of initial colors along u\r
+\r
+ char Sch[260]; ///< Color scheme used\r
+ int Smooth; ///< Type of texture (smoothing and so on)\r
+ float Alpha; ///< Transparency\r
+ \r
mglTexture() { n=0; }\r
mglTexture(const char *cols, int smooth=0,float alpha=1)\r
{ n=0; Set(cols,smooth,alpha); }\r
{ const mglPnt &p=Pnt[i]; return mglPoint(p.x,p.y,p.z); }\r
inline float GetClrC(long i) { return Pnt[i].c; }\r
inline long GetPntNum() { return Pnt.size(); }\r
- inline mglPnt GetPnt(long i) { return Pnt[i]; }\r
+ inline mglPnt &GetPnt(long i) { return Pnt[i]; }\r
inline mglPrim &GetPrm(long i) { return Prm[i]; }\r
inline long GetPrmNum() { return Prm.size(); }\r
- inline mglText GetPtx(long i) { return Ptx[i]; }\r
+ inline mglText &GetPtx(long i) { return Ptx[i]; }\r
inline long GetPtxNum() { return Ptx.size(); }\r
- inline mglTexture GetTxt(long i){ return Txt[i]; }\r
+ inline mglTexture &GetTxt(long i){ return Txt[i]; }\r
inline long GetTxtNum() { return Txt.size(); }\r
/// Scale coordinates and cut off some points\r
virtual bool ScalePoint(mglPoint &p, mglPoint &n, bool use_nan=true);\r
virtual float text_plot(long p,const wchar_t *text,const char *fnt,float size=-1,float sh=0,float col=-('k'),bool rot=true)=0;\r
void vect_plot(long p1, long p2, float s=1);\r
inline float mark_size() { return MarkSize*font_factor; }\r
- inline char last_color() { return *last_style; }\r
+// inline char last_color() { return last_style[1]; }\r
+ inline const char *last_line() { return last_style; }\r
\r
protected:\r
mglPoint FMin; ///< Actual lower edge after transformation formulas.\r
//-----------------------------------------------------------------------------\r
class mglData;\r
class mglParser;\r
+class mglFormula;\r
typedef mglBase* HMGL;\r
typedef mglData* HMDT;\r
typedef mglParser* HMPR;\r
+typedef mglFormula* HMEX;\r
typedef const mglDataA* HCDT;\r
#else\r
typedef void *HMGL;\r
typedef void *HMDT;\r
+typedef void *HMEX;\r
typedef void *HMPR;\r
typedef const void *HCDT;\r
#endif\r
void mgl_legend(HMGL gr, int where, const char *font, float size, float llen);\r
void mgl_set_legend_marks(HMGL gr, int num);\r
\r
+HMEX mgl_create_expr(const char *expr);\r
+void mgl_delete_expr(HMEX ex);\r
+mreal mgl_expr_eval(HMEX ex, mreal x, mreal y,mreal z);\r
+mreal mgl_expr_eval_v(HMEX ex, mreal *var);\r
+mreal mgl_expr_diff(HMEX ex, char dir, mreal x, mreal y,mreal z);\r
+mreal mgl_expr_diff_v(HMEX ex, char dir, mreal *var);\r
\r
void mgl_show_image(HMGL gr, const char *viewer, int keep);\r
void mgl_write_frame(HMGL gr, const char *fname,const char *descr);\r
void mgl_legend_(uintptr_t *gr, int *where, const char *font, float *size, float *llen,int l);\r
void mgl_set_legend_marks_(uintptr_t *gr, int *num);\r
\r
+uintptr_t mgl_create_expr_(const char *expr, int);\r
+void mgl_delete_expr_(uintptr_t *ex);\r
+float mgl_eval_expr_(uintptr_t *ex, float *x, float *y,float *z);\r
+float mgl_diff_expr_(uintptr_t *ex, const char *dir, float *x, float *y,float *z, int);\r
\r
void mgl_show_image_(uintptr_t *graph, const char *viewer, int *keep, int);\r
void mgl_write_frame_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld);\r
void mgl_write_gif_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld);\r
void mgl_start_gif_(uintptr_t *graph, const char *fname,int *ms,int l);\r
void mgl_close_gif_(uintptr_t *graph);\r
-void mgl_write_obj_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld);\r
+void mgl_write_obj_(uintptr_t *graph, const char *fname,const char *descr, int *use_png,int lf,int ld);\r
void mgl_write_stl_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld);\r
void mgl_write_off_(uintptr_t *graph, const char *fname,const char *descr,int *colored,int lf,int ld);\r
void mgl_write_xyz_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld);\r
int mgl_qt_run_();\r
/*****************************************************************************/\r
void mgl_wnd_set_delay(HMGL gr, float dt);\r
-void mgl_setup_window(HMGL gr, int autoclf, int showpos, int clf_upd);\r
+void mgl_setup_window(HMGL gr, int clf_upd, int showpos);\r
void mgl_wnd_toggle_alpha(HMGL gr);\r
void mgl_wnd_toggle_light(HMGL gr);\r
void mgl_wnd_toggle_zoom(HMGL gr);\r
/*****************************************************************************/\r
void mgl_get_last_mouse_pos_(uintptr_t *gr, float *x, float *y, float *z);\r
void mgl_wnd_set_delay_(uintptr_t *gr, float *dt);\r
-void mgl_setup_window_(uintptr_t *gr, int *autoclf, int *showpos, int *clf_upd);\r
+void mgl_setup_window_(uintptr_t *gr, int *clf_upd, int *showpos);\r
void mgl_wnd_toggle_alpha_(uintptr_t *gr);\r
void mgl_wnd_toggle_light_(uintptr_t *gr);\r
void mgl_wnd_toggle_zoom_(uintptr_t *gr);\r
// flags for internal use only\r
#define MGL_DISABLE_SCALE 0x000200 ///< Temporary flag for disable scaling (used for axis)\r
#define MGL_FINISHED 0x000400 ///< Flag that final picture (i.e. mglCanvas::G) is ready\r
-#define MGL_AUTO_CLF 0x000800 ///< Clear canvas between drawing\r
+//#define MGL_AUTO_CLF 0x000800 ///< Clear canvas between drawing\r
#define MGL_SHOW_POS 0x001000 ///< Switch to show or not mouse click position\r
#define MGL_CLF_ON_UPD 0x002000 ///< Clear plot before Update()\r
//#define MGL_HIGHLIGHT 0x004000 ///< Highlight plot\r
inline void Stop() { mgl_parser_stop(pr); }\r
};\r
//-----------------------------------------------------------------------------\r
+/// Wrapper class expression evaluating\r
+class mglExpr\r
+{\r
+ HMEX ex;\r
+public:\r
+ mglExpr(const char *expr) { ex = mgl_create_expr(expr); }\r
+ ~mglExpr() { mgl_delete_expr(ex); }\r
+ inline mreal Eval(mreal x, mreal y=0, mreal z=0)\r
+ { return mgl_expr_eval(ex,x,y,z); }\r
+ inline mreal Eval(mreal var[26])\r
+ { return mgl_expr_eval_v(ex,var); }\r
+ inline mreal Diff(char dir, mreal x, mreal y=0, mreal z=0)\r
+ { return mgl_expr_diff(ex,dir, x,y,z); }\r
+ inline mreal Diff(char dir, mreal var[26])\r
+ { return mgl_expr_diff_v(ex,dir, var); }\r
+};\r
+//-----------------------------------------------------------------------------\r
#endif\r
/// Make inherited class and redefine Draw() function if you don't want to use function pointers.\r
struct mglDraw\r
{\r
- virtual int Draw(mglGraph *){} ///< Function for drawing\r
+ virtual int Draw(mglGraph *)=0; ///< Function for drawing\r
virtual void Reload() {} ///< Function for reloading data\r
#if MGL_HAVE_PTHREAD\r
pthread_t thr;\r
\r
inline void SetDelay(float dt) ///< Delay for animation in seconds\r
{ mgl_wnd_set_delay(gr, dt); }\r
- inline void Setup(bool autoclf, bool showpos, bool clf_upd)\r
- { mgl_setup_window(gr, autoclf, showpos, clf_upd); }\r
+ inline void Setup(bool clf_upd=true, bool showpos=false)\r
+ { mgl_setup_window(gr, clf_upd, showpos); }\r
inline mglPoint LastMousePos() ///< Last mouse position\r
{ mglPoint p; mgl_get_last_mouse_pos(gr,&p.x,&p.y,&p.z); return p; }\r
};\r
void SetSize(int w,int h);\r
void EndFrame();\r
const unsigned char *GetBits();\r
- void Clf(mglColor Back=NC);\r
inline int GetNumFig() { return NumFig; }\r
inline int GetCurFig() { return CurFig; }\r
void SetCurFig(int c);\r
void ClearFrames();\r
inline mglPoint GetMousePos() { return LastMousePos;} // stupid thing to pass G++ bug\r
inline void SetMousePos(mglPoint p) { LastMousePos=p; }\r
- inline void Setup(bool autoclf, bool showpos, bool clf_upd)\r
- { set(autoclf,MGL_AUTO_CLF); set(showpos,MGL_SHOW_POS); set(clf_upd,MGL_CLF_ON_UPD); }\r
+ inline void Setup(bool clf_upd=true, bool showpos=false)\r
+ { set(showpos,MGL_SHOW_POS); set(clf_upd,MGL_CLF_ON_UPD); }\r
\r
virtual void ToggleAlpha()=0; ///< Switch on/off transparency (do not overwrite user settings)\r
virtual void ToggleLight()=0; ///< Switch on/off lighting (do not overwrite user settings)\r
if(MGL_HAVE_PYTHON)
- INCLUDE(${SWIG_USE_FILE})
- INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
- SET(CMAKE_SWIG_FLAGS "-c++")
- SET_SOURCE_FILES_PROPERTIES(mgl.i PROPERTIES CPLUSPLUS ON)
-# SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall")
- SWIG_ADD_MODULE(mathgl python mgl.i ../include/mgl/type.h ../include/mgl/data.h ../include/mgl/mgl.h)
- SWIG_LINK_LIBRARIES(mathgl ${PYTHON_LIBRARIES})
+ configure_file(${MathGL_SOURCE_DIR}/lang/mgl.i ${MathGL_BINARY_DIR}/lang/mgl.i COPYONLY)
+ configure_file(${MathGL_SOURCE_DIR}/lang/numpy.i ${MathGL_BINARY_DIR}/lang/numpy.i COPYONLY)
+ SET(dep_libs mgl)
+ if(MGL_HAVE_FLTK)
+ get_property(path_to_mglwnd TARGET mgl-wnd PROPERTY LOCATION)
+ file(TO_NATIVE_PATH ${path_to_mglwnd} MGL_LIB_WND)
+ SET(dep_libs ${dep_libs} mgl-wnd)
+ endif(MGL_HAVE_FLTK)
+ get_property(path_to_mgl TARGET mgl PROPERTY LOCATION)
+ file(TO_NATIVE_PATH ${path_to_mgl} MGL_LIB)
+ file(TO_NATIVE_PATH ${MathGL_BINARY_DIR}/lang/mgl.i MGL_I)
+ file(TO_NATIVE_PATH ${MathGL_SOURCE_DIR}/include SRC_INC)
+ file(TO_NATIVE_PATH ${MathGL_BINARY_DIR}/include BIN_INC)
+ configure_file(${MathGL_SOURCE_DIR}/lang/setup.py.in ${MathGL_BINARY_DIR}/lang/setup.py)
+# file(COPY ${CMAKE_SOURCE_DIR}/lang/mgl.i ${CMAKE_SOURCE_DIR}/lang/numpy.i DESTINATION ${CMAKE_BINARY_DIR}/lang)
+# INCLUDE(${SWIG_USE_FILE})
+# INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
+# INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+# SET(CMAKE_SWIG_FLAGS "-c++")
+# SET_SOURCE_FILES_PROPERTIES(mgl.i PROPERTIES CPLUSPLUS ON)
+# SWIG_ADD_MODULE(mathgl python mgl.i ../include/mgl/type.h ../include/mgl/data.h ../include/mgl/mgl.h)
+# SWIG_LINK_LIBRARIES(mathgl ${PYTHON_LIBRARIES})
-# INSTALL_FILES(/lib/python2.7/dist-packages/ mathgl)
# add_custom_command(OUTPUT mgl_python.cpp mathgl.py
# COMMAND ${SWIG_EXECUTABLE} -python -c++ -I${CMAKE_SOURCE_DIR}/include -o mgl_python.cpp ${CMAKE_SOURCE_DIR}/lang/mgl.i
# MAIN_DEPENDENCY mgl.i
# IMPLICIT_DEPENDS CXX ../include/mgl/type.h ../include/mgl/data.h ../include/mgl/mgl.h
# )
-# add_custom_target(_mathgl.so ALL
-# COMMAND CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/setup.py build
-# DEPENDS ${CMAKE_BINARY_DIR}/lang/mathgl.py ${CMAKE_BINARY_DIR}/lang/mgl_python.cpp
-# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-# )
-# install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/setup.py install --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )")
+ add_custom_command(OUTPUT _mathgl.so mathgl.py
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/lang/setup.py build
+ DEPENDS ${dep_libs} ${CMAKE_BINARY_DIR}/lang/mgl.i ${CMAKE_BINARY_DIR}/lang/numpy.i
+ IMPLICIT_DEPENDS CXX ${CMAKE_SOURCE_DIR}/include/mgl/type.h ${CMAKE_SOURCE_DIR}/include/mgl/data.h ${CMAKE_SOURCE_DIR}/include/mgl/mgl.h
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lang
+ )
+ add_custom_target(mgl_python_module ALL DEPENDS _mathgl.so mathgl.py)
+ install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/lang/setup.py install --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lang )")
endif(MGL_HAVE_PYTHON)
--- /dev/null
+from distutils.core import setup, Extension
+import os
+
+try:
+ source_dir="${SRC_INC}"
+ binary_dir="${BIN_INC}"
+ mgl_i="${MGL_I}"
+ mgl_lib="${MGL_LIB}"
+ mgl_lib_wnd="${MGL_LIB_WND}"
+except KeyError:
+ source_dir="."
+ binary_dir="."
+# mgl_dir="src/.libs/libmgl.so"
+
+mgl_module = Extension('_mathgl',
+ sources=[mgl_i],
+ include_dirs=[binary_dir, source_dir],
+ swig_opts=[
+# "-outdir %s/lang" % binary_dir,
+ '-c++',
+ "-I%s" % binary_dir,
+ "-I%s" % source_dir],
+ extra_objects=[mgl_lib,mgl_lib_wnd]
+ )
+
+setup (
+ name = "mathgl",
+ version = "2.0",
+ maintainer="Dmitry Kulagin",
+ maintainer_email="dik@ufp.appl.sci-nnov.ru",
+ author="Alexey Balakin",
+ author_email= "mathgl.ablakin@gmail.com",
+ license="Same terms as MathGL",
+ platforms = ["any"],
+ url = "http://mathgl.sf.net",
+ description = "Python interface for MathGL",
+ long_description = "MathGL is a library for the plotting of the data \
+ MathGL is a free library of fast C++ routines for the plotting \
+ of the data varied in one or more dimensions. It uses OpenGL \
+ (www.opengl.org) for the plotting. Also there is a simple window \
+ interface based on GLUT. This provides high compatibility with \
+ any operating system (really any which has OpenGL-like libraries). \
+ Python interface for MathGL",
+ package_dir = {"": ""},
+ py_modules = ["mathgl"],
+ ext_modules = [mgl_module]
+ )
pref.get("internal_font",internal_font,0);\r
pref.get("auto_exec",auto_exec,1);\r
#ifdef USE_GETTEXT\r
-// setlocale (LC_ALL, "");\r
+// setlocale (LC_NUMERIC, "");\r
// bindtextdomain (PACKAGE, LOCALEDIR);\r
// textdomain (PACKAGE);\r
#endif\r
+++ /dev/null
--0.001 -0.006 32.97\r
-0.076 -0.074 33.13\r
-0.067 0.073 32.52\r
--0.078 0.064 32.72\r
--0.069 -0.083 33.36\r
-0.158 -0.149 33.19\r
-0.212 0.007 32.48\r
-0.143 0.155 31.93\r
--0.013 0.209 31.88\r
--0.16 0.14 32.34\r
--0.217 -0.016 33.03\r
--0.146 -0.165 33.64\r
-0.012 -0.22 33.7\r
-0.227 -0.217 33.16\r
-0.304 -0.074 32.48\r
-0.297 0.087 31.81\r
-0.211 0.225 31.37\r
-0.068 0.3 31.23\r
--0.094 0.294 31.41\r
--0.23 0.208 31.87\r
--0.305 0.065 32.51\r
--0.299 -0.097 33.19\r
--0.213 -0.235 33.79\r
--0.069 -0.309 33.97\r
-0.093 -0.302 33.71\r
-0.293 -0.285 33.03\r
-0.378 -0.152 32.37\r
-0.404 0.005 31.7\r
-0.37 0.16 31.12\r
-0.279 0.29 30.69\r
-0.144 0.374 30.52\r
--0.011 0.4 30.59\r
--0.166 0.366 30.87\r
--0.295 0.276 31.34\r
--0.379 0.142 31.93\r
--0.407 -0.015 32.58\r
--0.372 -0.17 33.22\r
--0.28 -0.3 33.78\r
--0.144 -0.385 34.08\r
-0.012 -0.411 33.96\r
-0.166 -0.375 33.58\r
-0.369 -0.372 32.72\r
-0.463 -0.241 32.06\r
-0.512 -0.084 31.39\r
-0.512 0.078 30.74\r
-0.461 0.233 30.19\r
-0.365 0.364 29.79\r
-0.233 0.46 29.57\r
-0.08 0.509 29.56\r
--0.083 0.509 29.72\r
--0.238 0.458 30.08\r
--0.368 0.363 30.57\r
--0.465 0.231 31.13\r
--0.515 0.076 31.76\r
--0.514 -0.088 32.41\r
--0.464 -0.243 33.01\r
--0.366 -0.375 33.53\r
--0.235 -0.47 33.95\r
--0.077 -0.519 33.95\r
-0.085 -0.517 33.69\r
-0.239 -0.466 33.25\r
-0.425 -0.449 32.24\r
-0.525 -0.322 31.65\r
-0.59 -0.176 30.98\r
-0.613 -0.017 30.35\r
-0.596 0.142 29.76\r
-0.537 0.292 29.25\r
-0.442 0.421 28.85\r
-0.317 0.521 28.62\r
-0.17 0.586 28.53\r
-0.011 0.61 28.61\r
--0.147 0.591 28.87\r
--0.297 0.534 29.25\r
--0.425 0.439 29.73\r
--0.525 0.315 30.28\r
--0.59 0.168 30.86\r
--0.613 0.008 31.49\r
--0.597 -0.153 32.08\r
--0.537 -0.303 32.66\r
--0.441 -0.432 33.16\r
--0.316 -0.531 33.56\r
--0.168 -0.595 33.69\r
--0.009 -0.617 33.5\r
-0.151 -0.6 33.16\r
-0.3 -0.54 32.74\r
-0.48 -0.539 31.4\r
-0.588 -0.42 30.82\r
-0.665 -0.279 30.23\r
-0.709 -0.124 29.6\r
-0.717 0.038 28.99\r
-0.69 0.197 28.41\r
-0.628 0.345 27.92\r
-0.534 0.476 27.52\r
-0.414 0.583 27.25\r
-0.273 0.66 27.12\r
-0.119 0.705 27.12\r
--0.041 0.713 27.28\r
--0.201 0.687 27.59\r
--0.349 0.624 28.01\r
--0.48 0.531 28.48\r
--0.587 0.412 29\r
--0.665 0.27 29.57\r
--0.709 0.116 30.13\r
--0.718 -0.047 30.7\r
--0.69 -0.206 31.29\r
--0.628 -0.356 31.85\r
--0.533 -0.487 32.4\r
--0.413 -0.593 32.78\r
--0.269 -0.671 32.96\r
--0.114 -0.714 32.79\r
-0.047 -0.722 32.52\r
-0.205 -0.694 32.2\r
-0.353 -0.629 31.83\r
+++ /dev/null
-from distutils.core import setup, Extension
-import os
-
-try:
- source_dir=os.environ["CMAKE_SOURCE_DIR"]
- mgl_dir="src/libmgl.so"
-except KeyError:
- source_dir="."
- mgl_dir="src/.libs/libmgl.so"
-
-mgl_module = Extension('_mathgl',
- sources=["lang/mgl_python.cpp"],
- include_dirs=["%s/include" % source_dir],
- extra_objects=[mgl_dir]
- )
-
-setup (
- name = "mathgl",
- version = "2.0",
- maintainer="Dmitry Kulagin",
- maintainer_email="dik@ufp.appl.sci-nnov.ru",
- author="Alexey Balakin",
- author_email= "mathgl.ablakin@gmail.com",
- license="Same terms as MathGL",
- platforms = ["any"],
- url = "http://mathgl.sf.net",
- description = "Python interface for MathGL",
- long_description = "MathGL is a library for the plotting of the data \
- MathGL is a free library of fast C++ routines for the plotting \
- of the data varied in one or more dimensions. It uses OpenGL \
- (www.opengl.org) for the plotting. Also there is a simple window \
- interface based on GLUT. This provides high compatibility with \
- any operating system (really any which has OpenGL-like libraries). \
- Python interface for MathGL",
- package_dir = {"": "lang"},
- py_modules = ["mathgl"],
- ext_modules = [mgl_module]
- )
SetFBord(Min.x+i*(Max.x-Min.x)/n, Min.y+j*(Max.y-Min.y)/n, Min.x);\r
SetFBord(Min.x+i*(Max.x-Min.x)/n, Min.y+j*(Max.y-Min.y)/n, Max.z);\r
}\r
+ float d;\r
if(!fx) { FMin.x = Min.x; FMax.x = Max.x; }\r
+ else { d=0.01*(FMax.x-FMin.x); FMin.x-=d; FMax.x+=d; }\r
if(!fy) { FMin.y = Min.y; FMax.y = Max.y; }\r
+ else { d=0.01*(FMax.y-FMin.y); FMin.y-=d; FMax.y+=d; }\r
if(!fz) { FMin.z = Min.z; FMax.z = Max.z; }\r
+ else { d=0.01*(FMax.z-FMin.z); FMin.z-=d; FMax.z+=d; }\r
}\r
RecalcCRange();\r
}\r
{\r
// NOTE: New syntax -- colors are CCCCC or {CNCNCCCN}; options inside []\r
if(!s || !s[0]) return;\r
+ strncpy(Sch,s,259); Smooth=smooth; Alpha=alpha;\r
+\r
register long i,j=0,m=0,l=strlen(s);\r
const char *cols = MGL_COLORS;\r
for(i=0;i<l;i++) // find number of colors\r
if(!sm || j==n-1)\r
{ col[2*i] = c[2*j]; col[2*i+1] = c[2*j+1]; }\r
else if(j>n-1) // NOTE: never should be here!\r
- { col[2*i] = c[2*n-2];col[2*i+1] = c[2*n-1]; printf("AddTexture -- out of bounds"); }\r
+ { col[2*i] = c[2*n-2];col[2*i+1] = c[2*n-1]; /*printf("AddTexture -- out of bounds");*/ }\r
else\r
{\r
col[2*i] = c[2*j]*(1-u)+c[2*j+2]*u;\r
{\r
mglTexture t(cols,smooth);\r
if(t.n==0) return smooth<0 ? 0:1;\r
+ if(smooth<0) CurrPal=0;\r
// check if already exist\r
for(unsigned long i=0;i<Txt.size();i++) if(t.IsSame(Txt[i])) return i;\r
// create new one\r
- if(smooth<0) CurrPal=0;\r
MGL_PUSH(Txt,t,mutexTxt); return Txt.size()-1;\r
}\r
//-----------------------------------------------------------------------------\r
void mgl_wnd_set_delay_(uintptr_t *gr, mreal *dt) { _GR_->SetDelay(*dt); }\r
void mgl_wnd_set_delay(HMGL gr, mreal dt) { _Gr_->SetDelay(dt); }\r
//-----------------------------------------------------------------------------\r
+HMEX mgl_create_expr(const char *expr) { return new mglFormula(expr); }\r
+void mgl_delete_expr(HMEX ex) { delete ex; }\r
+mreal mgl_expr_eval(HMEX ex, mreal x, mreal y,mreal z)\r
+{ return ex->Calc(x,y,z); }\r
+mreal mgl_expr_eval_v(HMEX ex, mreal *var)\r
+{ return ex->Calc(var); }\r
+mreal mgl_expr_diff(HMEX ex, char dir, mreal x, mreal y,mreal z)\r
+{ return ex->CalcD(dir,x,y,z); }\r
+mreal mgl_expr_diff_v(HMEX ex, char dir, mreal *var)\r
+{ return ex->CalcD(var, dir); }\r
+//-----------------------------------------------------------------------------\r
+uintptr_t mgl_create_expr_(const char *expr, int l)\r
+{ char *s=new char[l+1]; memcpy(s,expr,l); s[l]=0;\r
+ uintptr_t res = uintptr_t(mgl_create_expr(s));\r
+ delete []s; return res; }\r
+void mgl_delete_expr_(uintptr_t *ex) { mgl_delete_expr((HMEX)ex); }\r
+float mgl_eval_expr_(uintptr_t *ex, float *x, float *y,float *z)\r
+{ return mgl_expr_eval((HMEX) ex, *x,*y,*z); }\r
+float mgl_diff_expr_(uintptr_t *ex, const char *dir, float *x, float *y,float *z, int)\r
+{ return mgl_expr_diff((HMEX) ex, *dir,*x,*y,*z); }\r
+//-----------------------------------------------------------------------------\r
if(tr[1]=='c') { rr.CosFFT("y"); ii.CosFFT("y"); }\r
if(tr[2]=='c') { rr.CosFFT("z"); ii.CosFFT("z"); }\r
}\r
- else if(strchr(tr,'s')) // do Fourier only once for speeding up\r
+ else if(strchr(tr,'h')) // do Fourier only once for speeding up\r
{\r
if(tr[0]=='h') { rr.Hankel("x"); ii.Hankel("x"); }\r
if(tr[1]=='h') { rr.Hankel("y"); ii.Hankel("y"); }\r
return 0;
}
void mglc_addlegend(wchar_t out[1024], long , mglArg *a, int k[10], const char *)
-{ if(k[0]==2 && k[1]==2) mglprintf(out,1024,L"gr->AddLegend(\"%s\", \"%s\");",a[0].s.c_str(),a[1].s.c_str()); }
+{ if(k[0]==2 && k[1]==2) mglprintf(out,1024,L"gr->AddLegend(\"%ls\", \"%s\");",a[0].w.c_str(),a[1].s.c_str()); }
//-----------------------------------------------------------------------------
int mgls_addto(mglGraph *, long , mglArg *a, int k[10], const char *)
{
if(k[0]==2) mglprintf(out,1024,L"gr->Label('t', L\"%ls\", %g, %g);", a[0].w.c_str(), k[1]==3?a[1].v:1, k[2]==3?a[2].v:0);
}
//-----------------------------------------------------------------------------
-int mgls_label(mglGraph *gr, long , mglArg *a, int k[10], const char *)
+int mgls_label(mglGraph *gr, long , mglArg *a, int k[10], const char *opt)
{
if(k[0]==3 && k[1]==3 && k[2]==2)
gr->Label(a[0].v, a[1].v, a[2].w.c_str(), k[3]==2?a[3].s.c_str():"");
+ else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2)
+ gr->Label(*(a[0].d), *(a[1].d), *(a[2].d), a[3].w.c_str(), k[4]==2?a[4].s.c_str():"", opt);
+ else if(k[0]==1 && k[1]==1 && k[2]==2)
+ gr->Label(*(a[0].d), *(a[1].d), a[2].w.c_str(), k[3]==2?a[3].s.c_str():"", opt);
+ else if(k[0]==1 && k[1]==2)
+ gr->Label(*(a[0].d), a[1].w.c_str(), k[2]==2?a[2].s.c_str():"", opt);
else return 1;
return 0;
}
-void mglc_label(wchar_t out[1024], long , mglArg *a, int k[10], const char *)
+void mglc_label(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt)
{
if(k[0]==3 && k[1]==3 && k[2]==2)
- mglprintf(out,1024,L"gr->Label(%g, %g, \"%s\", \"%s\");", a[0].v, a[1].v, a[2].w.c_str(), k[3]==2?a[3].s.c_str():"");
+ mglprintf(out,1024,L"gr->Label(%g, %g, \"%ls\", \"%s\");", a[0].v, a[1].v, a[2].w.c_str(), k[3]==2?a[3].s.c_str():"");
+ else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2)
+ mglprintf(out,1024,L"gr->Label(%s, %s, %s, \"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].w.c_str(), k[4]==2?a[4].s.c_str():"", opt);
+ else if(k[0]==1 && k[1]==1 && k[2]==2)
+ mglprintf(out,1024,L"gr->Label(%s, %s, \"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].w.c_str(), k[3]==2?a[3].s.c_str():"", opt);
+ else if(k[0]==1 && k[1]==2)
+ mglprintf(out,1024,L"gr->Label(%s, \"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].w.c_str(), k[2]==2?a[2].s.c_str():"", opt);
}
//-----------------------------------------------------------------------------
int mgls_xrange(mglGraph *gr, long , mglArg *a, int k[10], const char *)
{"insert","Insert slice of data","insert Dat 'dir' [pos=0 num=1]", mgls_insert, mglc_insert,3},
{"integrate","Integrate data","integrate Dat 'dir'", mgls_integrate, mglc_integrate,3},
{"jacobian","Get Jacobian","jacobian Res Xdat Ydat [Zdat]", mgls_jacobian, mglc_jacobian,4},
- {"label","Draw label at arbitrary position","label x y 'txt' ['fmt' size]", mgls_label, mglc_label,1},
+ {"label","Draw label at arbitrary position","label ydat 'txt' ['stl'='']|xdat ydat 'txt' ['stl'='']|xdat ydat zdat 'txt' ['stl'='']|x y 'txt' ['fmt' size]", mgls_label, mglc_label,1},
{"legend","Draw legend","legend [pos 'fmt' size llen]|x y ['fmt' size llen]", mgls_legend, mglc_legend,1},
{"legendmarks","Set number of marks in the legend","legendmarks val", mgls_legendmarks, mglc_legendmarks,2},
{"light","Setup light","light [val] | val num | num xpos ypos zpos ['fmt' br]", mgls_light, mglc_light,2},
if(!strcmp(fname+len-4,".gif")) mgl_write_gif(gr,fname,descr);
if(!strcmp(fname+len-4,".bmp")) mgl_write_bmp(gr,fname,descr);
if(!strcmp(fname+len-4,".tga")) mgl_write_tga(gr,fname,descr);
+ if(!strcmp(fname+len-5,".mgld"))mgl_export_mgld(gr,fname,descr);
}
void mgl_write_frame_(uintptr_t *gr, const char *fname,const char *descr,int l,int n)
{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0;
void mgl_write_eps(HMGL gr, const char *fname,const char *descr)
{
if(gr->GetPrmNum()<1) return;
- _Gr_->Finish();
+ _Gr_->clr(MGL_FINISHED); _Gr_->Finish(false);
time_t now; time(&now);
bool gz = fname[strlen(fname)-1]=='z';
void mgl_write_svg(HMGL gr, const char *fname,const char *descr)
{
if(gr->GetPrmNum()<1) return;
- _Gr_->Finish();
+ _Gr_->clr(MGL_FINISHED); _Gr_->Finish(false);
time_t now; time(&now);
bool gz = fname[strlen(fname)-1]=='z';
void mgl_write_tex(HMGL gr, const char *fname,const char *descr)
{
if(gr->GetPrmNum()<1) return;
- _Gr_->Finish();
+ _Gr_->clr(MGL_FINISHED); _Gr_->Finish(false);
FILE *fp=fopen("mglcolors.tex","wt");
register int ii,jj,kk; // save colors which can be required at output
for(ii=0;ii<6;ii++) for(jj=0;jj<6;jj++) for(kk=0;kk<6;kk++)
}\r
}\r
//-----------------------------------------------------------------------------\r
-// I'm not sure that it is good idea -- a lot of memory used, but gain only for small files
-/*void mgl_rearrange_pnt(HMGL gr, std::vector<size_t> &on, std::vector<size_t> &no, bool coor=false)
-{
- // on -- for old-to-new index; no -- for new-to-old index
- on.clear(); on.resize(gr->GetPntNum(),-1); no.clear();
- register size_t i,j;
- for(i=0;i<gr->GetPntNum();i++) // collect data for groups
- // it is rather expensive (extra 4b per primitive) but need for export to 3D
- {
- const mglPnt &q = gr->GetPnt(i);
- if(coor) for(j=0;j<no.size();j++)
- {
- const mglPnt &p = gr->GetPnt(no[j]);
- if(p.x==q.x && p.y==q.y && p.z==q.z) on[i]=j;
- }
- else for(j=0;j<no.size();j++)
- {
- const mglPnt &p = gr->GetPnt(no[j]);
- if(p.x==q.x && p.y==q.y && p.z==q.z && p.c==q.c && p.t==q.t) on[i]=j;
- }
- if(on[j]<0) { no.push_back(i); on[j]=no.size()-1; }
- }
-}*/
+// I'm not sure that it is good idea -- a lot of memory used, but gain only for small files\r
+/*void mgl_rearrange_pnt(HMGL gr, std::vector<size_t> &on, std::vector<size_t> &no, bool coor=false)\r
+{\r
+ // on -- for old-to-new index; no -- for new-to-old index\r
+ on.clear(); on.resize(gr->GetPntNum(),-1); no.clear();\r
+ register size_t i,j;\r
+ for(i=0;i<gr->GetPntNum();i++) // collect data for groups\r
+ // it is rather expensive (extra 4b per primitive) but need for export to 3D\r
+ {\r
+ const mglPnt &q = gr->GetPnt(i);\r
+ if(coor) for(j=0;j<no.size();j++)\r
+ {\r
+ const mglPnt &p = gr->GetPnt(no[j]);\r
+ if(p.x==q.x && p.y==q.y && p.z==q.z) on[i]=j;\r
+ }\r
+ else for(j=0;j<no.size();j++)\r
+ {\r
+ const mglPnt &p = gr->GetPnt(no[j]);\r
+ if(p.x==q.x && p.y==q.y && p.z==q.z && p.c==q.c && p.t==q.t) on[i]=j;\r
+ }\r
+ if(on[j]<0) { no.push_back(i); on[j]=no.size()-1; }\r
+ }\r
+}*/\r
//-----------------------------------------------------------------------------\r
void mgl_obj_prim(const mglPrim &q, const mglPnt &p, FILE *fp, float size)\r
{\r
case 1: fprintf(fp,"l %ld/%ld %ld/%ld\n", n1,n1, n2,n2); break;\r
case 2: fprintf(fp,"f %ld/%ld/%ld %ld/%ld/%ld %ld/%ld/%ld\n",\r
n1,n1,n1, n2,n2,n2, n3,n3,n3); break;\r
- case 3: fprintf(fp,"f %ld/%ld/%ld %ld/%ld/%ld %ld/%ld/%ld\n",\r
- n1,n1,n1, n2,n2,n2, n3,n3,n3);\r
+ case 3:\r
+ fprintf(fp,"f %ld/%ld/%ld %ld/%ld/%ld %ld/%ld/%ld\n",\r
+ n1,n1,n1, n2,n2,n2, n3,n3,n3);\r
fprintf(fp,"f %ld/%ld/%ld %ld/%ld/%ld %ld/%ld/%ld\n",\r
- n2,n2,n2, n3,n3,n3, n4,n4,n4);break;\r
+ n4,n4,n4, n2,n2,n2, n3,n3,n3);break;\r
case 4: break; // TODO: add glyphs export later\r
}\r
}\r
}\r
delete []ng;\r
\r
- unsigned len=strlen(fname);\r
+ unsigned len=strlen(fname),ntxt=gr->GetTxtNum();\r
char *tname = new char[len+1]; strcpy(tname,fname);\r
FILE *fp=fopen(fname,"wt");\r
// vertices definition\r
- fprintf(fp,"# Created by MathGL library\n# Title: %s\n",descr ? descr : fname);\r
- for(i=0;i<size_t(gr->GetPrmNum());i++)\r
+ fprintf(fp,"# Created by MathGL library\n# Title: %s\n",(descr && *descr) ? descr : fname);\r
+ for(i=0;i<size_t(gr->GetPntNum());i++)\r
{\r
mglPnt pp = gr->GetPnt(i);\r
fprintf(fp,"v %g %g %g\n",pp.x,pp.y,pp.z);\r
- fprintf(fp,"vt %g %g\n",256*pp.t,256*pp.c);\r
- if(isnan(pp.u)) fprintf(fp,"vn 0 0 0\n");\r
- else fprintf(fp,"vn %g %g %g\n",pp.u,pp.v,pp.w);\r
+ fprintf(fp,"vt %g %g\n",pp.t,pp.c/ntxt);\r
+// if(isnan(pp.u)) fprintf(fp,"vn 0 0 0\n");\r
+// else fprintf(fp,"vn %g %g %g\n",pp.u,pp.v,pp.w);\r
}\r
// primitive definition in groups\r
- tname[len-4]=0; fprintf(fp,"# Primitives Definitions\nusemtl %s.mtl\n",tname);\r
- std::vector<long> p;\r
+ tname[len-4]=0; fprintf(fp,"# Primitives Definitions\nmtllib %s.mtl\nusemtl %s\n",tname,tname);\r
for(i=0;i<gr->Grp.size();i++)\r
{\r
- fprintf(fp,"g %s\n",gr->Grp[i].Lbl.c_str()); p = gr->Grp[i].p;\r
+ fprintf(fp,"g %s\n",gr->Grp[i].Lbl.c_str());\r
+ std::vector<long> &p = gr->Grp[i].p;\r
for(j=0;j<p.size();j++)\r
{\r
const mglPrim &q=gr->GetPrm(p[j]);\r
{\r
if(gr->GetPrmNum()<=0) return; // nothing to do\r
FILE *fp = fopen(fname,"wt");\r
- fprintf(fp,"solid %s",descr?descr:"mathgl");\r
+ fprintf(fp,"solid %s\n",(descr && *descr)?descr:"mathgl");\r
register long i;\r
mglPnt pp;\r
for(i=0;i<gr->GetPrmNum();i++)\r
fprintf(fp,"endloop\nendfacet\n");\r
}\r
}\r
- fprintf(fp,"endsolid %s",descr?descr:"mathgl");\r
+ fprintf(fp,"endsolid %s",(descr && *descr)?descr:"mathgl");\r
fclose(fp);\r
}\r
void mgl_write_stl_(uintptr_t *gr, const char *fname,const char *descr,int l,int n)\r
\r
register long i;\r
FILE *fp=fopen(fname,"wt"), *ff; // vertices definition\r
- fprintf(fp,"# Created by MathGL library\n# Title: %s\n",descr ? descr : fname);\r
+ fprintf(fp,"# Created by MathGL library\n# Title: %s\n",(descr && *descr) ? descr : fname);\r
fprintf(fp,"# List of Vertices, with (x,y,z) coordinates.\n");\r
for(i=0;i<gr->GetPntNum();i++)\r
{\r
char *tname = new char[len+2]; strcpy(tname,fname); tname[len+1]=tname[len]=0;\r
tname[len]='l'; fp = fopen(tname,"wt");\r
tname[len]='f'; ff = fopen(tname,"wt");\r
- fprintf(fp,"# Created by MathGL library\n# Title: %s\n",descr ? descr : fname);\r
+ fprintf(fp,"# Created by MathGL library\n# Title: %s\n",(descr && *descr) ? descr : fname);\r
fprintf(fp,"# Indices of vertices to connect for lines\n");\r
- fprintf(ff,"# Created by MathGL library\n# Title: %s\n",descr ? descr : fname);\r
+ fprintf(ff,"# Created by MathGL library\n# Title: %s\n",(descr && *descr) ? descr : fname);\r
fprintf(ff,"# Indices of vertices to connect for faces\n");\r
for(i=0;i<gr->GetPrmNum();i++)\r
{\r
FILE *fp=fopen(fname,"wt");\r
// vertices definition\r
if(colored)\r
- fprintf(fp,"COFF\n# Created by MathGL library\n# Title: %s\n",descr ? descr : fname);\r
+ fprintf(fp,"COFF\n# Created by MathGL library\n# Title: %s\n",(descr && *descr) ? descr : fname);\r
else\r
- fprintf(fp,"OFF\n# Created by MathGL library\n# Title: %s\n",descr ? descr : fname);\r
+ fprintf(fp,"OFF\n# Created by MathGL library\n# Title: %s\n",(descr && *descr) ? descr : fname);\r
fprintf(fp,"# List of Vertices, with (x,y,z,r,g,b,a) coordinates.\n");\r
fprintf(fp,"%ld %ld 0\n",gr->GetPntNum(), nf);\r
for(i=0;i<gr->GetPntNum();i++)\r
}\r
for(i=0;i<gr->GetPrmNum();i++)\r
{\r
- const mglPrim q=gr->GetPrm(i);\r
- mglPnt p1=gr->GetPnt(q.n1), p2, p3, p4;\r
+ const mglPrim &q=gr->GetPrm(i);\r
+ const mglPnt &p1=gr->GetPnt(q.n1);\r
if(colored)\r
{\r
if(q.type==2)\r
{\r
if(q.type==2)\r
{\r
- p2=gr->GetPnt(q.n2); p3=gr->GetPnt(q.n3);\r
+ const mglPnt &p2=gr->GetPnt(q.n2), &p3=gr->GetPnt(q.n3);\r
fprintf(fp,"3 %ld %ld %ld %.2g %.2g %.2g %.2g\n",q.n1,q.n2,q.n3, (p1.r+p2.r+p3.r)/3, (p1.g+p2.g+p3.g)/3, (p1.b+p2.b+p3.b)/3, (p1.a+p2.a+p3.a)/3);\r
}\r
if(q.type==3)\r
{\r
- p2=gr->GetPnt(q.n2); p3=gr->GetPnt(q.n3); p4=gr->GetPnt(q.n4);\r
+ const mglPnt &p2=gr->GetPnt(q.n2), &p3=gr->GetPnt(q.n3), &p4=gr->GetPnt(q.n4);\r
fprintf(fp,"4 %ld %ld %ld %ld %.2g %.2g %.2g %.2g\n",q.n1,q.n2,q.n4,q.n3, (p1.r+p2.r+p3.r+p4.r)/4, (p1.g+p2.g+p3.g+p4.g)/4, (p1.b+p2.b+p3.b+p4.b)/4, (p1.a+p2.a+p3.a+p4.a)/4);\r
}\r
}\r
char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0;\r
mgl_write_idtf(_GR_,s,f); delete []s; delete []f; }\r
//-----------------------------------------------------------------------------\r
+/*struct mglPrim\r
+{\r
+ // NOTE: n4 is used as mark; n3 -- as pen style for type=0,1,4\r
+ // NOTE: n3 is used as position of txt,font in Ptxt for type=6\r
+ long n1,n2,n3,n4; ///< coordinates of corners\r
+ int type; ///< primitive type (0-point, 1-line, 2-trig, 3-quad, 4-glyph, 6-text)\r
+ int id; ///< object id\r
+ float z; ///< z-position\r
+ float s; ///< size (if applicable) or fscl\r
+ float w; ///< width (if applicable) or ftet\r
+ float p;\r
+};*/\r
bool mglCanvas::ExportMGLD(const char *fname, const char *descr)\r
{\r
if(Pnt.size()<1 || Prm.size()<1) return true;\r
FILE *fp=fopen(fname,"wt");\r
if(!fp) return true;\r
- fprintf(fp,"MGLD %lu %lu\n# %s\n", Pnt.size(), Prm.size(), descr ? descr : fname);\r
- register size_t i;\r
+ // NOTE: I'll save Ptx. So prim type=6 is useless,and no LaTeX\r
+ fprintf(fp,"MGLD %lu %lu %lu\n# %s\n", Pnt.size(), Prm.size(), Txt.size(), (descr && *descr) ? descr : fname);\r
+ register size_t i,j;\r
fprintf(fp,"# Vertexes: x y z c t u v w r g b a\n");\r
for(i=0;i<Pnt.size();i++)\r
{\r
const mglPnt &q=Pnt[i];\r
- fprintf(fp,"%g %g %g %g %g %g %g %g %g %g %g %g\n", q.x, q.y, q.z, q.c, q.t, q.u, q.v, q.w, q.r, q.g, q.b, q.a);\r
+ fprintf(fp,"%.4g\t%.4g\t%.4g\t%.4g\t%.4g\t%.4g\t%.4g\t%.4g\t%.4g\t%.4g\t%.4g\t%.4g\n", q.xx, q.yy, q.zz, q.c, q.t, q.u, q.v, q.w, q.r, q.g, q.b, q.a);\r
}\r
fprintf(fp,"# Primitives: type n1 n2 n3 n4 id s w p\n");\r
for(i=0;i<Prm.size();i++)\r
{\r
- const mglPrim &q=Prm[i];\r
- fprintf(fp,"%d %ld %ld %ld %ld %d %g %g %g\n", q.type, q.n1, q.n2, q.n3, q.n4, q.id, q.s, q.w, q.p);\r
+ const mglPrim &p=Prm[i];\r
+ fprintf(fp,"%d\t%ld\t%ld\t%ld\t%ld\t%d\t%g\t%g\t%g\n", p.type, p.n1, p.n2, p.n3, p.n4, p.id, p.s, p.w, p.p);\r
+ }\r
+ fprintf(fp,"# Textures: smooth alpha colors\n");\r
+ for(i=0;i<Txt.size();i++)\r
+ {\r
+ const mglTexture &t=Txt[i];\r
+ fprintf(fp,"%d\t%.4g\t%s\n",t.Smooth,t.Alpha,t.Sch);\r
}\r
fclose(fp);\r
return false;\r
char *buf=new char[512];\r
if(!fgets(buf,512,fp)) *buf=0;\r
if(strncmp(buf,"MGLD",4)) { delete []buf; fclose(fp); return true; }\r
- register size_t i;
- size_t n,m;\r
- sscanf(buf+5,"%lu%lu",&n,&m);\r
- if(n<=0 || m<=0) { delete []buf; fclose(fp); return true; }\r
- if(!add) { Pnt.clear(); Prm.clear(); }\r
- Pnt.reserve(n); Prm.reserve(m);\r
- mglPnt p; mglPrim q;\r
- for(i=0;i<n;)\r
+ register size_t i;\r
+ size_t n,m,l;\r
+ sscanf(buf+5,"%lu%lu%lu",&n,&m,&l);\r
+ if(n<=0 || m<=0 || l<=0) { delete []buf; fclose(fp); return true; }\r
+ if(!add) { Clf(); Txt.clear(); }\r
+ else ClfZB();\r
+ Pnt.reserve(n); Prm.reserve(m); Txt.reserve(l);\r
+ mglPnt p;\r
+ for(i=0;i<n;i++)\r
{\r
do { if(!fgets(buf,512,fp)) *buf=0; mgl_strtrim(buf); } while(*buf=='#');\r
- sscanf(buf,"%g%g%g%g%g%g%g%g%g%g%g%g", &p.x, &p.y, &p.z, &p.c, &p.t, &p.u, &p.v, &p.w, &p.r, &p.g, &p.b, &p.a);\r
- Pnt.push_back(p); i++;\r
+ sscanf(buf,"%g%g%g%g%g%g%g%g%g%g%g%g", &p.xx, &p.yy, &p.zz, &p.c, &p.t, &p.u, &p.v, &p.w, &p.r, &p.g, &p.b, &p.a);\r
+ Pnt.push_back(p);\r
}\r
- for(i=0;i<m;)\r
+ mglPrim q;\r
+ for(i=0;i<m;i++)\r
{\r
do { if(!fgets(buf,512,fp)) *buf=0; mgl_strtrim(buf); } while(*buf=='#');\r
sscanf(buf,"%d%ld%ld%ld%ld%d%g%g%g", &q.type, &q.n1, &q.n2, &q.n3, &q.n4, &q.id, &q.s, &q.w, &q.p);\r
- Prm.push_back(q); i++;\r
+ if(q.type>4) continue;\r
+ Prm.push_back(q);\r
+ }\r
+ mglTexture t;\r
+ for(i=0;i<l;i++)\r
+ {\r
+ int sm=0; float a;\r
+ do { if(!fgets(buf,512,fp)) *buf=0; mgl_strtrim(buf); } while(*buf=='#');\r
+ register unsigned j,k=0;\r
+ for(j=0;buf[j];j++)\r
+ {\r
+ if(buf[j]<=' ' && k) { sm++; k=0; }\r
+ if(buf[j]>' ') k=1;\r
+ if(sm==2 && k) break;\r
+ }\r
+ sscanf(buf,"%d%g", &sm, &a);\r
+ t.Set(buf+j, sm, a);\r
+ Txt.push_back(t);\r
}\r
delete []buf; fclose(fp); return false;\r
}\r
if(GetPrmNum()<=0) return; // nothing to do\r
FILE *fp=fopen(fname,"wt");\r
if(!fp) return true;\r
- fprintf(fp,"<WORLD>\n<NAME>%s</NAME>\n", descr?descr:fname);\r
+ fprintf(fp,"<WORLD>\n<NAME>%s</NAME>\n", (descr && *descr)?descr:fname);\r
fprintf(fp,"<BACKGROUND><BACKCOLOR>%g, %g, %g</BACKCOLOR></BACKGROUND>\n", BDef[0]/255., BDef[1]/255., BDef[2]/255.);\r
fprintf(fp,"<LIGHTING>\n<AMBIENT>%g, %g, %g</AMBIENT>\n",AmbBr, AmbBr, AmbBr);\r
register unsigned long i,j;\r
char *d=new char[n+1]; memcpy(d,descr,n); d[n]=0;\r
mgl_write_xgl(_GR_,s,d); delete []s; delete []d; }*/\r
//-----------------------------------------------------------------------------\r
-void mgl_x3d_prim(const mglPrim &q, const mglPnt &p, void *fp,bool gz, float size)\r
-{} // TODO\r
-//-----------------------------------------------------------------------------\r
-void mgl_write_x3d(HMGL gr, const char *fname,const char *descr)\r
+void mgl_x3d_mdef(HMGL gr, void *fp, bool gz)\r
{\r
- if(gr->GetPrmNum()<1) return;\r
- time_t now; time(&now);\r
-\r
- bool gz = fname[strlen(fname)-1]=='z';\r
- void *fp = gz ? (void*)gzopen(fname,"wt") : (void*)fopen(fname,"wt");\r
- if(!fp) { gr->SetWarn(mglWarnOpen,fname); return; }\r
- mgl_printf(fp, gz, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");\r
- mgl_printf(fp, gz, "<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D 3.0//EN\" \"http://www.web3d.org/specifications/x3d-3.0.dtd\">\n");\r
- mgl_printf(fp, gz, "<X3D profile='Immersive'>\n<head>\n<meta name='filename' content='%s'/>\n",fname);\r
- mgl_printf(fp, gz, "<meta name='description' content='%s'/>\n",descr?descr:fname);\r
- mgl_printf(fp, gz, "<meta name='created' content='%s'/>\n",ctime(&now));\r
- mgl_printf(fp, gz, "<meta name='generator' content='MathGL, http://mathgl.sourceforge.net/'/>\n");\r
- mgl_printf(fp, gz, "</head>\n<Scene>\n");\r
-\r
- // 1. first we have to define proto for marks and glyphs\r
bool m_p=false,m_x=false,m_d=false,m_v=false,m_t=false,\r
m_s=false,m_a=false,m_o=false,m_T=false,\r
m_V=false,m_S=false,m_D=false,m_Y=false,m_l=false,\r
m_L=false,m_r=false,m_R=false,m_X=false,m_P=false;\r
- register unsigned long i,j;\r
- for(i=0;i<gr->GetPrmNum();i++)\r
+ for(size_t i=0;i<gr->GetPrmNum();i++)\r
{\r
const mglPrim q = gr->GetPrm(i);\r
if(q.type>0) continue; if(q.n4=='+') m_p = true;\r
if(m_P) { m_p=true; m_s=true; }\r
if(m_X) { m_x=true; m_s=true; }\r
if(m_p) mgl_printf(fp, gz, "<ProtoDeclare name='m_p'><ProtoInterface/>\n<ProtoBody>"\r
- "<LineSet vertexCount=''>\n<Coordinate point='-1 0 0, 1 0 0, 0 -1 0, 0 1 0'/>"\r
- "\n</LineSet></ProtoBody></ProtoDeclare>\n");\r
+ "<LineSet vertexCount=''>\n<Coordinate point='-1 0 0, 1 0 0, 0 -1 0, 0 1 0'/>"\r
+ "\n</LineSet></ProtoBody></ProtoDeclare>\n");\r
/*if(m_x) mgl_printf(fp, gz, "/m_x {sm sm rm s2 s2 rl 0 sm 2 mul rm sm 2 mul s2 rl d0} def\n"); // TODO\r
- if(m_s) mgl_printf(fp, gz, "/m_s {sm sm rm 0 s2 rl s2 0 rl 0 sm 2 mul rl cp d0} def\n");\r
- if(m_d) mgl_printf(fp, gz, "/m_d {sm 0 rm ss ss rl ss sm rl sm sm rl cp d0} def\n");\r
- if(m_v) mgl_printf(fp, gz, "/m_v {sm ss 2 div rm s2 0 rl sm sm 1.5 mul rl d0 cp} def\n");\r
- if(m_t) mgl_printf(fp, gz, "/m_t {sm sm 2 div rm s2 0 rl sm ss 1.5 mul rl d0 cp} def\n");\r
- if(m_a) mgl_printf(fp, gz, "/m_a {sm 0 rm s2 0 rl sm 1.6 mul sm 0.8 mul rm ss 1.2 mul ss 1.6 mul rl 0 sm 1.6 mul rm sm 1.2 mul ss 1.6 mul rl d0} def\n");\r
- if(m_o) mgl_printf(fp, gz, "/m_o {ss 0 360 d0 arc} def\n");\r
- if(m_S) mgl_printf(fp, gz, "/m_S {sm sm rm 0 s2 rl s2 0 rl 0 sm 2 mul rl cp} def\n");\r
- if(m_D) mgl_printf(fp, gz, "/m_D {sm 0 rm ss ss rl ss sm rl sm sm rl cp} def\n");\r
- if(m_V) mgl_printf(fp, gz, "/m_V {sm ss 2 div rm s2 0 rl sm sm 1.5 mul rl cp} def\n");\r
- if(m_T) mgl_printf(fp, gz, "/m_T {sm sm 2 div rm s2 0 rl sm ss 1.5 mul rl cp} def\n");\r
- if(m_Y) mgl_printf(fp, gz, "/m_Y {0 sm rm 0 ss rl sm ss rl s2 0 rm sm sm rl d0} def\n");\r
- if(m_r) mgl_printf(fp, gz, "/m_r {sm 2 div sm rm 0 s2 rl ss 1.5 mul sm rl d0 cp} def\n");\r
- if(m_l) mgl_printf(fp, gz, "/m_l {ss 2 div sm rm 0 s2 rl sm 1.5 mul sm rl d0 cp} def\n");\r
- if(m_R) mgl_printf(fp, gz, "/m_R {sm 2 div sm rm 0 s2 rl ss 1.5 mul sm rl cp} def\n");\r
- if(m_L) mgl_printf(fp, gz, "/m_L {ss 2 div sm rm 0 s2 rl sm 1.5 mul sm rl cp} def\n");\r
- if(m_P) mgl_printf(fp, gz, "/m_P {m_p 0 sm rm m_s} def\n");\r
- if(m_X) mgl_printf(fp, gz, "/m_X {m_x ss sm rm m_s} def\n");*/\r
+ * if(m_s) mgl_printf(fp, gz, "/m_s {sm sm rm 0 s2 rl s2 0 rl 0 sm 2 mul rl cp d0} def\n");\r
+ * if(m_d) mgl_printf(fp, gz, "/m_d {sm 0 rm ss ss rl ss sm rl sm sm rl cp d0} def\n");\r
+ * if(m_v) mgl_printf(fp, gz, "/m_v {sm ss 2 div rm s2 0 rl sm sm 1.5 mul rl d0 cp} def\n");\r
+ * if(m_t) mgl_printf(fp, gz, "/m_t {sm sm 2 div rm s2 0 rl sm ss 1.5 mul rl d0 cp} def\n");\r
+ * if(m_a) mgl_printf(fp, gz, "/m_a {sm 0 rm s2 0 rl sm 1.6 mul sm 0.8 mul rm ss 1.2 mul ss 1.6 mul rl 0 sm 1.6 mul rm sm 1.2 mul ss 1.6 mul rl d0} def\n");\r
+ * if(m_o) mgl_printf(fp, gz, "/m_o {ss 0 360 d0 arc} def\n");\r
+ * if(m_S) mgl_printf(fp, gz, "/m_S {sm sm rm 0 s2 rl s2 0 rl 0 sm 2 mul rl cp} def\n");\r
+ * if(m_D) mgl_printf(fp, gz, "/m_D {sm 0 rm ss ss rl ss sm rl sm sm rl cp} def\n");\r
+ * if(m_V) mgl_printf(fp, gz, "/m_V {sm ss 2 div rm s2 0 rl sm sm 1.5 mul rl cp} def\n");\r
+ * if(m_T) mgl_printf(fp, gz, "/m_T {sm sm 2 div rm s2 0 rl sm ss 1.5 mul rl cp} def\n");\r
+ * if(m_Y) mgl_printf(fp, gz, "/m_Y {0 sm rm 0 ss rl sm ss rl s2 0 rm sm sm rl d0} def\n");\r
+ * if(m_r) mgl_printf(fp, gz, "/m_r {sm 2 div sm rm 0 s2 rl ss 1.5 mul sm rl d0 cp} def\n");\r
+ * if(m_l) mgl_printf(fp, gz, "/m_l {ss 2 div sm rm 0 s2 rl sm 1.5 mul sm rl d0 cp} def\n");\r
+ * if(m_R) mgl_printf(fp, gz, "/m_R {sm 2 div sm rm 0 s2 rl ss 1.5 mul sm rl cp} def\n");\r
+ * if(m_L) mgl_printf(fp, gz, "/m_L {ss 2 div sm rm 0 s2 rl sm 1.5 mul sm rl cp} def\n");\r
+ * if(m_P) mgl_printf(fp, gz, "/m_P {m_p 0 sm rm m_s} def\n");\r
+ * if(m_X) mgl_printf(fp, gz, "/m_X {m_x ss sm rm m_s} def\n");*/\r
// if(m_C) mgl_printf(fp, gz, "/m_C {m_c m_o} def\n");\r
mgl_printf(fp, gz, "\n");\r
+}\r
+//-----------------------------------------------------------------------------\r
+void mgl_x3d_prim(const mglPrim &q, const mglPnt &p, const long *pnt, void *fp,bool gz, float size)\r
+{\r
+/* if(q.type==0) // mark\r
+ {\r
+ float x0 = p1.x,y0 = p1.y;\r
+ sprintf(str,"1 lw %.2g %.2g %.2g rgb ", cp.r,cp.g,cp.b);\r
+ wp=1;\r
+ if(q.s!=gr->mark_size()/gr->FontFactor())\r
+ {\r
+ mgl_printf(fp, gz, "/ss {%g} def\n",q.s*0.4*gr->FontFactor());\r
+ mgl_printf(fp, gz, "/s2 {%g} def\n",q.s*0.8*gr->FontFactor());\r
+ mgl_printf(fp, gz, "/sm {-%g} def\n",q.s*0.4*gr->FontFactor());\r
+ }\r
+ switch(q.n4)\r
+ {\r
+ case '+': mgl_printf(fp, gz, "np %g %g mt m_p %sdr\n",x0,y0,str); break;\r
+ case 'x': mgl_printf(fp, gz, "np %g %g mt m_x %sdr\n",x0,y0,str); break;\r
+ case 's': mgl_printf(fp, gz, "np %g %g mt m_s %sdr\n",x0,y0,str); break;\r
+ case 'd': mgl_printf(fp, gz, "np %g %g mt m_d %sdr\n",x0,y0,str); break;\r
+ case '*': mgl_printf(fp, gz, "np %g %g mt m_a %sdr\n",x0,y0,str); break;\r
+ case 'v': mgl_printf(fp, gz, "np %g %g mt m_v %sdr\n",x0,y0,str); break;\r
+ case '^': mgl_printf(fp, gz, "np %g %g mt m_t %sdr\n",x0,y0,str); break;\r
+ case 'S': mgl_printf(fp, gz, "np %g %g mt m_S %sfill\n",x0,y0,str); break;\r
+ case 'D': mgl_printf(fp, gz, "np %g %g mt m_D %sfill\n",x0,y0,str); break;\r
+ case 'V': mgl_printf(fp, gz, "np %g %g mt m_V %sfill\n",x0,y0,str); break;\r
+ case 'T': mgl_printf(fp, gz, "np %g %g mt m_T %sfill\n",x0,y0,str); break;\r
+ case 'o': mgl_printf(fp, gz, "%g %g m_o %sdr\n",x0,y0,str);break;\r
+ case 'O': mgl_printf(fp, gz, "%g %g m_o %sfill\n",x0,y0,str);break;\r
+ case 'Y': mgl_printf(fp, gz, "np %g %g mt m_Y %sdr\n",x0,y0,str); break;\r
+ case '<': mgl_printf(fp, gz, "np %g %g mt m_l %sdr\n",x0,y0,str); break;\r
+ case '>': mgl_printf(fp, gz, "np %g %g mt m_r %sdr\n",x0,y0,str); break;\r
+ case 'L': mgl_printf(fp, gz, "np %g %g mt m_L %sfill\n",x0,y0,str); break;\r
+ case 'R': mgl_printf(fp, gz, "np %g %g mt m_R %sfill\n",x0,y0,str); break;\r
+ case 'P': mgl_printf(fp, gz, "np %g %g mt m_P %sdr\n",x0,y0,str); break;\r
+ case 'X': mgl_printf(fp, gz, "np %g %g mt m_X %sdr\n",x0,y0,str); break;\r
+ case 'C': mgl_printf(fp, gz, "%g %g m_o %g %g m_c %sdr\n",x0,y0,x0,y0,str); break;\r
+ default: mgl_printf(fp, gz, "%g %g m_c %sfill\n",x0,y0,str);\r
+ }\r
+ if(q.s!=gr->mark_size()/gr->FontFactor())\r
+ {\r
+ mgl_printf(fp, gz, "/ss {%g} def\n",0.4*gr->mark_size());\r
+ mgl_printf(fp, gz, "/s2 {%g} def\n",0.8*gr->mark_size());\r
+ mgl_printf(fp, gz, "/sm {-%g} def\n",0.4*gr->mark_size());\r
+ }\r
+ }\r
+ else if(q.type==3) // quad\r
+ {\r
+ const mglPnt p2=gr->GetPnt(q.n2), p3=gr->GetPnt(q.n3), p4=gr->GetPnt(q.n4);\r
+ mgl_printf(fp, gz, "np %g %g mt %g %g ll %g %g ll %g %g ll cp %sfill\n",\r
+ p1.x, p1.y, p2.x, p2.y, p4.x, p4.y, p3.x, p3.y, str);\r
+ }\r
+ else if(q.type==2) // trig\r
+ {\r
+ const mglPnt p2=gr->GetPnt(q.n2), p3=gr->GetPnt(q.n3);\r
+ mgl_printf(fp, gz, "np %g %g mt %g %g ll %g %g ll cp %sfill\n",\r
+ p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, str);\r
+ }\r
+ else if(q.type==1) // line\r
+ {\r
+ sprintf(str,"%.2g lw %.2g %.2g %.2g rgb ", q.w>1 ? q.w:1., cp.r,cp.g,cp.b);\r
+ wp = q.w>1 ? q.w:1; st = q.n3;\r
+ put_line(gr,fp,gz,i,wp,cp,st, "np %g %g mt ", "%g %g ll ", false, 1);\r
+ const char *sd = mgl_get_dash(q.n3,q.w);\r
+ if(sd && sd[0]) mgl_printf(fp, gz, "%s [%s] %g sd dr\n",str,sd,q.w*q.s);\r
+ else mgl_printf(fp, gz, "%s d0 dr\n",str);\r
+ }\r
+ else if(q.type==4) // glyph\r
+ {\r
+ float ss = q.s/2, xx = p1.u, yy = p1.v, zz = p1.w;\r
+ mgl_printf(fp, gz, "gsave\t%g %g translate %g %g scale %g rotate %s\n",\r
+ p1.x, p1.y, ss, ss, -q.w, str);\r
+ if(q.n3&8) // this is "line"\r
+ {\r
+ float dy = 0.004,f=fabs(zz);\r
+ mgl_printf(fp, gz, "np %g %g mt %g %g ll %g %g ll %g %g ll cp ",\r
+ xx,yy+dy, xx+f,yy+dy, xx+f,yy-dy, xx,yy-dy);\r
+ }\r
+ else\r
+ mgl_printf(fp, gz, "%.3g %.3g translate %g %g scale %c%c_%04x ",\r
+ xx, yy, zz, zz, q.n3&1?'b':'n', q.n3&2?'i':'n', q.n4);\r
+ if(q.n3&4) mgl_printf(fp, gz, "dr");\r
+ else mgl_printf(fp, gz, "eofill");\r
+ mgl_printf(fp, gz, " grestore\n");\r
+ }*/ \r
+}\r
+//-----------------------------------------------------------------------------\r
+void mgl_write_x3d(HMGL gr, const char *fname,const char *descr)\r
+{\r
+ if(gr->GetPrmNum()<1) return;\r
+ time_t now; time(&now);\r
\r
- // 2 define coordinates, colors and so on\r
- mgl_printf(fp, gz, "<Coordinate DEF='mypnts' point='");\r
- for(i=0;i<gr->GetPntNum();i++)\r
- { const mglPnt &p=gr->GetPnt(i); mgl_printf(fp, gz, "%g %g %g, ", p.x,p.y,p.z); }\r
- mgl_printf(fp, gz, "0.0 0.0 0.0'/>");\r
- mgl_printf(fp, gz, "<Color DEF='myclrs' color='");\r
- for(i=0;i<gr->GetPntNum();i++)\r
- { const mglPnt &p=gr->GetPnt(i); mgl_printf(fp, gz, "%g %g %g, ", p.r,p.g,p.b); }\r
- mgl_printf(fp, gz, "0.0 0.0 0.0'/>");\r
-/* mgl_printf(fp, gz, "<Normal DEF='mynrms' vector='"); // Let X3D calculate normales by itself ?!?\r
- for(i=0;i<gr->GetPntNum();i++)\r
- { const mglPnt &p=gr->GetPnt(i);\r
- if(isnan(p.u) || isnan(p.v) || isnan(p.w)) mgl_printf(fp, gz, "0 0 0, ");\r
- else mgl_printf(fp, gz, "%g %g %g, ", p.u,p.v,p.w); }\r
- mgl_printf(fp, gz, "0.0 0.0 0.0'/>");*/\r
+ bool gz = fname[strlen(fname)-1]=='z';\r
+ void *fp = gz ? (void*)gzopen(fname,"wt") : (void*)fopen(fname,"wt");\r
+ if(!fp) { gr->SetWarn(mglWarnOpen,fname); return; }\r
+ mgl_printf(fp, gz, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");\r
+ mgl_printf(fp, gz, "<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D 3.0//EN\" \"http://www.web3d.org/specifications/x3d-3.0.dtd\">\n");\r
+ mgl_printf(fp, gz, "<X3D profile='Immersive'>\n<head>\n<meta name='filename' content='%s'/>\n",fname);\r
+ mgl_printf(fp, gz, "<meta name='description' content='%s'/>\n",(descr && *descr)?descr:fname);\r
+ mgl_printf(fp, gz, "<meta name='created' content='%s'/>\n",ctime(&now));\r
+ mgl_printf(fp, gz, "<meta name='generator' content='MathGL, http://mathgl.sourceforge.net/'/>\n");\r
+ mgl_printf(fp, gz, "</head>\n<Scene>\n");\r
\r
- // now should be defined textures ... but since X3D support RGBA then omit this in this version\r
+ // 1. first we have to define proto for marks and glyphs\r
+ mgl_x3d_mdef(gr, fp, gz);\r
+\r
+ // here should be defined textures ... but since X3D support RGBA then omit it in this version\r
\r
- // 3. now find group for primitives\r
+ // 2. now find group for primitives\r
long m1=0,m2=0,m;\r
+ register unsigned long i,j;\r
for(i=0;i<gr->Grp.size();i++) // prepare array of indirect indexing\r
{ m = gr->Grp[i].Id; if(m<m1) m1=m; if(m>m2) m2=m; }\r
long *ng = new long[m2-m1+1];\r
delete []ng;\r
\r
// primitive definition in groups\r
- std::vector<long> p;\r
+ long npnt = gr->GetPntNum(), k;\r
+ long *pnt=new long[npnt];\r
mglPrim q;\r
for(i=0;i<gr->Grp.size();i++)\r
{\r
- mgl_printf(fp,gz,"<Group><!--%s-->\n",gr->Grp[i].Lbl.c_str()); p = gr->Grp[i].p;\r
+ mgl_printf(fp,gz,"<Group><!--%s-->\n",gr->Grp[i].Lbl.c_str());\r
+ std::vector<long> &p = gr->Grp[i].p;\r
+\r
+ // define coordinates, colors and so on\r
+ memset(pnt,-1,npnt*sizeof(long));\r
+ for(j=0,k=0;j<p.size();j++) // find points for this group\r
+ {\r
+ const mglPrim &q=gr->GetPrm(p[j]);\r
+ if(q.n1>=0 && pnt[q.n1]<0) { pnt[q.n1]=k; k++; }\r
+ if(q.type>0 && q.type<4 && q.n2>=0 && pnt[q.n2]<0) { pnt[q.n2]=k; k++; }\r
+ if(q.type>1 && q.type<4 && q.n3>=0 && pnt[q.n3]<0) { pnt[q.n3]=k; k++; }\r
+ if(q.type==3 && q.n4>=0 && pnt[q.n4]<0) { pnt[q.n4]=k; k++; }\r
+ }\r
+ \r
+ mgl_printf(fp, gz, "<Coordinate DEF='mypnts_%ld' point='",i);\r
+ for(i=0;i<gr->GetPntNum();i++) if(pnt[i]>=0)\r
+ { const mglPnt &p=gr->GetPnt(i); mgl_printf(fp, gz, "%g %g %g, ", p.x,p.y,p.z); }\r
+ mgl_printf(fp, gz, "0.0 0.0 0.0'/>");\r
+ mgl_printf(fp, gz, "<Color DEF='myclrs' color='");\r
+ for(i=0;i<gr->GetPntNum();i++) if(pnt[i]>=0)\r
+ { const mglPnt &p=gr->GetPnt(i); mgl_printf(fp, gz, "%g %g %g, ", p.r,p.g,p.b); }\r
+ mgl_printf(fp, gz, "0.0 0.0 0.0'/>");\r
+ // no normals since mathgl ones are "signless" -- x3d should calculate it by itself\r
+\r
for(j=0;j<p.size();j++)\r
{\r
- const mglPrim q=gr->GetPrm(p[j]); // TODO: collect by type (quads,trig,line) and draw together???\r
- mgl_x3d_prim(q, gr->GetPnt(q.n1), fp,gz, q.s*gr->FontFactor());\r
+ const mglPrim &q=gr->GetPrm(p[j]); // TODO: collect by type (quads,trig,line) and draw together???\r
+ mgl_x3d_prim(q, gr->GetPnt(q.n1), pnt, fp,gz, q.s*gr->FontFactor());\r
}\r
mgl_printf(fp,gz,"</Group><!--%s-->\n",gr->Grp[i].Lbl.c_str());\r
gr->Grp[i].p.clear(); // we don't need indexes anymore\r
}\r
- // try to save "ungrouped" primitives\r
- mgl_printf(fp,gz,"<!--ungrouped-->\n");\r
- for(i=0;i<gr->GetPrmNum();i++)\r
- {\r
- const mglPrim q=gr->GetPrm(p[j]); m = q.id-m1;\r
- if(m<0 || m>=m2-m1+1)\r
- mgl_x3d_prim(q, gr->GetPnt(q.n1), fp,gz, q.s*gr->FontFactor());\r
- }\r
mgl_printf(fp, gz, "</Scene>\n");\r
if(gz) gzclose((gzFile)fp); else fclose((FILE *)fp);\r
}\r
register long i,n=Width*Height;\r
memset(C,0,12*n); memset(OI,0,n*sizeof(int));\r
for(i=0;i<3*n;i++) Z[i] = -1e20f; // TODO: Parallelization ?!?\r
+ clr(MGL_FINISHED);\r
}\r
//-----------------------------------------------------------------------------\r
void mglCanvas::Clf(mglColor Back)\r
if(Back==0) Back = 'w';\r
if((Flag&3)==2) Back = 'k';\r
BDef[0]=Back.r*255; BDef[1]=Back.g*255;BDef[2]=Back.b*255; BDef[3]=0;\r
- ClfZB(); clr(MGL_FINISHED);\r
+ ClfZB();\r
}\r
//-----------------------------------------------------------------------------\r
void mglCanvas::pxl_other(unsigned long id, unsigned long n, const void *p)\r
long *id=new long[n*n];\r
gr->Reserve(n*n);\r
for(j=0;j<n;j++) for(i=0;i<n;i++)\r
- { p = o+d1*i+d2*j; id[i+n*j] = gr->AddPnt(p,c,nn); }\r
+ { p = o+d1*i+d2*j; id[i+n*j] = gr->AddPnt(p,c,nn);\r
+ if(id[i+n*j]<0)\r
+ { printf("q"); gr->AddPnt(p,c,nn); }\r
+ }\r
for(i=0;i<num;i++) for(j=0;j<num;j++)\r
{\r
if(gr->Stop) { delete []id; return; }\r
if(a->Minimal()<0) { gr->SetWarn(mglWarnNeg,"Chart"); return; }\r
gr->SaveState(opt);\r
static int cgid=1; gr->StartGroup("Chart",cgid++);\r
- bool wire = cols && !strcmp(cols,"#"); // draw edges\r
+ bool wire = cols && strchr(cols,'#'); // draw edges\r
register long n=a->GetNx(),i,j=0;\r
if(cols) for(i=0;i<long(strlen(cols));i++)\r
if(strchr("wkrgbcymhRGBCYMHWlenuqpLENUQP ",cols[i])) j++;\r
q2 = (p1-p2)^(p4-p2); q3 = (p1-p3)^(p4-p3);\r
gr->Reserve(4);\r
long k1,k2,k3,k4;\r
- k1 = gr->AddPnt(p1,c1,q1,-1,3); k2 = gr->AddPnt(p2,c2,q2,-1,3);\r
- k3 = gr->AddPnt(p3,c3,q3,-1,3); k4 = gr->AddPnt(p4,c4,q4,-1,3);\r
+ double a = gr->get(MGL_ENABLE_ALPHA)?-1:1;\r
+ k1 = gr->AddPnt(p1,c1,q1,a,11); k2 = gr->AddPnt(p2,c2,q2,a,11);\r
+ k3 = gr->AddPnt(p3,c3,q3,a,11); k4 = gr->AddPnt(p4,c4,q4,a,11);\r
gr->quad_plot(k1,k2,k3,k4);\r
if(strchr(stl,'#'))\r
{\r
float c1=gr->GetC(ss,p1.z), c2=gr->GetC(ss,p2.z);\r
long *kk=new long[164],k1=-1,k2=-1;\r
bool edge = stl && strchr(stl,'@');\r
+ bool wire = stl && strchr(stl,'#');\r
gr->Reserve(edge?166:82);\r
- if(edge)\r
+ if(edge && !wire)\r
{\r
k1=gr->AddPnt(p1,c1,d,-1,3);\r
k2=gr->AddPnt(p2,c2,d,-1,3);\r
}\r
float f,si,co, dr=r2-r1;\r
register long i;\r
- for(i=0;i<41;i++)\r
+ for(i=0;i<(wire?13:41);i++)\r
{\r
if(gr->Stop) { delete []kk; return; }\r
- f = i*M_PI/20; co = cos(f); si = sin(f);\r
+ f = i*M_PI/(wire?6:20); co = cos(f); si = sin(f);\r
p = p1+(r1*co)*a+(r1*si)*b;\r
q = (si*a-co*b)^(d + (dr*co)*a + (dr*si)*b);\r
+ if(wire) q.x=q.y=NAN;\r
kk[i] = gr->AddPnt(p,c1,q,-1,3);\r
- if(edge) kk[i+82] = gr->AddPnt(p,c1,d,-1,3);\r
+ if(edge && !wire) kk[i+82] = gr->AddPnt(p,c1,d,-1,3);\r
p = p2+(r2*co)*a+(r2*si)*b;\r
- kk[i+41] = gr->AddPnt(p,c2,q,-1,3);\r
- if(edge) kk[i+123] = gr->AddPnt(p,c2,d,-1,3);\r
+ kk[i+(wire?13:41)] = gr->AddPnt(p,c2,q,-1,3);\r
+ if(edge && !wire) kk[i+123] = gr->AddPnt(p,c2,d,-1,3);\r
}\r
- for(i=0;i<40;i++)\r
+ if(wire) for(i=0;i<12;i++)\r
+ {\r
+ if(gr->Stop) { delete []kk; return; }\r
+ gr->line_plot(kk[i],kk[i+1]);\r
+ gr->line_plot(kk[i],kk[i+13]);\r
+ gr->line_plot(kk[i+14],kk[i+1]);\r
+ gr->line_plot(kk[i+14],kk[i+13]);\r
+ }\r
+ else for(i=0;i<40;i++)\r
{\r
if(gr->Stop) { delete []kk; return; }\r
gr->quad_plot(kk[i],kk[i+1],kk[i+41],kk[i+42]);\r
static int cgid=1; gr->StartGroup("Cones",cgid++);\r
m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m;\r
\r
- bool above = pen && strchr(pen,'a');\r
+ bool above= pen && strchr(pen,'a');\r
+ bool wire = pen && strchr(pen,'#');\r
float *dd=new float[2*n], x1,z0,zz,d;\r
memset(dd,0,n*sizeof(float));\r
\r
gr->SetPenPal(pen,&pal);\r
- char cols[4]={'@',0,0.0};\r
+ char c1[7]; memset(c1,0,7); c1[0] ='@';\r
+ char c2[7]; memset(c2,0,7); c2[0] ='@';\r
+ if(wire) c1[5]=c2[5]='#';\r
memset(dd,0,2*n*sizeof(float));\r
z0 = gr->GetOrgZ('x');\r
for(i=0;i<n;i++) for(j=0;j<m;j++) dd[i] += z->v(i, j<z->GetNy() ? j:0);\r
for(j=0;j<m;j++)\r
{\r
- gr->NextColor(pal); cols[1]=gr->last_color();\r
- if(gr->GetNumPal(pal)==2*m) { gr->NextColor(pal); cols[2]=gr->last_color(); }\r
+ gr->NextColor(pal); memcpy(c1+1,gr->last_line(),4);\r
+ if(gr->GetNumPal(pal)==2*m)\r
+ { gr->NextColor(pal); memcpy(c2+1,gr->last_line(),4); }\r
+ else memcpy(c2,c1,7);\r
mx = j<x->GetNy() ? j:0; my = j<y->GetNy() ? j:0; mz = j<z->GetNy() ? j:0;\r
for(i=0;i<n;i++)\r
{\r
zz = j>0?dd[i+n]:z0; dd[i+n] += z->v(i,mz);\r
mgl_cone(gr, x1,y->v(i,0),zz, x1,y->v(i,0),dd[i+n],\r
0.7*gr->BarWidth*d*(dd[i]-zz)/(dd[i]-z0),\r
- 0.7*gr->BarWidth*d*(dd[i]-dd[i+n])/(dd[i]-z0), cols);\r
+ 0.7*gr->BarWidth*d*(dd[i]-dd[i+n])/(dd[i]-z0), c1);\r
}\r
- else mgl_cone(gr, x1,y->v(i,my),z0, x1,y->v(i,my),z->v(i,mz), 0.7*gr->BarWidth*d,0, cols);\r
+ else mgl_cone(gr, x1,y->v(i,my),z0, x1,y->v(i,my),z->v(i,mz), 0.7*gr->BarWidth*d,0, z->v(i,mz)<0?c1:c2);\r
}\r
}\r
gr->EndGroup(); delete []dd;\r
const int n = 41;\r
long pal=0,n0,n1=-1,n2,m1=-1,m2;\r
gr->SetPenPal(stl,&pal);\r
- float c=gr->NextColor(pal);\r
+ float c=gr->NextColor(pal), d;\r
float k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k');\r
bool fill = !(stl && strchr(stl,'#')), box = (stl && strchr(stl,'@')) || !fill;\r
if(!fill) k=c;\r
\r
gr->Reserve(2*n+1);\r
- mglPoint p1(x1,y1,z1), p2(x2,y2,z2), v=p2-p1, u=mglPoint(0,0,1)^v, q=u^v, p, s;\r
- u = (r/u.norm())*u; s = (p1+p2)/2.; v *=0.5+r/v.norm();\r
+ mglPoint p1(x1,y1,z1), p2(x2,y2,z2), v=p2-p1;\r
+ d = v.norm();\r
+ if(d==0) v = mglPoint(r); else v *= r/d;\r
+ mglPoint u=(mglPoint(0,0,1)^v)*sqrt(d*d/r/r+1), q=u^v, p, s=(p1+p2)/2.;\r
// central point first\r
- n0 = gr->AddPnt(p1,c,q,-1,3);\r
+ n0 = gr->AddPnt(p1,c,q,-1,11);\r
for(long i=0;i<n;i++)\r
{\r
if(gr->Stop) return;\r
float t = i*2*M_PI/(n-1.);\r
p = s+v*cos(t)+u*sin(t);\r
- n2 = n1; n1 = gr->AddPnt(p,c,q,-1,3);\r
+ n2 = n1; n1 = gr->AddPnt(p,c,q,-1,11);\r
m2 = m1; m1 = gr->CopyNtoC(n1,k);\r
if(i>0)\r
{\r
gr->Reserve(8);\r
mglPoint p1(x1,y1,z1), p2(x2,y2,z2), u=mglPoint(0,0,1)^(p1-p2), q=u^(p1-p2), p, s,qq;\r
u = (r/u.norm())*u; s = (p1+p2)/2.;\r
- p = p1; q = qq; n1 = gr->AddPnt(p,c,qq,-1,3);\r
- p = s+u;q = qq; n2 = gr->AddPnt(p,b==c?c:k,qq,-1,3);\r
- p = p2; q = qq; n3 = gr->AddPnt(p,b,qq,-1,3);\r
- p = s-u;q = qq; n4 = gr->AddPnt(p,b==c?c:k,qq,-1,3);\r
+ p = p1; q = qq; n1 = gr->AddPnt(p,c,qq,-1,11);\r
+ p = s+u;q = qq; n2 = gr->AddPnt(p,b==c?c:k,qq,-1,11);\r
+ p = p2; q = qq; n3 = gr->AddPnt(p,b,qq,-1,11);\r
+ p = s-u;q = qq; n4 = gr->AddPnt(p,b==c?c:k,qq,-1,11);\r
if(fill) gr->quad_plot(n1,n2,n4,n3);\r
n1 = gr->CopyNtoC(n1,k); n2 = gr->CopyNtoC(n2,k);\r
n3 = gr->CopyNtoC(n3,k); n4 = gr->CopyNtoC(n4,k);\r
if(gr->MeshNum>1) { tx=(n-1)/(gr->MeshNum-1); ty=(m-1)/(gr->MeshNum-1); }\r
if(tx<1) tx=1; if(ty<1) ty=1;\r
\r
- for(k=0;k<ax->GetNz();k++) for(j=0;j<m;j++) for(i=0;i<n;i++)\r
+ for(k=0,xm=0;k<ax->GetNz();k++) for(j=0;j<m;j++) for(i=0;i<n;i++)\r
{\r
ym = sqrt(ax->v(i,j,k)*ax->v(i,j,k)+ay->v(i,j,k)*ay->v(i,j,k));\r
xm = xm>ym ? xm : ym;\r
+++ /dev/null
-rotate 50 60
-box
-fsurf 'x*y'
-fsurf 'x^2'
-fplot 't' 't' '1-t^2' 'r'
-
-
if(MGL_HAVE_DOC)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/png/all.png
- COMMAND LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/mgl ${CMAKE_BINARY_DIR}/examples/mgl_example
+# COMMAND LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/mgl ${CMAKE_BINARY_DIR}/examples/mgl_example
+ COMMAND ${CMAKE_BINARY_DIR}/examples/mgl_example
COMMAND touch ${CMAKE_SOURCE_DIR}/texinfo/png/all.png
# MAIN_DEPENDENCY ${CMAKE_BINARY_DIR}/examples/mgl_example
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo/png
# set_source_files_properties(${CMAKE_BINARY_DIR}/examples/mgl_example PROPERTIES GENERATED 1)
# ADD_CUSTOM_TARGET(gen_all_png DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png)
# ADD_DEPENDENCIES(gen_all_png mgl_example)
- set(list_texi_files_en mathgl_en.texi mgl_en.texi overview_en.texi example_en.texi ex_mgl_en.texi parse_en.texi core_en.texi concept_en.texi widget_en.texi data_en.texi other_en.texi samples_en.texi appendix_en.texi fdl.texi)
- set(list_texi_files_ru mathgl_ru.texi mgl_ru.texi overview_ru.texi example_ru.texi ex_mgl_ru.texi parse_ru.texi core_ru.texi concept_ru.texi widget_ru.texi data_ru.texi other_ru.texi samples_ru.texi appendix_ru.texi fdl.texi)
+ set(list_texi_files_en mathgl_en.texi mgl_en.texi overview_en.texi example_en.texi ex_mgl_en.texi parse_en.texi core_en.texi concept_en.texi widget_en.texi data_en.texi other_en.texi appendix_en.texi fdl.texi)
+ set(list_texi_files_ru mathgl_ru.texi mgl_ru.texi overview_ru.texi example_ru.texi ex_mgl_ru.texi parse_ru.texi core_ru.texi concept_ru.texi widget_ru.texi data_ru.texi other_ru.texi appendix_ru.texi fdl.texi)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.info
- COMMAND ${findth} --split=section mathgl_en.texi -o mathgl_en
- COMMAND ${findth} --split=section mgl_en.texi -o mgl_en
+ COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=section mathgl_en.texi -o mathgl_en
+ COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=node --frames -o mgl_web_en mathgl_en.texi
+ COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=no mgl_en.texi -o mgl_en.html
COMMAND ${findmi} --no-validate mathgl_en.texi
DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png
DEPENDS ${list_texi_files_en}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo
)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.info
- COMMAND ${findth} --split=section mathgl_ru.texi -o mathgl_ru
- COMMAND ${findth} --split=section mgl_ru.texi -o mgl_ru
+ COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=section mathgl_ru.texi -o mathgl_ru
+ COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=no mgl_ru.texi -o mgl_ru.html
COMMAND ${findmi} --no-validate mathgl_ru.texi
DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png
DEPENDS ${list_texi_files_ru}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo
)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.pdf
- COMMAND ${findtp} mathgl_en.texi
- COMMAND ${findtp} mathgl_en.texi
- COMMAND ${findtp} mathgl_en.texi
+ COMMAND ${findtp} -I ${CMAKE_SOURCE_DIR}/texinfo/png mathgl_en.texi
+ COMMAND ${findtp} -I ${CMAKE_SOURCE_DIR}/texinfo/png mathgl_en.texi
+ COMMAND ${findtp} -I ${CMAKE_SOURCE_DIR}/texinfo/png mathgl_en.texi
DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png
DEPENDS ${list_texi_files_en}
- DEPENDS ${list_texi_files_ru}
+# DEPENDS ${list_texi_files_ru}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo
)
add_custom_target(documentation ALL
DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.info
-# DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.pdf
+ DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.pdf
# DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.info
# DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.pdf
)
@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}).
+@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.
@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.
-@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
@cindex Mark style
@cindex Arrows
-The line style is defined by the string which may contain specifications for color (@samp{wkrgbcymhRGBCYMHWlenupqLENUPQ}), dashing style (@samp{-|;:ji=} or space), width (@samp{123456789}) and marks (@samp{*o+xsd.^v<>} and @samp{#} modifier). If one of the type of information is omitted then default values used with next color from palette (see @ref{Palette and colors}).
+The line style is defined by the string which may contain specifications for color (@samp{wkrgbcymhRGBCYMHWlenupqLENUPQ}), dashing style (@samp{-|;:ji=} or space), width (@samp{123456789}) and marks (@samp{*o+xsd.^v<>} and @samp{#} modifier). If one of the type of information is omitted then default values used with next color from palette (see @ref{Palette and colors}). Note, that internal color counter will be nullified by any change of palette. This includes even hidden change (for example, by @code{Box()} or @code{Axis()} functions).
@ifhtml
@html
By default palette contain following colors: <span style="color: rgb(76, 76, 76);">dark gray</span> ‘<samp>H</samp>’, <span style="color: rgb(0, 0, 255);">blue</span> ‘<samp>b</samp>’, <span style="color: rgb(0, 255, 0);">green</span> ‘<samp>g</samp>’, <span style="color: rgb(255, 0, 0);">red</span> ‘<samp>r</samp>’, <span style="color: rgb(0, 255, 255);">cyan</span> ‘<samp>c</samp>’, <span style="color: rgb(255, 0, 255);">magenta</span> ‘<samp>m</samp>’, <span style="color: rgb(255, 255, 0);">yellow</span> ‘<samp>y</samp>’, <span style="color: rgb(127, 127, 127);">gray</span> ‘<samp>h</samp>’, <span style="color: rgb(0, 255, 127);">green-blue</span> ‘<samp>l</samp>’, <span style="color: rgb(0, 127, 255);">sky-blue</span> ‘<samp>n</samp>’, <span style="color: rgb(255, 127, 0);">orange</span> ‘<samp>q</samp>’, <span style="color: rgb(127, 255, 0);">green-yellow</span> ‘<samp>e</samp>’, <span style="color: rgb(127, 0, 255);">blue-violet</span> ‘<samp>u</samp>’, <span style="color: rgb(255, 0, 127);">purple</span> ‘<samp>p</samp>’.
@end html
@end ifhtml
@ifnothtml
-The line style is defined by the string which may contain specifications for color (@samp{wkrgbcymhRGBCYMHWlenupqLENUPQ}), dashing style (@samp{-|;:ji} or space), width (@samp{0123456789}) and marks (@samp{o+xsd.^v} and @samp{#} modifier). If one of the type of information is omitted then default values used with the previous color or one from palette (for @pxref{1D plotting}) are adopted. By default palette contain following colors: dark gray @samp{H}, blue @samp{b}, green @samp{g}, red @samp{r}, cyan @samp{c}, magenta @samp{m}, yellow @samp{y}, gray @samp{h}, blue-green @samp{l}, sky-blue @samp{n}, orange @samp{q}, yellow-green @samp{e}, blue-violet @samp{u}, purple @samp{p}.
+By default palette contain following colors: dark gray @samp{H}, blue @samp{b}, green @samp{g}, red @samp{r}, cyan @samp{c}, magenta @samp{m}, yellow @samp{y}, gray @samp{h}, blue-green @samp{l}, sky-blue @samp{n}, orange @samp{q}, yellow-green @samp{e}, blue-violet @samp{u}, purple @samp{p}.
Dashing style has the following meaning: space -- no line (usable for plotting only marks), @samp{-} -- solid line (################), @samp{|} -- long dashed line (########________), @samp{;} -- dashed line (####____####____), @samp{=} -- small dashed line (##__##__##__##__), @samp{:} -- dotted line (#___#___#___#___), @samp{j} -- dash-dotted line (#######____#____), @samp{i} -- small dash-dotted line (###__#__###__#__).
@end ifnothtml
One may specify to draw a special symbol (an arrow) at the beginning and at the end of line. This is done if the specification string contains one of the following symbols: @samp{A} -- outer arrow, @samp{V} -- inner arrow, @samp{I} -- transverse hatches, @samp{K} -- arrow with hatches, @samp{T} -- triangle, @samp{S} -- square, @samp{D} -- rhombus, @samp{O} -- circle, @samp{_} -- nothing (the default). The following rule applies: the first symbol specifies the arrow at the end of line, the second specifies the arrow at the beginning of the line. For example, @samp{r-A} defines a red solid line with usual arrow at the end, @samp{b|AI} defines a blue dash line with an arrow at the end and with hatches at the beginning, @samp{_O} defines a line with the current style and with a circle at the beginning. These styles are applicable during the graphics plotting as well (for example, @ref{1D plotting}).
-@float
-@image{../png/style, 11cm}
-@caption{Color and line styles.}
-@end float
+@fig{png/style, Color and line styles.}
@c ------------------------------------------------------------------
@node Color scheme, Font styles, Line styles, General concepts
There are several useful combinations. String @samp{kw} corresponds to the simplest gray color scheme where higher values are brighter. String @samp{wk} presents the inverse gray color scheme where higher value is darker. Strings @samp{kRryw}, @samp{kGgw}, @samp{kBbcw} present the well-known @emph{hot}, @emph{summer} and @emph{winter} color schemes. Strings @samp{BbwrR} and @samp{bBkRr} allow to view bi-color figure on white or black background, where negative values are blue and positive values are red. String @samp{BbcyrR} gives a color scheme similar to the well-known @emph{jet} color scheme.
-@float
-@image{../png/schemes, 11cm}
-@caption{Most popular color schemes.}
-@end float
+@fig{png/schemes, Most popular color schemes.}
When coloring by @emph{coordinate} (used in @ref{map}), the final color is determined by the position of the point in 3d space and is calculated from formula c=x*c[1] + y*c[2]. Here, c[1], c[2] are the first two elements of color array; x, y are normalized to axis range coordinates of the point.
@c This type of coloring is useful for isosurface plot where color may show the exact position of a piece of surface.
MathGL have the fast variant of textual formula evaluation
@ifclear UDAV
- (@pxref{mglFormula class})
+(@pxref{Evaluate expression})
@end ifclear
. There are a lot of functions and operators available. The operators are: @samp{+} -- addition, @samp{-} -- subtraction, @samp{*} -- multiplication, @samp{/} -- division, @samp{^} -- integer power. Also there are logical ``operators'': @samp{<} -- true if x<y, @samp{>} -- true if x>y, @samp{=} -- true if x=y, @samp{&} -- true if x and y both nonzero, @samp{|} -- true if x or y nonzero. These logical operators have lowest priority and return 1 if true or 0 if false.
-@ifclear UDAV
-
@node Interfaces, , Command options, General concepts
@section Interfaces
+@ifset UDAV
+You can use @code{mglParse} class for executing MGL scripts from different languages.
+@end ifset
+
+@ifclear UDAV
+
The MathGL library has interfaces for a set of languages. Most of them are based on the C interface via SWIG tool. There are Python, Java, Octave, Lisp, C#, Guile, Lua, Modula 3, Ocaml, Perl, PHP, Pike, R, Ruby, and Tcl interfaces. Also there is a Fortran interface which has a similar set of functions, but slightly different types of arguments (integers instead of pointers). These functions are marked as [C function].
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].
@chapter MathGL core
@cindex mglGraph
+@ifset UDAV
+This chapter contains a lot of plotting commands for 1D, 2D and 3D data. It also encapsulates parameters for axes drawing. Moreover an arbitrary coordinate transformation can be used for each axis. Additional information about colors, fonts, formula parsing can be found in @ref{General concepts}.
+@end ifset
+
@ifclear UDAV
The core of MathGL is @strong{mglGraph} class defined in @code{#include <mgl/mgl.h>}. It contains a lot of plotting functions for 1D, 2D and 3D data. It also encapsulates parameters for axes drawing. Moreover an arbitrary coordinate transformation can be used for each axis. All plotting functions use data encapsulated in mglData class (see @ref{Data processing}) that allows to check sizes of used arrays easily. Also it have many functions for data handling: modify it by formulas, find momentums and distribution (histogram), apply operator (differentiate, integrate, transpose, Fourier and so on), change data sizes (interpolate, squeeze, crop and so on). Additional information about colors, fonts, formula parsing can be found in @ref{General concepts} and @ref{Other classes}.
@end ifclear
* Constructor::
* Graphics setup::
* Axis settings::
-* Transformation matrix::
+* Subplots and rotation::
* Export picture::
-* Primitives drawing::
+* Primitives::
* Text printing::
* Axis and Colorbar::
* Legend::
@cindex AlphaDef
@cindex TranspType
-There are several functions and variables for setup transparency. The general function is @ref{alpha} which switch on/off the transparency for overall plot. It influence only for graphics which created after @ref{alpha} call (with one exception, OpenGL). Function @ref{alphadef} specify the default value of alpha-channel. Finally, function @ref{transptype} set the kind of transparency. @sref{Transparent surface sample}
+There are several functions and variables for setup transparency. The general function is @ref{alpha} which switch on/off the transparency for overall plot. It influence only for graphics which created after @ref{alpha} call (with one exception, OpenGL). Function @ref{alphadef} specify the default value of alpha-channel. Finally, function @ref{transptype} set the kind of transparency. @sref{Transparency and lighting}
@anchor{alpha}
@deftypefn {MGL command} {} alpha @code{[val=on]}
@deftypefn {MGL command} {} transptype @code{val}
@ifclear UDAV
@deftypefnx {Method on @code{mglGraph}} @code{void} SetTranspType (@code{int} type)
-@deftypefnx {C function} @code{void} mgl_set_transp_type (@code{HMGL} gr, @code{int} enable)
+@deftypefnx {C function} @code{void} mgl_set_transp_type (@code{HMGL} gr, @code{int} type)
@end ifclear
-Set the transparency type. Normal transparency (@samp{0}) -- below things is less visible than upper ones. It does not look well in OpenGL mode (mglGraphGL) for several surfaces. 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{SetAlphaDef(0.3)} or less for lamp-like transparency. @xref{Normal transparency}, @ref{Glass-like transparency}, @ref{Lamp-like transparency}.
+Set the type of transparency. Possible values are:
+@itemize @bullet
+@item
+Normal transparency (@samp{0}) -- below things is less visible than upper ones. It does not look well in OpenGL mode (mglGraphGL) for several surfaces.
+@item
+Glass-like transparency (@samp{1}) -- below and upper things are commutable and just decrease intensity of light by RGB channel.
+@item
+Lamp-like transparency (@samp{2}) -- below and upper things are commutable and are the source of some additional light. I recommend to set @code{SetAlphaDef(0.3)} or less for lamp-like transparency.
+@end itemize
+@sref{Types of transparency}.
@end deftypefn
@c ==================================================================
@deftypefnx {Method on @code{mglGraph}} @code{void} Fog (@code{float} d, @code{float} dz=@code{0.25})
@deftypefnx {C function} @code{void} mgl_set_fog (@code{HMGL} gr, @code{float} d, @code{float} dz)
@end ifclear
-Function 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 ~ 1-exp(-@emph{d*z}). Here @emph{z} is normalized to 1 depth of the plot. If value @var{d}=@code{0} then the fog is absent. Note, that fog was applied at stage of image creation, not at stage of drawing. @sref{Surface in fog sample}
+Function 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 ~ 1-exp(-@emph{d*z}). Here @emph{z} is normalized to 1 depth of the plot. If value @var{d}=@code{0} then the fog is absent. Note, that fog was applied at stage of image creation, not at stage of drawing. @sref{Adding fog}
@end deftypefn
@c ==================================================================
@deftypefnx {Method on @code{mglGraph}} @code{void} SetArrowSize (@code{float} val)
@deftypefnx {C function} @code{void} mgl_set_arrow_size (@code{HMGL} gr, @code{float} val)
@end ifclear
-Sets size of arrows for @ref{1D plotting}, lines and curves (see @ref{Primitives drawing}). Default value is @code{0.03}.
+Sets size of arrows for @ref{1D plotting}, lines and curves (see @ref{Primitives}). Default value is @code{0.03}.
@end deftypefn
@anchor{meshnum}
@deftypefnx {Method on @code{mglGraph}} @code{void} SetPalette (@code{const char *}@var{colors})
@deftypefnx {C function} @code{void} mgl_set_palette (@code{HMGL} gr, @code{const char *}@var{colors})
@end ifclear
-Sets the palette as selected colors. Default value is @code{"Hbgrcmyhlnqeup"} that corresponds to colors: dark gray @samp{H}, blue @samp{b}, green @samp{g}, red @samp{r}, cyan @samp{c}, magenta @samp{m}, yellow @samp{y}, gray @samp{h}, blue-green @samp{l}, sky-blue @samp{n}, orange @samp{q}, yellow-green @samp{e}, blue-violet @samp{u}, purple @samp{p}. The palette is used mostly in 1D plots (see @ref{1D plotting}) for curves which styles are not specified.
+Sets the palette as selected colors. Default value is @code{"Hbgrcmyhlnqeup"} that corresponds to colors: dark gray @samp{H}, blue @samp{b}, green @samp{g}, red @samp{r}, cyan @samp{c}, magenta @samp{m}, yellow @samp{y}, gray @samp{h}, blue-green @samp{l}, sky-blue @samp{n}, orange @samp{q}, yellow-green @samp{e}, blue-violet @samp{u}, purple @samp{p}. The palette is used mostly in 1D plots (see @ref{1D plotting}) for curves which styles are not specified. Internal color counter will be nullified by any change of palette. This includes even hidden change (for example, by @code{Box()} or @code{Axis()} functions).
@end deftypefn
@c ==================================================================
@c ==================================================================
-@node Axis settings, Transformation matrix, Graphics setup, MathGL core
+@node Axis settings, Subplots and rotation, Graphics setup, MathGL core
@section Axis settings
These large set of variables and functions 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 if @code{Cut=true} (see @ref{Cutting}), after it transformation formulas are applied, and finally the data was normalized in bounding box.
@deftypefnx {Method on @code{mglGraph}} @code{void} SetCoor (@code{int} how)
@deftypefnx {C function} @code{void} mgl_set_coor (@code{HMGL} gr, @code{int} how)
@end ifclear
-Sets one of the predefined transformation formulas for curvilinear coordinate. Paramater @var{how} define the coordinates: @code{mglCartesian=0} -- Cartesian coordinates (no transformation); @code{mglPolar=1} -- Polar coordiantes @math{x_n=x*cos(y),y_n=x*sin(y), z_n=z}; @code{mglSpherical=2} -- Sperical coordinates @math{x_n=x*sin(y)*cos(z), y_n=x*sin(y)*sin(z), z_n=x*cos(y)}; @code{mglParabolic=3} -- Parabolic coordinates @math{x_n=x*y, y_n=(x*x-y*y)/2, z_n=z}; @code{mglParaboloidal=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}; @code{mglOblate=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)}; @code{mglProlate=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)}; @code{mglElliptic=7} -- Elliptic coordinates @math{x_n=cosh(x)*cos(y), y_n=sinh(x)*sin(y), z_n=z}; @code{mglToroidal=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))}; @code{mglBispherical=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))}; @code{mglBipolar=10} -- Bipolar coordinates @math{x_n=sinh(x)/(cosh(x)-cos(y)), y_n=sin(y)/(cosh(x)-cos(y)), z_n=z}; @code{mglLogLog=11} -- log-log coordiantes @math{x_n=lg(x), y_n=lg(y), z_n=lg(z)}; @code{mglLogX=12} -- log-x coordiantes @math{x_n=lg(x), y_n=y, z_n=z}; @code{mglLogY=13} -- log-y coordiantes @math{x_n=x, y_n=lg(y), z_n=z}.
+Sets one of the predefined transformation formulas for curvilinear coordinate. Paramater @var{how} define the coordinates: @code{mglCartesian=0} -- Cartesian coordinates (no transformation); @code{mglPolar=1} -- Polar coordinates @math{x_n=x*cos(y),y_n=x*sin(y), z_n=z}; @code{mglSpherical=2} -- Sperical coordinates @math{x_n=x*sin(y)*cos(z), y_n=x*sin(y)*sin(z), z_n=x*cos(y)}; @code{mglParabolic=3} -- Parabolic coordinates @math{x_n=x*y, y_n=(x*x-y*y)/2, z_n=z}; @code{mglParaboloidal=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}; @code{mglOblate=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)}; @code{mglProlate=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)}; @code{mglElliptic=7} -- Elliptic coordinates @math{x_n=cosh(x)*cos(y), y_n=sinh(x)*sin(y), z_n=z}; @code{mglToroidal=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))}; @code{mglBispherical=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))}; @code{mglBipolar=10} -- Bipolar coordinates @math{x_n=sinh(x)/(cosh(x)-cos(y)), y_n=sin(y)/(cosh(x)-cos(y)), z_n=z}; @code{mglLogLog=11} -- log-log coordinates @math{x_n=lg(x), y_n=lg(y), z_n=lg(z)}; @code{mglLogX=12} -- log-x coordinates @math{x_n=lg(x), y_n=y, z_n=z}; @code{mglLogY=13} -- log-y coordinates @math{x_n=x, y_n=lg(y), z_n=z}.
@end deftypefn
@anchor{ternary}
@end deftypefn
@c ##################################################################
-@node Transformation matrix, Export picture, Axis settings, MathGL core
-@section Transformation matrix
+@node Subplots and rotation, Export picture, Axis settings, MathGL core
+@section Subplots and rotation
@cindex Aspect
@cindex Rotate
@cindex RotateN
@deftypefnx {C function} @code{void} mgl_subplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{const char *}stl)
@deftypefnx {C function} @code{void} mgl_subplot_d (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{const char *}stl, @code{float} dx, @code{float} dy)
@end ifclear
-Puts further plotting in a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating the subplot. Extra space will be reserved for axis/colorbar if @var{stl} 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. From the aesthetical point of view it is not recommended to use this function 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}.
+Puts further plotting in a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating the subplot. Extra space will be reserved for axis/colorbar if @var{stl} contain:
+@itemize @bullet
+@item
+@samp{L} or @samp{<} -- at left side,
+@item
+@samp{R} or @samp{>} -- at right side,
+@item
+@samp{A} or @samp{^} -- at top side,
+@item
+@samp{U} or @samp{_} -- at bottom side.
+@end itemize
+From the aesthetical point of view it is not recommended to use this function 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
@anchor{multiplot}
@deftypefnx {Method on @code{mglGraph}} @code{void} MultiPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}stl=@code{"<>_^"})
@deftypefnx {C function} @code{void} mgl_multiplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}stl)
@end ifclear
-Puts further plotting in a rectangle of @var{dx}*@var{dy} cells starting from @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating subplot. Extra space will be reserved for axis/colorbar if @var{stl} 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.
+Puts further plotting in a rectangle of @var{dx}*@var{dy} cells starting from @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating subplot. Extra space will be reserved for axis/colorbar if @var{stl} contain:
+@itemize @bullet
+@item
+@samp{L} or @samp{<} -- at left side,
+@item
+@samp{R} or @samp{>} -- at right side,
+@item
+@samp{A} or @samp{^} -- at top side,
+@item
+@samp{U} or @samp{_} -- at bottom side.
+@end itemize
@end deftypefn
@anchor{inplot}
@deftypefnx {C function} @code{void} mgl_title (@code{HMGL} gr, @code{const char *}txt, @code{const char *}stl, @code{float} size)
@deftypefnx {C function} @code{void} mgl_titlew (@code{HMGL} gr, @code{const wchar_t *}txt, @code{const char *}stl, @code{float} size)
@end ifclear
-Add text @var{title} for current subplot/inplot by font @var{stl} with specified @var{size}. If @var{stl} contains @samp{#} then bounding box around title will be drawn. This function set off any aspects or rotations. So it should be used just after creating subplot.
+Add text @var{title} for current subplot/inplot. Paramater @var{stl} can contain:
+@itemize @bullet
+@item
+font style (see, @ref{Font styles});
+@item
+@samp{#} for box around the title.
+@end itemize
+Parameter @var{size} set font size. This function set off any aspects or rotations. So it should be used just after creating subplot.
@end deftypefn
@anchor{rotate}
@end ifclear
@c ##################################################################
-@node Export picture, Primitives drawing, Transformation matrix, MathGL core
+@node Export picture, Primitives, Subplots and rotation, MathGL core
@section Export picture
@cindex SetSize
@deftypefn {Method on @code{mglGraph}} @code{void} ExportMGLD (@code{const char *}fname, @code{const char *}descr=@code{""})
@deftypefnx {C function} @code{void} mgl_export_mgld (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr)
-Exports points and primitives in file using MGLD format. Later this file can be used for faster loading and viewing by @code{mglview} utility (see @ref{Utilities}). Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name).
+Exports points and primitives in file using MGLD format. Later this file can be used for faster loading and viewing by @code{mglview} utility. Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name).
@end deftypefn
@deftypefn {Method on @code{mglGraph}} @code{void} ImportMGLD (@code{const char *}fname, @code{const char *}descr=@code{""})
@deftypefnx {C function} @code{void} mgl_import_mgld (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr)
-Imports points and primitives in file using MGLD format. Later this file can be used for faster loading and viewing by @code{mglview} utility (see @ref{Utilities}). Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name).
+Imports points and primitives in file using MGLD format. Later this file can be used for faster loading and viewing by @code{mglview} utility. Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name).
@end deftypefn
@end ifclear
@subsection Frames/Animation
@ifset UDAV
-There are no commands for making animation in MGL. However you can use features of utilities (see @ref{Utilities}). For example, by busing special comments @samp{##a } or @samp{##c }.
+There are no commands for making animation in MGL. However you can use features of @code{mglconv} and @code{mglview} utilities. For example, by busing special comments @samp{##a } or @samp{##c }.
@end ifset
@ifclear UDAV
@deftypefn {Method on @code{mglGraph}} @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 (see @ref{Transformation matrix}).
+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 (see @ref{Subplots and rotation}).
@end deftypefn
@deftypefn {Method on @code{mglGraph}} @code{mglPoint} CalcScr (@code{mglPoint} p)
@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 (see @ref{Transformation matrix}).
+Calculate screen point @{xs,ys@} for 3D coordinate @{x,y,z@}. The calculation are done for the last used InPlot (see @ref{Subplots and rotation}).
@end deftypefn
@deftypefn {Method on @code{mglGraph}} @code{void} SetObjId (@code{int} id)
@c ##################################################################
-@node Primitives drawing, Text printing, Export picture, MathGL core
-@section Primitives drawing
+@node Primitives, Text printing, Export picture, MathGL core
+@section Primitives
@cindex Ball
@cindex Clf
@cindex Line
@end ifclear
-These functions draw some simple objects like line, point, sphere, drop, cone and so on. @sref{Primitives sample}
+These functions draw some simple objects like line, point, sphere, drop, cone and so on. @sref{Using primitives}
@anchor{clf}
@deftypefn {MGL command} {} clf
@deftypefnx {Method on @code{mglGraph}} @code{void} Drop (@code{mglPoint} p, @code{mglPoint} d, @code{float} r, @code{const char *}stl=@code{"r"}, @code{float} shift=@code{1}, @code{float} ap=@code{1})
@deftypefnx {C function} @code{void} mgl_drop (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} dx, @code{float} dy, @code{float} dz, @code{float} r, @code{const char *}col, @code{float} shift, @code{float} ap)
@end ifclear
-Draw the drop with radius @var{r} at point @var{p} elongated in direction @var{d} and with color @var{col}. Parameter @var{shift} set the degree of drop oblongness: @samp{0} is sphere, @samp{1} is maximally oblongness drop. Parameter @var{ap} set relative width of the drop (this is analogue of ``ellipticity'' for the sphere). @sref{Drops sample}
+Draw the drop with radius @var{r} at point @var{p} elongated in direction @var{d} and with color @var{col}. Parameter @var{shift} set the degree of drop oblongness: @samp{0} is sphere, @samp{1} is maximally oblongness drop. Parameter @var{ap} set relative width of the drop (this is analogue of ``ellipticity'' for the sphere).
@end deftypefn
@anchor{cone}
@ifclear UDAV
@deftypefnx {Method on @code{mglGraph}} @code{void} Circle (@code{mglPoint} p, @code{float} r, @code{const char *}stl=@code{"r"})
@end ifclear
-Draw the circle with radius @var{r} and center at point @var{p}=@{@var{x0}, @var{y0}, @var{z0}@} and color @var{stl}. If @var{col} contain: @samp{#} then wire figure is drawn, @samp{@@} then boundary is drawn (by second color of @var{col} or by black).
+Draw the circle with radius @var{r} and center at point @var{p}=@{@var{x0}, @var{y0}, @var{z0}@}. Parameter @var{col} may contain
+@itemize @bullet
+@item
+colors for filling and boundary (second one if style @samp{@@} is used, black color is used by default);
+@item
+@samp{#} for wire figure (boundary only);
+@item
+@samp{@@} for filling and boundary.
+@end itemize
@end deftypefn
@anchor{ellipse}
@deftypefnx {Method on @code{mglGraph}} @code{void} Ellipse (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r, @code{const char *}col=@code{"r"})
@deftypefnx {C function} @code{void} mgl_ellipse (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r, @code{const char *}col)
@end ifclear
-Draw the ellipse with radius @var{r} and focal points @var{p1}, @var{p2} by color @var{col}. If @var{col} contain: @samp{#} then wire figure is drawn, @samp{@@} then boundary is drawn (by second color of @var{col} or by black).
+Draw the ellipse with radius @var{r} and focal points @var{p1}, @var{p2}. Parameter @var{col} may contain
+@itemize @bullet
+@item
+colors for filling and boundary (second one if style @samp{@@} is used, black color is used by default);
+@item
+@samp{#} for wire figure (boundary only);
+@item
+@samp{@@} for filling and boundary.
+@end itemize
@end deftypefn
@anchor{rhomb}
@deftypefnx {Method on @code{mglGraph}} @code{void} Rhomb (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r, @code{const char *}col=@code{"r"})
@deftypefnx {C function} @code{void} mgl_rhomb (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r, @code{const char *}col)
@end ifclear
-Draw the rhombus with width @var{r} and edge points @var{p1}, @var{p2} by color @var{col}. If @var{col} contain: @samp{#} then wire figure is drawn, @samp{@@} then boundary is drawn (by second color of @var{col} or by black). If @var{col} contain 3 colors then gradient filling is used.
+Draw the rhombus with width @var{r} and edge points @var{p1}, @var{p2}. Parameter @var{col} may contain
+@itemize @bullet
+@item
+colors for filling and boundary (second one if style @samp{@@} is used, black color is used by default);
+@item
+@samp{#} for wire figure (boundary only);
+@item
+@samp{@@} for filling and boundary.
+@end itemize
@end deftypefn
@c ##################################################################
-@node Text printing, Axis and Colorbar, Primitives drawing, MathGL core
+@node Text printing, Axis and Colorbar, Primitives, MathGL core
@section Text printing
@ifclear UDAV
@cindex Puts
The font parameters are described by string. This string may set the text color @samp{wkrgbcymhRGBCYMHW} (see @ref{Color styles}). Also, after delimiter symbol @samp{:}, it can contain characters of font type (@samp{rbiwou}) and/or align (@samp{LRC}) specification. The font types are: @samp{r} -- roman (or regular) font, @samp{i} -- italic style, @samp{b} -- bold style, @samp{w} -- wired style, @samp{o} -- over-lined text, @samp{u} -- underlined text. By default roman font is used. The align types are: @samp{L} -- align left (default), @samp{C} -- align center, @samp{R} -- align right. For example, string @samp{b:iC} correspond to italic font style for centered text which printed by blue color.
-If string contains symbols @samp{aA} then text is printed at arbitrary position @{@var{x}, @var{y}@} (supposed to be in range [0,1]) of subplot (for @samp{a}) or picture (for @samp{A}). If string contains symbol @samp{@@} then box around text is drawn.
+If string contains symbols @samp{aA} then text is printed at absolute position @{@var{x}, @var{y}@} (supposed to be in range [0,1]) of subplot (for @samp{a}) or picture (for @samp{A}). If string contains symbol @samp{@@} then box around text is drawn.
-@sref{Text sample}
+@sref{Text features}
@anchor{text}
@deftypefn {MGL command} {} text @code{x y} 'text' ['fnt'='' @code{size=-1}]
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
-@anchor{label}
@deftypefn {MGL command} {} label @code{x y} 'text' ['fnt'='']
@ifclear UDAV
@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{float} x, @code{float} y, @code{const char *}text, @code{const char *}fnt=@code{""})
@deftypefnx {Method on @code{mglGraph}} @code{void} Axis (@code{const char *}dir=@code{"xyz"}, @code{const char *}stl=@code{""})
@deftypefnx {C function} @code{void} mgl_axis (@code{HMGL} gr, @code{const char *}dir, @code{const char *}stl)
@end ifclear
-Draws axes with ticks (see @ref{Axis settings}) 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 @var{FontDef} (see @ref{Font settings}). Ticks will be adjusted if @var{stl} contain @samp{a} (by call of @code{AdjustTicks()}). You can specified an arrow at the end of axis (see see @ref{Line styles}). Styles of ticks and axis can be overrided by using @var{stl} string. @sref{Axis and ticks}
+Draws axes with ticks (see @ref{Axis settings}). Parameter @var{dir} may contain:
+@itemize @bullet
+@item
+@samp{xyz} for drawing axis in corresponding direction;
+@item
+@samp{_} for disabling tick labels;
+@item
+@samp{AKDTVISO} for drawing arrow at the end of axis;
+@item
+@samp{a} for forced adjusting of axis ticks.
+@end itemize
+Styles of ticks and axis can be overrided by using @var{stl} string. @sref{Axis and ticks}
@end deftypefn
@anchor{colorbar}
@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const char *}sch=@code{""})
@deftypefnx {C function} @code{void} mgl_colorbar (@code{HMGL} gr, @code{const char *}sch)
@end ifclear
-Draws colorbar with color scheme @var{sch} (current scheme if @code{sch=""}) at edge of plot. If string @var{sch} contains @samp{<>^_} then the colorbar is placed at left, at right, at top or at bottom correspondingly. If string have @samp{I} then colorbar will be located near bounding box otherwise at the edge of the subplot. If string have @samp{A} then absolute (relative to picture) coordinates is used. @sref{Colorbars}
+Draws colorbar. Parameter @var{sch} may contain:
+@itemize @bullet
+@item
+color scheme (see @ref{Color scheme});
+@item
+@samp{<>^_} for positioning at left, at right, at top or at bottom correspondingly;
+@item
+@samp{I} for positioning near bounding (by default, is positioned at edges of subplot);
+@item
+@samp{A} for using absolute coordinates.
+@end itemize
+@sref{Colorbars}
@end deftypefn
@deftypefn {MGL command} {} colorbar vdat ['sch'='']
@deftypefnx {C function} @code{void} mgl_box (@code{HMGL} gr, @code{int} ticks)
@deftypefnx {C function} @code{void} mgl_box_str (@code{HMGL} gr, @code{const char *}col, @code{int} ticks)
@end ifclear
-Draws bounding box outside the plotting volume with color @var{col}. If @var{col} contain @samp{@@} then filled faces are drawn. At this first color is used for faces (default is light yellow), last one for edges. @sref{Box sample}
+Draws bounding box outside the plotting volume with color @var{col}. If @var{col} contain @samp{@@} then filled faces are drawn. At this first color is used for faces (default is light yellow), last one for edges. @sref{Bounding box}
@end deftypefn
@anchor{xlabel}
@cindex SetLegendBox
@cindex SetLegendMarks
-These functions draw legend to the graph (useful for @ref{1D plotting}). Legend entry is a pair of strings: one for style of the line, another one with description text (with included TeX parsing). The arrays of strings may be used directly or by accumulating first to the internal arrays (by function @ref{addlegend}) and further plotting it. The position of the legend can be selected automatic or manually. Parameters @var{fnt} and @var{size} specify the font style and size (see @ref{Font settings}). Parameter @var{llen} set the relative width of the line sample and the text indent. If line style string for entry is empty then the corresponding text is printed without indent. If string @var{fnt} contains symbol @samp{A} then legend coordinates set position in the picture (not in the current subplot). If string @var{fnt} contains symbol @samp{#} then box around legend is drawn. @sref{Legend sample}
+These functions draw legend to the graph (useful for @ref{1D plotting}). Legend entry is a pair of strings: one for style of the line, another one with description text (with included TeX parsing). The arrays of strings may be used directly or by accumulating first to the internal arrays (by function @ref{addlegend}) and further plotting it. The position of the legend can be selected automatic or manually (even out of bounding box). Parameters @var{fnt} and @var{size} specify the font style and size (see @ref{Font settings}). Parameter @var{llen} set the relative width of the line sample and the text indent. If line style string for entry is empty then the corresponding text is printed without indent. Parameter @var{fnt} may contain:
+@itemize @bullet
+@item
+font style for legend text;
+@item
+@samp{A} for positioning in absolute coordinates;
+@item
+@samp{#} for drawing box around legend;
+@item
+colors for background (first one) and border (second one) of legend. Note, that last color is always used as color for legend text.
+@end itemize
+@sref{Legend sample}
@anchor{legend}
@deftypefn {MGL command} {} legend [@code{pos=3} 'fnt'='#' @code{size=-0.8 llen=0.1}]
@cindex Error
@cindex BoxPlot
@cindex Candle
+@cindex Tape
+@cindex Label
+@cindex Cones
These functions 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. By default (if absent) values of @var{x}[i] are equidistantly distributed in axis range, and @var{z}[i]=@var{Min}.z. 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 @code{x.nx=y.nx=z.nx}.
-String @var{pen} specifies the color and style of line and marks (see @ref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (see @ref{Palette and colors}). String @var{opt} contain command options (see @ref{Command options}). @sref{1D samples}
+String @var{pen} specifies the color and style of line and marks (see @ref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (see @ref{Palette and colors}). Symbol @samp{!} set to use new color from palette for each point (not for each curve, as default). String @var{opt} contain command options (see @ref{Command options}). @sref{1D samples}
@anchor{plot}
@deftypefn {MGL command} {} plot ydat ['stl'='']
@deftypefnx {C function} @code{void} mgl_plot_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_plot_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt)
@end ifclear
-These functions draw continuous lines between points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. See also @ref{area}, @ref{step}, @ref{stem}, @ref{tube}, @ref{mark}, @ref{error}, @ref{belt}, @ref{tens}. @sref{Plot sample}
+These functions draw continuous lines between points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. See also @ref{area}, @ref{step}, @ref{stem}, @ref{tube}, @ref{mark}, @ref{error}, @ref{belt}, @ref{tens}, @ref{tape}. @sref{Plot sample}
@end deftypefn
@anchor{radar}
These functions draw continuous lines between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} with color defined by the special array @var{c}[i] (look like tension plot). String @var{pen} specifies the color scheme (see @ref{Color scheme}) and style and/or width of line (see @ref{Line styles}). By default (@code{pen=""}) solid line with current color scheme is used. See also @ref{plot}, @ref{mesh}, @ref{fall}. @sref{Tens sample}
@end deftypefn
+@anchor{tape}
+@deftypefn {MGL command} {} tape ydat ['stl'='']
+@deftypefnx {MGL command} {} tape xdat ydat ['stl'='']
+@deftypefnx {MGL command} {} tape xdat ydat zdat ['stl'='']
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} Tape (@code{const mglData &}y, @code{const char *}pen=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Tape (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}pen=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Tape (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}pen=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {C function} @code{void} mgl_tape (@code{HMGL} gr, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_tape_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_tape_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt)
+@end ifclear
+These functions draw tapes of normals for curve between points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Initial tape(s) was selected in x-y plane (for @samp{x} in @var{pen}) and/or y-z plane (for @samp{x} in @var{pen}). The width of tape is proportional to @code{SetBarWidth()}. See also @ref{plot}, @ref{flow}, @ref{barwidth}. @sref{Tape sample}
+@end deftypefn
+
@anchor{area}
@deftypefn {MGL command} {} area ydat ['stl'='']
@deftypefnx {MGL command} {} area xdat ydat ['stl'='']
@deftypefnx {C function} @code{void} mgl_bars_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_bars_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt)
@end ifclear
-These functions draw vertical bars from points to axis plane. If string contain symbol @samp{a} then lines are drawn one above another (like summation). 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 give 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}, @ref{barwidth}. @sref{Bars sample}
+These functions draw vertical bars from points to axis plane. If string contain symbol @samp{a} then lines are drawn one above another (like summation). 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 give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. See also @ref{barh}, @ref{cones}, @ref{area}, @ref{stem}, @ref{chart}, @ref{barwidth}. @sref{Bars sample}
@end deftypefn
@anchor{barh}
These functions draw horizontal bars from points to axis plane. If string contain symbol @samp{a} then lines are drawn one above another (like summation). 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 give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. See also @ref{bars}, @ref{barwidth}. @sref{Barh sample}
@end deftypefn
+@anchor{cones}
+@deftypefn {MGL command} {} cones ydat ['stl'='']
+@deftypefnx {MGL command} {} cones xdat ydat ['stl'='']
+@deftypefnx {MGL command} {} cones xdat ydat zdat ['stl'='']
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} Cones (@code{const mglData &}y, @code{const char *}pen=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Cones (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}pen=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Cones (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}pen=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {C function} @code{void} mgl_cones (@code{HMGL} gr, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_cones_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_cones_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt)
+@end ifclear
+These functions draw cones from points to axis plane. If string contain symbol @samp{a} then cones are drawn one above another (like summation). You can give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. See also @ref{bars}, @ref{barwidth}. @sref{Cones sample}
+@end deftypefn
+
+
+
@anchor{chart}
@deftypefn {MGL command} {} chart adat ['col'='']
@ifclear UDAV
@deftypefnx {C function} @code{void} mgl_error_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ey, @code{const char *}pen, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_error_exy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ex, @code{HCDT} ey, @code{const char *}pen, @code{const char *}opt)
@end ifclear
-These functions draw error boxes @{@var{ex}[i], @var{ey}[i]@} at points @{@var{x}[i], @var{y}[i]@}. This can be useful, for example, in experimental points, or to show numeric error or some estimations and so on. If string @var{pen} contain symbol @samp{@@} than large semitransparent mark is used instead of error box. See also @ref{plot}, @ref{plot}. @sref{Error sample}
+These functions draw error boxes @{@var{ex}[i], @var{ey}[i]@} at points @{@var{x}[i], @var{y}[i]@}. This can be useful, for example, in experimental points, or to show numeric error or some estimations and so on. If string @var{pen} contain symbol @samp{@@} than large semitransparent mark is used instead of error box. See also @ref{plot}, @ref{mark}. @sref{Error sample}
@end deftypefn
@anchor{mark}
These functions draw string @var{txt} as marks with size proportional to @var{r}[i]*@var{marksize} at points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. By default (if omitted) @var{r}[i]=1. See also @ref{plot}, @ref{mark}, @ref{stem}. @sref{TextMark sample}
@end deftypefn
+
+
+@anchor{label}
+@deftypefn {MGL command} {} label ydat 'txt' ['stl'='']
+@deftypefnx {MGL command} {} label xdat ydat 'txt' ['stl'='']
+@deftypefnx {MGL command} {} label xdat ydat zdat 'txt' ['stl'='']
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{const mglData &}y, @code{const char *}txt, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{const mglData &}y, @code{const wchar_t *}txt, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}txt, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{const mglData &}x, @code{const mglData &}y, @code{const wchar_t *}txt, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}txt, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const wchar_t *}txt, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {C function} @code{void} mgl_label (@code{HMGL} gr, @code{HCDT} y, @code{const char *}txt, @code{const char *}fnt, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_labelw (@code{HMGL} gr, @code{HCDT} y, @code{const wchar_t *}txt, @code{const char *}fnt, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_label_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}txt, @code{const char *}fnt, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_labelw_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const wchar_t *}txt, @code{const char *}fnt, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_label_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}txt, @code{const char *}fnt, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_labelw_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const wchar_t *}txt, @code{const char *}fnt, @code{const char *}opt)
+@end ifclear
+These functions draw string @var{txt} at points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. If string @var{txt} contain @samp{%x}, @samp{%y}, @samp{%z} or @samp{%n} then it will be replaced by the value of x-,y-,z-coordinate of the point or its index. See also @ref{plot}, @ref{mark}, @ref{textmark}. @sref{Label sample}
+@end deftypefn
+
@anchor{tube}
@deftypefn {MGL command} {} tube ydat rdat ['stl'='']
@deftypefnx {MGL command} {} tube ydat @code{rval} ['stl'='']
@cindex Grid
-These functions 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}. By default (if absent) values of @var{x}, @var{y} are equidistantly distributed in axis range. The plots are drawn for each z slice of the data. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (see @ref{Command options}). @sref{2D samples}
+These functions 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}. By default (if absent) values of @var{x}, @var{y} are equidistantly distributed in axis range. The plots are drawn for each z slice of the data. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. String @var{opt} contain command options (see @ref{Command options}). @sref{2D samples}
@anchor{surf}
@deftypefn {MGL command} {} surf zdat ['sch'='']
@deftypefnx {C function} @code{void} mgl_grid (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_grid_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws grid lines for density plot of surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} at @var{z} = @var{zVal}. String @var{sch} sets the color scheme. Previous color scheme is used by default. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Grid is plotted for each z slice of the data. See also @ref{dens}, @ref{cont}, @ref{contf}, @ref{meshnum}.
+The function draws grid lines for density plot of surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} at @var{z} = @var{zVal}. String @var{sch} sets the color scheme. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Grid is plotted for each z slice of the data. See also @ref{dens}, @ref{cont}, @ref{contf}, @ref{meshnum}.
@end deftypefn
@cindex Cloud
@cindex Beam
-These functions 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}.By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{a} should be equal @code{x.nx=a.nx && y.nx=a.ny && z.nz=a.nz} or @code{x.nx=y.nx=z.nx=a.nx && x.ny=y.ny=z.ny=a.ny && x.nz=y.nz=z.nz=a.nz}. Arrays @var{x}, @var{y} and @var{z} can be vectors (not matrices as @var{a}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (see @ref{Command options}). @sref{3D samples}
+These functions 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}.By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{a} should be equal @code{x.nx=a.nx && y.nx=a.ny && z.nz=a.nz} or @code{x.nx=y.nx=z.nx=a.nx && x.ny=y.ny=z.ny=a.ny && x.nz=y.nz=z.nz=a.nz}. Arrays @var{x}, @var{y} and @var{z} can be vectors (not matrices as @var{a}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. String @var{opt} contain command options (see @ref{Command options}). @sref{3D samples}
@anchor{surf3}
@deftypefn {MGL command} {} surf3 adat @code{val} ['sch'='']
@cindex Map
@cindex STFA
-These plotting functions draw @emph{two matrix} simultaneously. There are 5 generally different types of data representations: surface or isosurface colored by other data (SurfC, Surf3C), surface or isosurface transpared by other data (SurfA, Surf3A), tiles with variable size (TileS), mapping diagram (Map), STFA diagram (STFA). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{c} should be equal. Arrays @var{x}, @var{y} (and @var{z} for @code{Surf3C, Surf3A}) can be vectors (not matrices as @var{c}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (see @ref{Command options}).
+These plotting functions draw @emph{two matrix} simultaneously. There are 5 generally different types of data representations: surface or isosurface colored by other data (SurfC, Surf3C), surface or isosurface transpared by other data (SurfA, Surf3A), tiles with variable size (TileS), mapping diagram (Map), STFA diagram (STFA). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{c} should be equal. Arrays @var{x}, @var{y} (and @var{z} for @code{Surf3C, Surf3A}) can be vectors (not matrices as @var{c}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. String @var{opt} contain command options (see @ref{Command options}).
@anchor{surfc}
@deftypefn {MGL command} {} surfc zdat cdat ['sch'='']
@deftypefnx {C function} @code{void} mgl_map (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_map_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws mapping plot for matrices @{@var{ax}, @var{ay} @} which parametrically depend on coordinates @var{x}, @var{y}. The initial position of the cell (point) is marked by color. Height is proportional to Jacobian(ax,ay). This plot is like Arnold diagram ???. If string @var{sch} contain symbol @samp{.} then the color ball at matrix knots are drawn otherwise face is drawn. @sref{Map sample}
+The function draws mapping plot for matrices @{@var{ax}, @var{ay} @} which parametrically depend on coordinates @var{x}, @var{y}. The initial position of the cell (point) is marked by color. Height is proportional to Jacobian(ax,ay). This plot is like Arnold diagram ???. If string @var{sch} contain symbol @samp{.} then the color ball at matrix knots are drawn otherwise face is drawn. @sref{Mapping visualization}
@end deftypefn
@anchor{stfa}
@cindex FlowP
@cindex Pipe
-These functions perform plotting of 2D and 3D vector fields. There are 5 generally different types of vector fields representations: simple vector field (Vect), vectors along the curve (Traj), vector field by dew-drops (Dew), flow threads (Flow, FlowP), flow pipes (Pipe). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{ax} should be equal. The size of @var{ax}, @var{ay} and @var{az} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not matrices as @var{ax}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (see @ref{Command options}).
+These functions perform plotting of 2D and 3D vector fields. There are 5 generally different types of vector fields representations: simple vector field (Vect), vectors along the curve (Traj), vector field by dew-drops (Dew), flow threads (Flow, FlowP), flow pipes (Pipe). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{ax} should be equal. The size of @var{ax}, @var{ay} and @var{az} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not matrices as @var{ax}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. String @var{opt} contain command options (see @ref{Command options}).
@anchor{traj}
@deftypefn {MGL command} {} traj xdat ydat udat vdat ['sch'='']
@deftypefnx {C function} @code{void} mgl_vect_2d (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_vect_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws plane vector field plot for the field @{@var{ax}, @var{ay}@} depending parametrically on coordinates @var{x}, @var{y} at level @var{z}=@var{Min}.z. The length and color of arrows are proportional to @math{\sqrt@{ax^2+ay^2@}}. The number of arrows depend on @ref{meshnum}. The apperance of the hachures (arrows) can be changed by symbols: @samp{f} for drawing fixed length arrows, @samp{>}, @samp{<} for drawing arrows to or from the cell point (default is centering), @samp{.} for drawing hachures with dots instead of arrows, @samp{=} for enabling color gradient along arrows. See also @ref{flow}, @ref{dew}. @sref{Vect sample}
+The function draws plane vector field plot for the field @{@var{ax}, @var{ay}@} depending parametrically on coordinates @var{x}, @var{y} at level @var{z}=@var{Min}.z. The length and color of arrows are proportional to @math{\sqrt@{ax^2+ay^2@}}. The number of arrows depend on @ref{meshnum}. The apperance of the hachures (arrows) can be changed by symbols:
+@itemize @bullet
+@item
+@samp{f} for drawing arrows with fixed lengths,
+@item
+@samp{>}, @samp{<} for drawing arrows to or from the cell point (default is centering),
+@item
+@samp{.} for drawing hachures with dots instead of arrows,
+@item
+@samp{=} for enabling color gradient along arrows.
+@end itemize
+See also @ref{flow}, @ref{dew}. @sref{Vect sample}
@end deftypefn
@deftypefn {MGL command} {} vect udat vdat wdat ['sch'='']
@deftypefnx {C function} @code{void} mgl_flow_2d (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_flow_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws flow threads for the plane vector field @{@var{ax}, @var{ay}@} parametrically depending on coordinates @var{x}, @var{y} at level @var{z} = @var{Min}.z. Number of threads is proportional to @var{value} option (default is 5). If @samp{#} symbol is specified then threads start only from edges of axis range. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). If string @var{sch} contain symbol @samp{v} then arrows are drawn on flow threads. See also @ref{pipe}, @ref{vect}. @sref{Flow sample}
+The function draws flow threads for the plane vector field @{@var{ax}, @var{ay}@} parametrically depending on coordinates @var{x}, @var{y} at level @var{z} = @var{Min}.z. Number of threads is proportional to @var{value} option (default is 5). String @var{sch} may contain:
+@itemize @bullet
+@item
+color scheme -- up-half (warm) corresponds to normal flow (like attractor), bottom-half (cold) corresponds to inverse flow (like source);
+@item
+@samp{#} for starting threads from edges only;
+@item
+@samp{v} for drawing arrows on the threads;
+@item
+@samp{x}, @samp{z} for drawing tapes of normals in x-y and y-z planes correspondingly.
+@end itemize
+See also @ref{pipe}, @ref{vect}, @ref{tape}, @ref{barwidth}. @sref{Flow sample}
@end deftypefn
@deftypefn {MGL command} {} flow udat vdat wdat ['sch'='']
@deftypefnx {MGL command} {} grad xdat ydat pdat ['sch'='']
@deftypefnx {MGL command} {} grad xdat ydat zdat pdat ['sch'='']
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Grad (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
-@deftypefnx {Method on @code{mglGraph}} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Grad (@code{const mglData &}phi, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}phi, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
@deftypefnx {Method on @code{mglGraph}} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}phi, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
-@deftypefnx {C function} @code{void} mgl_grad (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
-@deftypefnx {C function} @code{void} mgl_grad_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
-@deftypefnx {C function} @code{void} mgl_grad_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_grad (@code{HMGL} gr, @code{HCDT} phi, @code{const char *}sch, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_grad_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} phi, @code{const char *}sch, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_grad_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} phi, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws gradient lines for scalar field @var{phi}[i,j,k] specified parametrically @{@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]@}. Number of lines is proportional to @var{value} option (default is 5). If @var{value}<0 then lines start only from edges of axis range. Warm color corresponds to normal flow (like minimum). Cold one corresponds to inverse flow (like maximum). If string @var{sch} contain symbol @samp{v} then arrows are drawn on flow threads. See also @ref{dens3}, @ref{cont3}, @ref{flow}.
+The function draws gradient lines for scalar field @var{phi}[i,j,k] specified parametrically @{@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]@}. Number of lines is proportional to @var{value} option (default is 5). If @var{value}<0 then lines start only from edges of axis range. Warm color corresponds to normal flow (like minimum). Cold one corresponds to inverse flow (like maximum). If string @var{sch} contain symbol @samp{v} then arrows are drawn on flow threads. See also @ref{dens}, @ref{cont}, @ref{flow}.
@end deftypefn
@anchor{pipe}
@cindex QuadPlot
@cindex Plots by formula
-These functions perform miscellaneous plotting. There is unstructured data points plots (Dots), surface reconstruction (Crust), surfaces on the triangular mesh (TriPlot), 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}.
+These functions perform miscellaneous plotting. There is unstructured data points plots (Dots), surface reconstruction (Crust), surfaces on the triangular or quadrangular mesh (TriPlot, TriCont, QuadPlot), textual formula plotting (Plots by formula), data plots at edges (Dens[XYZ], Cont[XYZ], ContF[XYZ]). 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}.
@anchor{densz} @anchor{densy} @anchor{densx} @anchor{DensXYZ}
@deftypefn {MGL command} {} densx dat ['sch'='' @code{sval=nan}]
@deftypefnx {C function} @code{void} mgl_triplot_xyz (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_triplot_xyzc (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws the surface of triangles. Triangle vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. First dimensions of @var{id} must be 3 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of triangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{dots}, @ref{crust}, @ref{quadplot}. @sref{TriPlot and QuadPlot}
+The function draws the surface of triangles. Triangle vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. If string contain @samp{#} then wire plot is produced. First dimensions of @var{id} must be 3 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of triangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{dots}, @ref{crust}, @ref{quadplot}. @sref{TriPlot and QuadPlot}
@end deftypefn
@anchor{tricont}
@deftypefnx {C function} @code{void} mgl_tricont_xyzcv (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_tricont_xyzv (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws contour lines for surface of triangles at @var{z}=@var{v}[k] (or at @var{z} = @var{Min}.z if @var{sch} contain symbol @samp{_}). Triangle vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v}. String @var{sch} sets the color scheme. Previous color scheme is used by default. Array @var{c} (if specified) is used for contour coloring. First dimensions of @var{id} must be 3 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of triangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{triplot}, @ref{cont}.
+The function draws contour lines for surface of triangles at @var{z}=@var{v}[k] (or at @var{z} = @var{Min}.z if @var{sch} contain symbol @samp{_}). Triangle vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v}. String @var{sch} sets the color scheme. Array @var{c} (if specified) is used for contour coloring. First dimensions of @var{id} must be 3 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of triangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{triplot}, @ref{cont}.
@end deftypefn
@anchor{quadplot}
@deftypefnx {C function} @code{void} mgl_quadplot_xyz (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_quadplot_xyzc (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws the surface of quadrangles. Quadrangles vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. First dimensions of @var{id} must be 4 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of quadrangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{triplot}. @sref{TriPlot and QuadPlot}
+The function draws the surface of quadrangles. Quadrangles vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. If string contain @samp{#} then wire plot is produced. First dimensions of @var{id} must be 4 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of quadrangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{triplot}. @sref{TriPlot and QuadPlot}
@end deftypefn
@anchor{dots}
@deftypefnx {C function} @code{void} mgl_dots (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_dots_a (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws the arbitrary placed points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If array @var{a} is specified then it define the transparency of dots. Arrays @var{x}, @var{y}, @var{z}, @var{a} must have equal sizes. See also @ref{crust}, @ref{mark}, @ref{plot}. @sref{Dots sample}
+The function draws the arbitrary placed points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. If array @var{a} is specified then it define the transparency of dots. Arrays @var{x}, @var{y}, @var{z}, @var{a} must have equal sizes. See also @ref{crust}, @ref{mark}, @ref{plot}. @sref{Dots sample}
@end deftypefn
@anchor{crust}
@deftypefnx {Method on @code{mglGraph}} @code{void} Crust (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
@deftypefnx {C function} @code{void} mgl_crust (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function reconstruct and draws the surface for arbitrary placed points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. See also @ref{dots}, @ref{triplot}. @sref{Crust sample}
+The function reconstruct and draws the surface for arbitrary placed points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. If string contain @samp{#} then wire plot is produced. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. See also @ref{dots}, @ref{triplot}. @c @sref{Crust sample}
@end deftypefn
@c ##################################################################
These functions 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 function @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. Parameter @var{print}=@code{true} switch on printing the found coefficients to @var{Message} (see @ref{Error handling}).
-Functions Fit() and FitS() do not draw the obtained data themselves. They fill the data @var{fit} by formula @samp{f} with found coefficients and return it. At this, the @samp{x,y,z} coordinates are equidistantly distributed in the axis range. Number of points in @var{fit} is selected as maximal value of @var{fit} size and the value of @var{mglFitPnts}. Note, that this functions use GSL library and do something only if MathGL was compiled with GSL support. @sref{Fitting sample}
+Functions Fit() and FitS() do not draw the obtained data themselves. They fill the data @var{fit} by formula @samp{f} with found coefficients and return it. At this, the @samp{x,y,z} coordinates are equidistantly distributed in the axis range. Number of points in @var{fit} is selected as maximal value of @var{fit} size and the value of @var{mglFitPnts}. Note, that this functions use GSL library and do something only if MathGL was compiled with GSL support. @sref{Nonlinear fitting sample}
@anchor{fits}
@deftypefn {MGL command} {} fits res adat sdat 'func' 'var' [ini=0]
@deftypefnx {Method on @code{mglGraph}} @code{mglData} PDE (@code{const char *}ham, @code{const mglData &}ini_re, @code{const mglData &}ini_im, @code{float} dz=@code{0.1}, @code{float} k0=@code{100}, @code{const char *}opt=@code{""})
@deftypefnx {C function} @code{HMDT} mgl_pde_solve (@code{HMGL} gr, @code{const char *}ham, @code{HCDT} ini_re, @code{HCDT} ini_im, @code{float} dz, @code{float} k0, @code{const char *}opt)
@end ifclear
-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. Parameters @var{Min}, @var{Max} set the bounding box for the solution. 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 nonlinear 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} @sref{PDE sample}
+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. Parameters @var{Min}, @var{Max} set the bounding box for the solution. 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 nonlinear 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 solving hints}
@end deftypefn
@c ##################################################################
@node IDTF functions, , Data manipulation, MathGL core
@section IDTF functions
-@cindex NewFrame
-@cindex EndFrame
-@cindex GetNumFrame
These functions provide IDTF specific features. In all other cases they do nothing.
@c ------------------------------------------------------------------
@chapter Data processing
+@ifset UDAV
+This chapter describe commands for allocation, resizing, loading and saving, modifying of data arrays. Also it can numerically differentiate and integrate data, interpolate, fill data by formula and so on. Class supports data with dimensions up to 3 (like function of 3 variables -- x,y,z). The internal representation of numbers is float. Float type was chosen because it has smaller size in memory and usually it has enough precision in plotting purposes. Data arrays are denoted by Small Caps (like @sc{dat}) if it can be (re-)created by MGL commands.
+@end ifset
+
+@ifclear UDAV
Class for working with data array. This class is defined in @code{#include <mgl/data.h>}. The class has functions for easy and safe allocation, resizing, loading and saving, modifying of data arrays. Also it can numerically differentiate and integrate data, interpolate, fill data by formula and so on. Class supports data with dimensions up to 3 (like function of 3 variables -- x,y,z). The internal representation of numbers is float. Float type was chosen because it has smaller size in memory and usually it has enough precision in plotting purposes. You can change it by selecting option @code{--enable-double} at the library configuring (see @ref{Installation}). Data arrays are denoted by Small Caps (like @sc{dat}) if it can be (re-)created by MGL commands.
+@end ifclear
+
+
@menu
* Public variables::
* Data information::
* Operators::
* Global functions::
+* Evaluate expression::
@end menu
@c ------------------------------------------------------------------
@end ifclear
@c ------------------------------------------------------------------
-@node Global functions, , Operators, Data processing
+@node Global functions, Evaluate expression, Operators, Data processing
@section Global functions
These functions are not methods of @code{mglData} class. However it provide additional functionality to handle data. So I put it in this chapter.
@deftypefnx {Global function} @code{mglData} mglPDE (@code{HMGL} gr, @code{const char *}ham, @code{const mglData &}ini_re, @code{const mglData &}ini_im, @code{float} dz=@code{0.1}, @code{float} k0=@code{100}, @code{const char *}opt=@code{""})
@deftypefnx {C function} @code{HMDT} mgl_pde_solve (@code{HMGL} gr, @code{const char *}ham, @code{HCDT} ini_re, @code{HCDT} ini_im, @code{float} dz, @code{float} k0, @code{const char *}opt)
@end ifclear
-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. Parameters @var{Min}, @var{Max} set the bounding box for the solution. 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 nonlinear 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} @sref{PDE sample}
+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. Parameters @var{Min}, @var{Max} set the bounding box for the solution. 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 nonlinear 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 solving hints}
@end deftypefn
@anchor{ray}
@deftypefnx {Global function} @code{mglData} mglRay (@code{const char *}ham, @code{mglPoint} r0, @code{mglPoint} p0, @code{float} dt=@code{0.1}, @code{float} tmax=@code{10})
@deftypefnx {C function} @code{HMDT} mgl_ray_trace (@code{const char *}ham, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} px, @code{float} py, @code{float} pz, @code{float} dt, @code{float} tmax)
@end ifclear
-Solves GO ray equation like dr/dt = d @var{ham}/dp, dp/dt = -d @var{ham}/dr. This is Hamiltonian equations for particle trajectory in 3D case. Here @var{ham} is Hamiltonian which may depend on coordinates @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{r0}, @var{p0}. 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) @}. @sref{Beam tracing sample}
+Solves GO ray equation like dr/dt = d @var{ham}/dp, dp/dt = -d @var{ham}/dr. This is Hamiltonian equations for particle trajectory in 3D case. Here @var{ham} is Hamiltonian which may depend on coordinates @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{r0}, @var{p0}. 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) @}.
@end deftypefn
@anchor{qo2d}
@deftypefnx {Global function} @code{mglData} mglQO2d (@code{const char *}ham, @code{const mglData &}ini_re, @code{const mglData &}ini_im, @code{const mglData &}ray, @code{mglData &}xx, @code{mglData &}yy, @code{float} r=@code{1}, @code{float} k0=@code{100})
@deftypefnx {C function} @code{HMDT} mgl_qo2d_solve (@code{const char *}ham, @code{HCDT} ini_re, @code{HCDT} ini_im, @code{HCDT} ray, @code{float} r, @code{float} k0, @code{HMDT} xx, @code{HMDT} yy)
@end ifclear
-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 (see @code{mglPDE()} for details). 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 @code{mglRay()} 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. See also @code{mglPDE()}. @sref{Beam tracing sample}
+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 (see @code{mglPDE()} for details). 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 @code{mglRay()} 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. See also @code{mglPDE()}. @sref{PDE solving hints}
@end deftypefn
@anchor{jacobian}
@end ifclear
Computes triangulation for arbitrary placed points with coordinates @{@var{x},@var{y},@var{z}@} (i.e. finds triangles which connect points). The sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=y.nx=z.nx}. Resulting array can be used in @ref{triplot} or @ref{tricont} functions for visualization of reconstructed surface.
@end deftypefn
+
+
+@c ------------------------------------------------------------------
+@node Evaluate expression, , Global functions, Data processing
+@section Evaluate expression
+
+@ifset UDAV
+You can use arbitrary formulas of existed data arrays or constants as any argument of data processing or data plotting commands. There are only 2 limitations: formula shouldn't contain spaces, and formula cannot be used as argument which will be (re)created by MGL command.
+@end ifset
+
+@ifclear UDAV
+MathGL have a special class @code{mglExpr} for evaluating of formula specified by the string. This class is defined in @code{#include <mgl/mgl.h>}. It is the fast variant of formula evaluation. At creation it will be recognized and compiled to tree-like internal code. At evaluation stage only fast calculations are performed. There is no difference between lower or upper case in formulas. If argument value lie outside the range of function definition then function returns NaN. @xref{Textual formulas}.
+
+@deftypefn {Constructor on @code{mglExpr}} @code{} mglExpr (@code{const char *}expr)
+@deftypefnx {C function} @code{HMEX} mgl_create_expr (@code{const char *}expr)
+Parses the formula @var{expr} and creates formula-tree. Constructor recursively parses the formula and creates a tree-like structure containing functions and operators for fast further evaluating by @code{Calc()} or @code{CalcD()} functions.
+@end deftypefn
+
+@deftypefn {Destructor on @code{mglExpr}} @code{} ~mglExpr ()
+@deftypefnx {C function} @code{HMEX} mgl_delete_expr (@code{HMEX} ex)
+Deletes the instance of class mglExpr.
+@end deftypefn
+
+@deftypefn {Method on @code{mglExpr}} @code{float} Eval (@code{float} x, @code{float} y, @code{float} z)
+@deftypefnx {C function} @code{float} mgl_expr_eval (@code{HMEX} ex, @code{float} x, @code{float} y, @code{float} z)
+Evaluates the formula for @code{'x','r'}=@var{x}, @code{'y','n'}=@var{y}, @code{'z','t'}=@var{z}, @code{'a','u'}=@var{u}.
+@end deftypefn
+
+@deftypefn {Method on @code{mglExpr}} @code{float} Eval (@code{float} var[26])
+@deftypefnx {C function} @code{float} mgl_expr_eval_v (@code{HMEX} ex, @code{float *}var)
+Evaluates the formula for variables in array @var{var}[0,...,'z'-'a'].
+@end deftypefn
+
+
+@deftypefn {Method on @code{mglExpr}} @code{float} Diff (@code{char} dir, @code{float} x, @code{float} y, @code{float} z)
+@deftypefnx {C function} @code{float} mgl_expr_diff (@code{HMEX} ex, @code{char} dir, @code{float} x, @code{float} y, @code{float} z)
+Evaluates the formula derivation respect to @var{dir} for @code{'x','r'}=@var{x}, @code{'y','n'}=@var{y}, @code{'z','t'}=@var{z}, @code{'a','u'}=@var{u}.
+@end deftypefn
+
+@deftypefn {Method on @code{mglExpr}} @code{float} Diff (@code{char} dir, @code{float} var[26])
+@deftypefnx {C function} @code{float} mgl_expr_diff_v (@code{HMEX} ex, @code{char} dir, @code{float *}var)
+Evaluates the formula derivation respect to @var{dir} for variables in array @var{var}[0,...,'z'-'a'].
+@end deftypefn
+
+@end ifclear
@node Subplots, Axis and grids, , Advanced usage
@subsection Subplots
-Let me demonstrate possibilities of axes transformation. MathGL has the following functions: @code{SubPlot}, @code{InPlot}, @code{Aspect} and @code{Rotate}, @pxref{Transformation matrix}). The order of their calling is strictly determined. First, one changes the position of axes in image area, functions @code{SubPlot} and @code{InPlot}). After that one may rotate the plot, function @code{Rotate}). Finally, one may change aspects of axes, function @code{Aspect}). The following code illustrates the aforesaid it:
+Let me demonstrate possibilities of axes transformation. MathGL has the following functions: @code{SubPlot}, @code{InPlot}, @code{Aspect} and @code{Rotate}, @pxref{Subplots and rotation}). The order of their calling is strictly determined. First, one changes the position of axes in image area, functions @code{SubPlot} and @code{InPlot}). After that one may rotate the plot, function @code{Rotate}). Finally, one may change aspects of axes, function @code{Aspect}). The following code illustrates the aforesaid it:
@verbatim
subplot 2 2 0:box
text -1 1.1 'Just box' 'L'
The rotation, shift, zooming, switching on/off transparency and lighting can be done with help of tool-buttons (for @code{mglWindow}) or by hot-keys: @samp{a}, @samp{d}, @samp{w}, @samp{s} for plot rotation, @samp{r} and @samp{f} switching on/off transparency and lighting. Press @samp{x} for exit (or closing the window).
-In this example function @code{sample} rotates axes (@code{Rotate()}, @pxref{Transformation matrix}) and draws the bounding box (@code{Box()}). Drawing is placed in separate function since it will be used on demand when window canvas needs to be redrawn.
+In this example function @code{sample} rotates axes (@code{Rotate()}, @pxref{Subplots and rotation}) and draws the bounding box (@code{Box()}). Drawing is placed in separate function since it will be used on demand when window canvas needs to be redrawn.
@c ------------------------------------------------------------------
@node Drawing to file, Animation, Using MathGL window, Basic usage
* Axis and ticks::
* Curvilinear coordinates::
* Colorbars::
+* Bounding box::
* Ternary axis::
* Text features::
* Legend sample::
@node Subplots, Axis and ticks, , Advanced usage
@subsection Subplots
-Let me demonstrate possibilities of plot positioning and rotation. MathGL has a set of functions: @code{SubPlot}, @code{InPlot}, @code{Title}, @code{Aspect} and @code{Rotate} and so on (see @ref{Transformation matrix}). The order of their calling is strictly determined. First, one changes the position of plot in image area (functions @code{SubPlot}, @code{InPlot} and @code{MultiPlot}). Secondly, you can add the title of plot by @code{Title} function. After that one may rotate the plot (function @code{Rotate}). Finally, one may change aspects of axes (function @code{Aspect}). The following code illustrates the aforesaid it:
+Let me demonstrate possibilities of plot positioning and rotation. MathGL has a set of functions: @code{SubPlot}, @code{InPlot}, @code{Title}, @code{Aspect} and @code{Rotate} and so on (see @ref{Subplots and rotation}). The order of their calling is strictly determined. First, one changes the position of plot in image area (functions @code{SubPlot}, @code{InPlot} and @code{MultiPlot}). Secondly, you can add the title of plot by @code{Title} function. After that one may rotate the plot (function @code{Rotate}). Finally, one may change aspects of axes (function @code{Aspect}). The following code illustrates the aforesaid it:
@verbatim
int sample(mglGraph *gr)
{
@end verbatim
Here I used function @code{Puts} for printing the text in arbitrary position of picture (see @ref{Text printing}). Text coordinates and size are connected with axes. However, text coordinates may be everywhere, including the outside the bounding box. I'll show its features later in @ref{Text features}.
-@float
-@image{../png/aspect, 11cm}
-@caption{Example of several subplots on the single picture.}
-@end float
+@fig{png/aspect, Example of several subplots on the single picture.}
More complicated sample show how to use most of positioning functions:
@verbatim
}
@end verbatim
-@float
-@image{../png/inplot, 11cm}
-@caption{Example for most of positioning functions.}
-@end float
+@fig{png/inplot, Example for most of positioning functions.}
@c ------------------------------------------------------------------
gr->SubPlot(2,2,3); gr->Title("More axis");
gr->SetOrigin(NAN,NAN); gr->SetRange('x',-1,1);
- gr->Axis(); gr->Label('x',"x",0); gr->Label('y',"y_1",0); gr->FPlot("x^2","k");
+ gr->Axis(); gr->Label('x',"x",0); gr->Label('y',"y_1",0);
+ gr->FPlot("x^2","k");
gr->SetRanges(-1,1,-1,1); gr->SetOrigin(-1.3,-1); // second axis
- gr->Axis("y","r"); gr->Label('y',"#r{y_2}",0.2); gr->FPlot("x^3","r");
+ gr->Axis("y","r"); gr->Label('y',"#r{y_2}",0.2);
+ gr->FPlot("x^3","r");
- gr->SubPlot(2,2,2); gr->Title("4 segments, inverted axis"); gr->SetOrigin(0,0);
+ gr->SubPlot(2,2,2); gr->Title("4 segments, inverted axis");
+ gr->SetOrigin(0,0);
gr->InPlot(0.5,1,0.5,1); gr->SetRanges(0,10,0,2); gr->Axis();
gr->FPlot("sqrt(x/2)"); gr->Label('x',"W",1); gr->Label('y',"U",1);
gr->InPlot(0,0.5,0.5,1); gr->SetRanges(1,0,0,2); gr->Axis("x");
Note, that MathGL can draw not only single axis (which is default). But also several axis on the plot (see right plots). The idea is that the change of settings does not influence on the already drawn graphics. So, for 2-axes I setup the first axis and draw everything concerning it. Then I setup the second axis and draw things for the second axis. Generally, the similar idea allows one to draw rather complicated plot of 4 axis with different ranges (see bottom left plot).
-@float
-@image{../png/axis, 11cm}
-@caption{Example of axis.}
-@end float
+@fig{png/axis, Example of axis.}
Another MathGL feature is fine ticks tunning. By default (if it is not changed by @code{SetTicks} function), MathGL try to adjust ticks positioning, so that they looks most human readable. At this, MathGL try to extract common factor for too large or too small axis ranges, as well as for too narrow ranges. Last one is non-common notation and can be disabled by @code{SetTuneTicks} function.
}
@end verbatim
-@float
-@image{../png/ticks, 11cm}
-@caption{Features of axis ticks.}
-@end float
+@fig{png/ticks, Features of axis ticks.}
The last sample I want to show in this subsection is Log-axis. From MathGL's point of vew, the log-axis is particular case of general curvilinear coordinates. So, we need first define new coordinates (see also @ref{Curvilinear coordinates}) by help of @code{SetFunc} or @code{SetCoor} functions. At this one should wary about proper axis range. So the code looks as following:
@verbatim
}
@end verbatim
-@float
-@image{../png/loglog, 11cm}
-@caption{Features of axis ticks.}
-@end float
+@fig{png/loglog, Features of axis ticks.}
You can see that MathGL automatically switch to log-ticks as we define log-axis formula (in difference from v.1.*). Moreover, it switch to log-ticks for any formula if axis range will be large enough (see right bottom plot). Another interesting feature is that you not necessary define usual log-axis (i.e. when coordinates are positive), but you can define ``minus-log'' axis when coordinate is negative (see left bottom plot).
}
@end verbatim
-@float
-@image{../png/curvcoor, 11cm}
-@caption{Example of curvilinear coordinates}
-@end float
+@fig{png/curvcoor, Example of curvilinear coordinates}
@c ------------------------------------------------------------------
-@node Colorbars, Ternary axis, Curvilinear coordinates, Advanced usage
+@node Colorbars, Bounding box, Curvilinear coordinates, Advanced usage
@subsection Colorbars
MathGL handle colorbar as special kind of axis. So, most of functions for axis and ticks setup will work for colorbar too. Colorbars can be in log-scale, and generally as arbitrary function scale; common factor of colorbar labels can be separated; and so on.
}
@end verbatim
-@float
-@image{../png/colorbar, 11cm}
-@caption{Example of colorbars}
-@end float
+@fig{png/colorbar, Example of colorbars}
@c ------------------------------------------------------------------
-@node Ternary axis, Text features, Colorbars, Advanced usage
+@node Bounding box, Ternary axis, Colorbars, Advanced usage
+@subsection Bounding box
+
+Box around the plot is rather useful thing because it allows one to: see the plot boundaries, and better estimate points position since box contain another set of ticks. MathGL provide special function for drawing such box -- @code{Box()} function. By default, it draw black or white box with ticks (color depend on transparency type, see @ref{Types of transparency}). However, you can change the color of box, or add drawing of rectangles at rear faces of box. Also you can disable ticks drawing, but I don't know why anybody will want it. The sample code, which demonstrate @code{Box()} features is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ gr->SubPlot(2,2,0); gr->Title("Box (default)"); gr->Rotate(50,60);
+ gr->Box();
+ gr->SubPlot(2,2,1); gr->Title("colored"); gr->Rotate(50,60);
+ gr->Box("r");
+ gr->SubPlot(2,2,2); gr->Title("with faces"); gr->Rotate(50,60);
+ gr->Box("@");
+ gr->SubPlot(2,2,3); gr->Title("both"); gr->Rotate(50,60);
+ gr->Box("@cm");
+ return 0;
+}
+@end verbatim
+
+@fig{png/box, Example of Box()}
+
+
+@c ------------------------------------------------------------------
+@node Ternary axis, Text features, Bounding box, Advanced usage
@subsection Ternary axis
There are another unusual axis types which are supported by MathGL. These are ternary and quaternary axis. Ternary axis is special axis of 3 coordinates @var{a}, @var{b}, @var{c} which satisfy relation @var{a}+@var{b}+@var{c}=1. Correspondingly, quaternary axis is special axis of 4 coordinates @var{a}, @var{b}, @var{c}, @var{d} which satisfy relation @var{a}+@var{b}+@var{c}+@var{d}=1.
}
@end verbatim
-@float
-@image{../png/ternary, 11cm}
-@caption{Example of colorbars}
-@end float
+@fig{png/ternary, Example of colorbars}
@c ------------------------------------------------------------------
@node Text features, Legend sample, Ternary axis, Advanced usage
}
@end verbatim
-@float
-@image{../png/text, 11cm}
-@caption{Example of text printing}
-@end float
+@fig{png/text, Example of text printing}
@c ------------------------------------------------------------------
@node Legend sample, Cutting sample, Text features, Advanced usage
}
@end verbatim
-@float
-@image{../png/legend, 11cm}
-@caption{Example of legend}
-@end float
+@fig{png/legend, Example of legend}
@c ------------------------------------------------------------------
@node Cutting sample, , Legend sample, Advanced usage
}
@end verbatim
-@float
-@image{../png/cut, 11cm}
-@caption{Example of point cutting}
-@end float
+@fig{png/cut, Example of point cutting}
* Array creation::
* Linking array::
* Change data::
-* User defined types::
@end menu
@c ------------------------------------------------------------------
@node Linking array, Change data, Array creation, Data handling
@subsection Linking array
-Sometimes the data arrays are so large, that one couldn't' copy its values to another array (i.e. into mglData). In this case, he can define its own class derived from @code{mglDataA} (see @ref{User defined types}) or can use @code{Link} function.
+Sometimes the data arrays are so large, that one couldn't' copy its values to another array (i.e. into mglData). In this case, he can define its own class derived from @code{mglDataA} (see @ref{mglDataA class}) or can use @code{Link} function.
In last case, MathGL just save the link to an external data array, but not copy it. You should provide the existence of this data array for whole time during which MathGL can use it. Another point is that MathGL will automatically create new array if you'll try to modify data values by any of @code{mglData} functions. So, you should use only function with @code{const} modifier if you want still using link to the original data array.
@end verbatim
@c ------------------------------------------------------------------
-@node Change data, User defined types, Linking array, Data handling
+@node Change data, , Linking array, Data handling
@subsection Change data
MathGL has functions for data processing: differentiating, integrating, smoothing and so on (for more detail, see @ref{Data processing}). Let us consider some examples. The simplest ones are integration and differentiation. The direction in which operation will be performed is specified by textual string, which may contain symbols @samp{x}, @samp{y} or @samp{z}. For example, the call of @code{Diff("x")} will differentiate data along @samp{x} direction; the call of @code{Integral("xy")} perform the double integration of data along @samp{x} and @samp{y} directions; the call of @code{Diff2("xyz")} will apply 3d Laplace operator to data and so on. Example of this operations on 2d array a=x*y is presented in code:
}
@end verbatim
-@float
-@image{../png/dat_diff, 11cm}
-@caption{Example of data differentiation and integration}
-@end float
+@fig{png/dat_diff, Example of data differentiation and integration}
Data smoothing (function @code{Smooth()}) is more interesting and important. This function has single argument which define type of smoothing and its direction. Now 3 methods are supported: @samp{3} -- linear averaging by 3 points, @samp{5} -- linear averaging by 5 points, and default one -- quadratic averaging by 5 points.
}
@end verbatim
-@float
-@image{../png/dat_extra, 11cm}
-@caption{Example of data smoothing}
-@end float
+@fig{png/dat_extra, Example of data smoothing}
Finally one can create new data arrays on base of the existing one: extract slice, row or column of data (@code{SubData()}), summarize along a direction(s) (@code{Sum()}), find distribution of data elements (@code{Hist()}) and so on.
-@c ------------------------------------------------------------------
-@node User defined types, , Change data, Data handling
-@subsection User defined types
-
-@code{mglData} class have abstract predecessor class @code{mglDataA}. Exactly the pointers to @code{mglDataA} instances are used in all plotting functions and some of data processing functions. This was done for taking possibility to define yours own class, which will handle yours own data (for example, complex numbers, or differently organized data). And this new class will be almost the same as @code{mglData} for plotting purposes.
-
-However, the most of data processing functions will be slower as if you used @code{mglData} instance. This is more or less understandable -- I don't know how data in yours particular class will be organized, and couldn't optimize the these functions generally.
-
-There are few virtual functions which must be provided in derived classes. This functions give:
-@itemize @bullet
-@item
-the sizes of the data (@code{GetNx}, @code{GetNy}, @code{GetNz}),
-@item
-give data value and numerical derivatives for selected cell (@code{v}, @code{dvx}, @code{dvy}, @code{dvz}),
-@item
-give maximal and minimal values (@code{Maximal}, @code{Minimal}) -- you can use provided functions (like @code{mgl_data_max} and @code{mgl_data_min}), but yours own realization can be more efficient,
-@item
-give access to all element as in single array (@code{vthr}) -- you need this only if you want using MathGL's data processing functions.
-@end itemize
-
-Let me, for example define class @code{mglComplex} which will handle complex number and draw its amplitude or phase, depending on flag @var{use_abs}:
-@verbatim
-#include <complex>
-#include <mgl/mgl.h>
-#define dual std::complex<double>
-class mglComplex : public mglDataA
-{
-public:
- long nx; ///< number of points in 1st dimensions ('x' dimension)
- long ny; ///< number of points in 2nd dimensions ('y' dimension)
- long nz; ///< number of points in 3d dimensions ('z' dimension)
- dual *a; ///< data array
- bool use_abs; ///< flag to use abs() or arg()
-
- inline mglComplex(long xx=1,long yy=1,long zz=1)
- { a=0; use_abs=true; Create(xx,yy,zz); }
- virtual ~mglComplex() { if(a) delete []a; }
-
- /// Get sizes
- inline long GetNx() const { return nx; }
- inline long GetNy() const { return ny; }
- inline long GetNz() const { return nz; }
- /// Create or recreate the array with specified size and fill it by zero
- inline void Create(long mx,long my=1,long mz=1)
- { nx=mx; ny=my; nz=mz; if(a) delete []a;
- a = new dual[nx*ny*nz]; }
- /// Get maximal value of the data
- inline float Maximal() const { return mgl_data_max(this); }
- /// Get minimal value of the data
- inline float Minimal() const { return mgl_data_min(this); }
-
-protected:
- inline mreal v(long i,long j=0,long k=0) const
- { return use_abs ? abs(a[i+nx*(j+ny*k)]) : arg(a[i+nx*(j+ny*k)]); }
- inline mreal vthr(long i) const
- { return use_abs ? abs(a[i]) : arg(a[i]); }
- inline mreal dvx(long i,long j=0,long k=0) const
- { register long i0=i+nx*(j+ny*k);
- std::complex<double> res=i>0? (i<nx-1? (a[i0+1]-a[i0-1])/2.:a[i0]-a[i0-1]) : a[i0+1]-a[i0];
- return use_abs? abs(res) : arg(res); }
- inline mreal dvy(long i,long j=0,long k=0) const
- { register long i0=i+nx*(j+ny*k);
- std::complex<double> res=j>0? (j<ny-1? (a[i0+nx]-a[i0-nx])/2.:a[i0]-a[i0-nx]) : a[i0+nx]-a[i0];
- return use_abs? abs(res) : arg(res); }
- inline mreal dvz(long i,long j=0,long k=0) const
- { register long i0=i+nx*(j+ny*k), n=nx*ny;
- std::complex<double> res=k>0? (k<nz-1? (a[i0+n]-a[i0-n])/2.:a[i0]-a[i0-n]) : a[i0+n]-a[i0];
- return use_abs? abs(res) : arg(res); }
-};
-int main()
-{
- mglComplex dat(20);
- for(long i=0;i<20;i++)
- dat.a[i] = 3*exp(-0.05*(i-10)*(i-10))*dual(cos(M_PI*i*0.3), sin(M_PI*i*0.3));
- mglGraph gr;
- gr.SetRange('y', -M_PI, M_PI); gr.Box();
-
- gr.Plot(dat,"r","legend 'abs'");
- dat.use_abs=false;
- gr.Plot(dat,"b","legend 'arg'");
- gr.Legend();
- gr.WritePNG("complex.png");
- return 0;
-}
-@end verbatim
-
@c ------------------------------------------------------------------
@node Data plotting, 1D samples, Data handling, Examples
* Stem sample::
* Bars sample::
* Barh sample::
+* Cones sample::
* Chart sample::
* BoxPlot sample::
* Candle sample::
}
@end verbatim
-@float
-@image{../png/plot, 11cm}
-@caption{Example of Plot()}
-@end float
+@fig{png/plot, Example of Plot()}
@c ------------------------------------------------------------------
}
@end verbatim
-@float
-@image{../png/radar, 11cm}
-@caption{Example of Radar()}
-@end float
+@fig{png/radar, Example of Radar()}
@c ------------------------------------------------------------------
@node Step sample, Tens sample, Radar sample, 1D samples
}
@end verbatim
-@float
-@image{../png/step, 11cm}
-@caption{Example of Step()}
-@end float
+@fig{png/step, Example of Step()}
@c ------------------------------------------------------------------
@node Tens sample, Area sample, Step sample, 1D samples
}
@end verbatim
-@float
-@image{../png/tens, 11cm}
-@caption{Example of Tens()}
-@end float
+@fig{png/tens, Example of Tens()}
@c ------------------------------------------------------------------
@node Area sample, Region sample, Tens sample, 1D samples
}
@end verbatim
-@float
-@image{../png/area, 11cm}
-@caption{Example of Area()}
-@end float
+@fig{png/area, Example of Area()}
@c ------------------------------------------------------------------
@node Region sample, Stem sample, Area sample, 1D samples
}
@end verbatim
-@float
-@image{../png/region, 11cm}
-@caption{Example of Region()}
-@end float
+@fig{png/region, Example of Region()}
@c ------------------------------------------------------------------
@node Stem sample, Bars sample, Region sample, 1D samples
}
@end verbatim
-@float
-@image{../png/stem, 11cm}
-@caption{Example of Stem()}
-@end float
+@fig{png/stem, Example of Stem()}
@c ------------------------------------------------------------------
@node Bars sample, Barh sample, Stem sample, 1D samples
}
@end verbatim
-@float
-@image{../png/bars, 11cm}
-@caption{Example of Bars()}
-@end float
+@fig{png/bars, Example of Bars()}
@c ------------------------------------------------------------------
-@node Barh sample, Chart sample, Bars sample, 1D samples
+@node Barh sample, Cones sample, Bars sample, 1D samples
@subsection Barh sample
@code{Barh} is the similar to @code{Bars} but draw horizontal bars. The sample code is:
}
@end verbatim
-@float
-@image{../png/barh, 11cm}
-@caption{Example of Barh()}
-@end float
+@fig{png/barh, Example of Barh()}
@c ------------------------------------------------------------------
-@node Chart sample, BoxPlot sample, Barh sample, 1D samples
+@node Cones sample, Chart sample, Bars sample, 1D samples
+@subsection Cones sample
+
+@code{Cones} is similar to @code{Bars} but draw cones. The sample code is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
+ gr->Light(true); gr->SetOrigin(0,0,0);
+ gr->SubPlot(2,2,0); gr->Title("Cones plot");
+ gr->Rotate(50,60); gr->Box(); gr->Cones(ys);
+
+ gr->SubPlot(2,2,1); gr->Title("2 colors");
+ gr->Rotate(50,60); gr->Box(); gr->Cones(ys,"cbgGyr");
+
+ gr->SubPlot(2,2,2); gr->Title("'#' style");
+ gr->Rotate(50,60); gr->Box(); gr->Cones(ys,"#");
+
+ gr->SubPlot(2,2,3); gr->Title("'a' style");
+ gr->SetRange('z',-2,2); // increase range since summation can exceed [-1,1]
+ gr->Rotate(50,60); gr->Box(); gr->Cones(ys,"a");
+ return 0;
+}
+@end verbatim
+
+@fig{png/cones, Example of Cones()}
+
+@c ------------------------------------------------------------------
+@node Chart sample, BoxPlot sample, Cones sample, 1D samples
@subsection Chart sample
@code{Chart} draw colored boxes with width proportional to data values. Use @samp{ } for empty box. Plot looks most attractive in polar coordinates -- well known pie chart. The sample code is:
}
@end verbatim
-@float
-@image{../png/chart, 11cm}
-@caption{Example of Chart()}
-@end float
+@fig{png/chart, Example of Chart()}
@c ------------------------------------------------------------------
@node BoxPlot sample, Candle sample, Chart sample, 1D samples
}
@end verbatim
-@float
-@image{../png/boxplot, 11cm}
-@caption{Example of BoxPlot()}
-@end float
+@fig{png/boxplot, Example of BoxPlot()}
@c ------------------------------------------------------------------
@node Candle sample, Error sample, BoxPlot sample, 1D samples
@verbatim
int sample(mglGraph *gr)
{
- mglData y(30); gr->Fill(y,"sin(2*pi*x)^2");
+ mglData y(30); gr->Fill(y,"sin(pi*x/2)^2");
mglData y1(30); gr->Fill(y1,"v/2",y);
mglData y2(30); gr->Fill(y2,"(1+v)/2",y);
gr->SubPlot(1,1,0,""); gr->Title("Candle plot (default)");
}
@end verbatim
-@float
-@image{../png/candle, 11cm}
-@caption{Example of Candle()}
-@end float
+@fig{png/candle, Example of Candle()}
@c ------------------------------------------------------------------
@node Error sample, Mark sample, Candle sample, 1D samples
}
@end verbatim
-@float
-@image{../png/error, 11cm}
-@caption{Example of Error()}
-@end float
+@fig{png/error, Example of Error()}
@c ------------------------------------------------------------------
@node Mark sample, TextMark sample, Error sample, 1D samples
}
@end verbatim
-@float
-@image{../png/mark, 11cm}
-@caption{Example of Mark()}
-@end float
+@fig{png/mark, Example of Mark()}
@c ------------------------------------------------------------------
@node TextMark sample, Label sample, Mark sample, 1D samples
}
@end verbatim
-@float
-@image{../png/textmark, 11cm}
-@caption{Example of TextMark()}
-@end float
+@fig{png/textmark, Example of TextMark()}
@c ------------------------------------------------------------------
@node Label sample, Tube sample, TextMark sample, 1D samples
}
@end verbatim
-@float
-@image{../png/label, 11cm}
-@caption{Example of Label()}
-@end float
+@fig{png/label, Example of Label()}
@c ------------------------------------------------------------------
}
@end verbatim
-@float
-@image{../png/tube, 11cm}
-@caption{Example of Tube()}
-@end float
+@fig{png/tube, Example of Tube()}
@c ------------------------------------------------------------------
}
@end verbatim
-@float
-@image{../png/tape, 11cm}
-@caption{Example of Tape()}
-@end float
+@fig{png/tape, Example of Tape()}
@c ------------------------------------------------------------------
}
@end verbatim
-@float
-@image{../png/torus, 11cm}
-@caption{Example of Torus()}
-@end float
+@fig{png/torus, Example of Torus()}
@c ------------------------------------------------------------------
* ContD sample::
* ContV sample::
* Axial sample::
+* Grad sample::
@end menu
@c ------------------------------------------------------------------
}
@end verbatim
-@float
-@image{../png/surf, 11cm}
-@caption{Example of Surf()}
-@end float
+@fig{png/surf, Example of Surf()}
@c ------------------------------------------------------------------
@node SurfC sample, SurfA sample, Surf sample, 2D samples
}
@end verbatim
-@float
-@image{../png/surfc, 11cm}
-@caption{Example of SurfC()}
-@end float
+@fig{png/surfc, Example of SurfC()}
@c ------------------------------------------------------------------
@node SurfA sample, Mesh sample, SurfC sample, 2D samples
}
@end verbatim
-@float
-@image{../png/surfa, 11cm}
-@caption{Example of SurfA()}
-@end float
+@fig{png/surfa, Example of SurfA()}
@c ------------------------------------------------------------------
}
@end verbatim
-@float
-@image{../png/mesh, 11cm}
-@caption{Example of Mesh()}
-@end float
+@fig{png/mesh, Example of Mesh()}
@c ------------------------------------------------------------------
@node Fall sample, Belt sample, Mesh sample, 2D samples
}
@end verbatim
-@float
-@image{../png/fall, 11cm}
-@caption{Example of Fall()}
-@end float
+@fig{png/fall, Example of Fall()}
@c ------------------------------------------------------------------
@node Belt sample, Boxs sample, Fall sample, 2D samples
}
@end verbatim
-@float
-@image{../png/belt, 11cm}
-@caption{Example of Belt()}
-@end float
+@fig{png/belt, Example of Belt()}
@c ------------------------------------------------------------------
@node Boxs sample, Tile sample, Fall sample, 2D samples
}
@end verbatim
-@float
-@image{../png/boxs, 11cm}
-@caption{Example of Boxs()}
-@end float
+@fig{png/boxs, Example of Boxs()}
@c ------------------------------------------------------------------
@node Tile sample, TileS sample, Boxs sample, 2D samples
}
@end verbatim
-@float
-@image{../png/tile, 11cm}
-@caption{Example of Tile()}
-@end float
+@fig{png/tile, Example of Tile()}
@c ------------------------------------------------------------------
@node TileS sample, Dens sample, Tile sample, 2D samples
}
@end verbatim
-@float
-@image{../png/tiles, 11cm}
-@caption{Example of TileS()}
-@end float
+@fig{png/tiles, Example of TileS()}
@c ------------------------------------------------------------------
}
@end verbatim
-@float
-@image{../png/dens, 11cm}
-@caption{Example of Dens()}
-@end float
+@fig{png/dens, Example of Dens()}
@c ------------------------------------------------------------------
@node Cont sample, ContF sample, Dens sample, 2D samples
}
@end verbatim
-@float
-@image{../png/cont, 11cm}
-@caption{Example of Cont()}
-@end float
+@fig{png/cont, Example of Cont()}
@c ------------------------------------------------------------------
@node ContF sample, ContD sample, Cont sample, 2D samples
}
@end verbatim
-@float
-@image{../png/contf, 11cm}
-@caption{Example of ContF()}
-@end float
+@fig{png/contf, Example of ContF()}
@c ------------------------------------------------------------------
@node ContD sample, ContV sample, ContF sample, 2D samples
}
@end verbatim
-@float
-@image{../png/contd, 11cm}
-@caption{Example of ContD()}
-@end float
+@fig{png/contd, Example of ContD()}
@c ------------------------------------------------------------------
@node ContV sample, Axial sample, ContD sample, 2D samples
}
@end verbatim
-@float
-@image{../png/contv, 11cm}
-@caption{Example of ContV()}
-@end float
+@fig{png/contv, Example of ContV()}
@c ------------------------------------------------------------------
-@node Axial sample, , ContV sample, 2D samples
+@node Axial sample, Grad sample, ContV sample, 2D samples
@subsection Axial sample
@code{Axial} draw surfaces of rotation for contour lines. You can draw wire surfaces (@samp{#} style) or ones rotated in other directions (@samp{x}, @samp{z} styles). The sample code is:
}
@end verbatim
-@float
-@image{../png/axial, 11cm}
-@caption{Example of Axial()}
-@end float
+@fig{png/axial, Example of Axial()}
+
+@c ------------------------------------------------------------------
+@node Grad sample, , Axial sample, 2D samples
+@subsection Grad sample
+
+@code{Grad} draw gradient lines for matrix. The sample code is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData a; mgls_prepare2d(&a);
+ gr->SubPlot(1,1,0,""); gr->Title("Grad plot");
+ gr->Box(); gr->Grad(a); gr->Dens(a,"{u8}w{q8}");
+ return 0;
+}
+@end verbatim
+
+@fig{png/grad, Example of Grad()}
@c ------------------------------------------------------------------
}
@end verbatim
-@float
-@image{../png/surf3, 11cm}
-@caption{Example of Surf3()}
-@end float
+@fig{png/surf3, Example of Surf3()}
@c ------------------------------------------------------------------
@node Surf3C sample, Surf3A sample, Surf3 sample, 3D samples
}
@end verbatim
-@float
-@image{../png/surf3c, 11cm}
-@caption{Example of Surf3C()}
-@end float
+@fig{png/surf3c, Example of Surf3C()}
@c ------------------------------------------------------------------
@node Surf3A sample, Cloud sample, Surf3C sample, 3D samples
}
@end verbatim
-@float
-@image{../png/surf3a, 11cm}
-@caption{Example of Surf3A()}
-@end float
+@fig{png/surf3a, Example of Surf3A()}
@c ------------------------------------------------------------------
@node Cloud sample, Dens3 sample, Surf3A sample, 3D samples
}
@end verbatim
-@float
-@image{../png/cloud, 11cm}
-@caption{Example of Cloud()}
-@end float
+@fig{png/cloud, Example of Cloud()}
@c ------------------------------------------------------------------
@node Dens3 sample, Cont3 sample, Cloud sample, 3D samples
}
@end verbatim
-@float
-@image{../png/densa, 11cm}
-@caption{Example of Dens3()}
-@end float
+@fig{png/densa, Example of Dens3()}
@c ------------------------------------------------------------------
@node Cont3 sample, ContF3 sample, Dens3 sample, 3D samples
}
@end verbatim
-@float
-@image{../png/conta, 11cm}
-@caption{Example of Cont3()}
-@end float
+@fig{png/conta, Example of Cont3()}
@c ------------------------------------------------------------------
@node ContF3 sample, Dens projection sample, Cont3 sample, 3D samples
}
@end verbatim
-@float
-@image{../png/contfa, 11cm}
-@caption{Example of ContF3()}
-@end float
+@fig{png/contfa, Example of ContF3()}
@c ------------------------------------------------------------------
@node Dens projection sample, Cont projection sample, ContF3 sample, 3D samples
}
@end verbatim
-@float
-@image{../png/dens_xyz, 11cm}
-@caption{Example of DensX(), DensY(), DensZ()}
-@end float
+@fig{png/dens_xyz, {Example of DensX(), DensY(), DensZ()}}
@c ------------------------------------------------------------------
@node Cont projection sample, ContF projection sample, Dens projection sample, 3D samples
}
@end verbatim
-@float
-@image{../png/cont_xyz, 11cm}
-@caption{Example of ContX(), ContY(), ContZ()}
-@end float
+@fig{png/cont_xyz, {Example of ContX(), ContY(), ContZ()}}
@c ------------------------------------------------------------------
@node ContF projection sample, TriPlot and QuadPlot, Cont projection sample, 3D samples
}
@end verbatim
-@float
-@image{../png/contf_xyz, 11cm}
-@caption{Example of ContFX(), ContFY(), ContFZ()}
-@end float
+@fig{png/contf_xyz, {Example of ContFX(), ContFY(), ContFZ()}}
@c ------------------------------------------------------------------
@node TriPlot and QuadPlot, Axial sample, ContF projection sample, 3D samples
}
@end verbatim
-@float
-@image{../png/triplot, 11cm}
-@caption{Example of TriPlot() and QuadPlot()}
-@end float
+@fig{png/triplot, Example of TriPlot() and QuadPlot()}
@c ------------------------------------------------------------------
@node Dots sample, , TriPlot and QuadPlot, 3D samples
}
@end verbatim
-@float
-@image{../png/dots, 11cm}
-@caption{Example of Dots()}
-@end float
+@fig{png/dots, Example of Dots()}
@c ------------------------------------------------------------------
@node Vector field samples, Hints, 3D samples, Examples
@section Vector field samples
-Vector field visualization (especially in 3d case) may look tangly -- there are too many overlapping lines. I may suggest 2 ways to solve this problem. The first one is to change @code{MeshNum} for decreasing the number of hachures. The second way is to use the flow thread chart @code{Flow}. Unfortunately, I don't know any other methods to visualize 3d vector field. If you know any, e-mail me and I shall add it to MathGL.
+Vector field visualization (especially in 3d case) is more or less complex task. MathGL provides 3 general types of plots: vector field itself (@code{Vect}), flow threads (@code{Flow}), and flow pipes with radius proportional to field amplitude (@code{Pipe}).
+
+However, the plot may look tangly -- there are too many overlapping lines. I may suggest 2 ways to solve this problem. The first one is to change @code{SetMeshNum} for decreasing the number of hachures. The second way is to use the flow thread chart @code{Flow}, or possible many flow thread from manual position (@code{FlowP}). Unfortunately, I don't know any other methods to visualize 3d vector field. If you know any, e-mail me and I shall add it to MathGL.
+
+Most of samples will use the same data for plotting. So, I put its initialization in separate function
+@verbatim
+void mgls_prepare2v(mglData *a, mglData *b)
+{
+ register long i,j,n=20,m=30,i0;
+ if(a) a->Create(n,m); if(b) b->Create(n,m);
+ float x,y;
+ for(i=0;i<n;i++) for(j=0;j<m;j++)
+ {
+ x=i/(n-1.); y=j/(m-1.); i0 = i+n*j;
+ if(a) a->a[i0] = 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y);
+ if(b) b->a[i0] = 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y);
+ }
+}
+void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez)
+{
+ register long i,j,k,n=10,i0;
+ if(!ex || !ey || !ez) return;
+ ex->Create(n,n,n); ey->Create(n,n,n); ez->Create(n,n,n);
+ float x,y,z, r1,r2;
+ for(i=0;i<n;i++) for(j=0;j<n;j++) for(k=0;k<n;k++)
+ {
+ x=2*i/(n-1.)-1; y=2*j/(n-1.)-1; z=2*k/(n-1.)-1; i0 = i+n*(j+k*n);
+ r1 = pow(x*x+y*y+(z-0.3)*(z-0.3)+0.03,1.5);
+ r2 = pow(x*x+y*y+(z+0.3)*(z+0.3)+0.03,1.5);
+ ex->a[i0]=0.2*x/r1 - 0.2*x/r2;
+ ey->a[i0]=0.2*y/r1 - 0.2*y/r2;
+ ez->a[i0]=0.2*(z-0.3)/r1 - 0.2*(z+0.3)/r2;
+ }
+}
+@end verbatim
+or using C functions
+@verbatim
+void mgls_prepare2v(mglData *a, mglData *b)
+{
+ register long i,j,n=20,m=30,i0;
+ if(a) mgl_data_create(a,n,m,1);
+ if(b) mgl_data_create(b,n,m,1);
+ float x,y;
+ for(i=0;i<n;i++) for(j=0;j<m;j++)
+ {
+ x=i/(n-1.); y=j/(m-1.); i0 = i+n*j;
+ if(a) mgl_data_set_value(a, 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y), i,j,0);
+ if(b) mgl_data_set_value(b, 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y), i,j,0);
+ }
+}
+void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez)
+{
+ register long i,j,k,n=10,i0;
+ if(!ex || !ey || !ez) return;
+ mgl_data_create(ex,n,n,n);
+ mgl_data_create(ey,n,n,n);
+ mgl_data_create(ez,n,n,n);
+ float x,y,z, r1,r2;
+ for(i=0;i<n;i++) for(j=0;j<n;j++) for(k=0;k<n;k++)
+ {
+ x=2*i/(n-1.)-1; y=2*j/(n-1.)-1; z=2*k/(n-1.)-1; i0 = i+n*(j+k*n);
+ r1 = pow(x*x+y*y+(z-0.3)*(z-0.3)+0.03,1.5);
+ r2 = pow(x*x+y*y+(z+0.3)*(z+0.3)+0.03,1.5);
+ mgl_data_set_value(ex, 0.2*x/r1 - 0.2*x/r2, i,j,k);
+ mgl_data_set_value(ey, 0.2*y/r1 - 0.2*y/r2, i,j,k);
+ mgl_data_set_value(ez, 0.2*(z-0.3)/r1 - 0.2*(z+0.3)/r2, i,j,k);
+ }
+}
+@end verbatim
+
+@menu
+* Vect sample::
+* Traj sample::
+* Flow sample::
+* Pipe sample::
+* Dew sample::
+@end menu
+
+
+@c ------------------------------------------------------------------
+@node Vect sample, Traj sample, , Vector field samples
+@subsection Vect sample
+
+@code{Vect} is most standard way to visualize vector fields -- it draw a lot of arrows or hachures for each data cell. It have a lot of options which can be seen on the figure (and in the sample code). @code{Vect} use color scheme for coloring (see @ref{Color scheme}). The sample code is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData a,b; mgls_prepare2v(&a,&b);
+ gr->SubPlot(3,2,0,""); gr->Title("Vect plot (default)");
+ gr->Box(); gr->Vect(a,b);
+
+ gr->SubPlot(3,2,1,""); gr->Title("'.' style; '=' style");
+ gr->Box(); gr->Vect(a,b,"=.");
+
+ gr->SubPlot(3,2,2,""); gr->Title("'f' style");
+ gr->Box(); gr->Vect(a,b,"f");
+
+ gr->SubPlot(3,2,3,""); gr->Title("'>' style");
+ gr->Box(); gr->Vect(a,b,">");
+
+ gr->SubPlot(3,2,4,""); gr->Title("'<' style");
+ gr->Box(); gr->Vect(a,b,"<");
+
+ mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez);
+ gr->SubPlot(3,2,5); gr->Title("3d variant"); gr->Rotate(50,60);
+ gr->Box(); gr->Vect(ex,ey,ez);
+ return 0;
+}
+@end verbatim
+
+@fig{png/vect, Example of Vect()}
+
+@c ------------------------------------------------------------------
+@node Traj sample, Flow sample, Vect sample, Vector field samples
+@subsection Traj sample
+
+@code{Traj} is 1D analogue of @code{Vect}. It draw vectors from specified points. The sample code is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData x,y,y1,y2; mgls_prepare1d(&y,&y1,&y2,&x);
+ gr->SubPlot(1,1,0,""); gr->Title("Traj plot");
+ gr->Box(); gr->Plot(x,y); gr->Traj(x,y,y1,y2);
+ return 0;
+}
+@end verbatim
+
+@fig{png/traj, Example of Traj()}
+
+
+@c ------------------------------------------------------------------
+@node Flow sample, Pipe sample, Traj sample, Vector field samples
+@subsection Flow sample
+
+@code{Flow} is another standard way to visualize vector fields -- it draw lines (threads) which is tangent to local vector field direction. MathGL draw threads from edges of bounding box and from central slices. Sometimes it is not most appropriate variant -- you may want to use @code{FlowP} to specify manual position of threads. @code{Flow} use color scheme for coloring (see @ref{Color scheme}). At this warm color corresponds to normal flow (like attractor), cold one corresponds to inverse flow (like source). The sample code is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData a,b; mgls_prepare2v(&a,&b);
+ gr->SubPlot(2,2,0,""); gr->Title("Flow plot (default)");
+ gr->Box(); gr->Flow(a,b);
+
+ gr->SubPlot(2,2,1,""); gr->Title("'v' style");
+ gr->Box(); gr->Flow(a,b,"v");
+
+ gr->SubPlot(2,2,2,""); gr->Title("from edges only");
+ gr->Box(); gr->Flow(a,b,"","value -5");
+
+ mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez);
+ gr->SubPlot(2,2,3); gr->Title("3d variant"); gr->Rotate(50,60);
+ gr->Box(); gr->Flow(ex,ey,ez);
+ return 0;
+}
+@end verbatim
+
+@fig{png/flow, Example of Flow()}
+
+@c ------------------------------------------------------------------
+@node Pipe sample, Dew sample, Flow sample, Vector field samples
+@subsection Pipe sample
+
+@code{Pipe} is similar to @code{Flow} but draw pipes (tubes) which radius is proportional to the amplitude of vector field. @code{Pipe} use color scheme for coloring (see @ref{Color scheme}). At this warm color corresponds to normal flow (like attractor), cold one corresponds to inverse flow (like source). The sample code is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData a,b; mgls_prepare2v(&a,&b);
+ gr->SubPlot(2,2,0,""); gr->Title("Flow plot (default)");
+ gr->Light(true); gr->Box(); gr->Pipe(a,b);
+
+ gr->SubPlot(2,2,1,""); gr->Title("'i' style");
+ gr->Box(); gr->Pipe(a,b,"i");
+
+ gr->SubPlot(2,2,2,""); gr->Title("from edges only");
+ gr->Box(); gr->Pipe(a,b,"",0.05,"value -5");
+
+ mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez);
+ gr->SubPlot(2,2,3); gr->Title("3d variant"); gr->Rotate(50,60);
+ gr->Box(); gr->Pipe(ex,ey,ez,"",0.1);
+ return 0;
+}
+@end verbatim
+
+@fig{png/pipe, Example of Pipe()}
+
+@c ------------------------------------------------------------------
+@node Dew sample, , Pipe sample, Vector field samples
+@subsection Dew sample
+
+@code{Dew} is similar to @code{Vect} but use drops instead of arrows. The sample code is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData a,b; mgls_prepare2v(&a,&b);
+ gr->SubPlot(1,1,0,""); gr->Title("Dew plot");
+ gr->Box(); gr->Light(true); gr->Dew(a,b);
+ return 0;
+}
+@end verbatim
+
+@fig{png/dew, Example of Dew()}
@c ------------------------------------------------------------------
@node Hints, FAQ, Vector field samples, Examples
@section Hints
-In this section I have included some small hints and advices for the improving of the quality of plots and for the demonstration of some non-trivial features of MathGL library. In contrast to previous examples I showed mostly the idea but not the whole drawing function.
+In this section I've included some small hints and advices for the improving of the quality of plots and for the demonstration of some non-trivial features of MathGL library. In contrast to previous examples I showed mostly the idea but not the whole drawing function.
@menu
* ``Compound'' graphics::
-* Two axes in one plot::
-* Titles for the plot::
-* Changing of the color range::
-* Management of a point cutting::
-* Vector field visualization::
+* Transparency and lighting::
+* Types of transparency::
+* Adding fog::
* Several light sources::
-* CutMin and CutMax features::
+* Using primitives::
+* STFA sample::
* Mapping visualization::
-* Log-scaled plot::
-* ``Templates''::
-* Nonlinear fitting hints::
+* Making histogram::
+* Nonlinear fitting sample::
* PDE solving hints::
* MGL parser using::
+* ``Templates''::
* Stereo image::
@end menu
@c ------------------------------------------------------------------
-@node ``Compound'' graphics, Two axes in one plot, , Hints
+@node ``Compound'' graphics, Transparency and lighting, , Hints
@subsection ``Compound'' graphics
As I noted above, MathGL functions (except the special one, like Clf()) do not erase the previous plotting but just add the new one. It allows one to draw ``compound'' plots easily. For example, popular Matlab command @code{surfc} can be emulated in MathGL by 2 calls:
@verbatim
- Surf(a);
- Cont(a, 0, 7, -1); // draw contours at z = -1
+ Surf(a);
+ Cont(a, "_"); // draw contours at bottom
@end verbatim
Here @var{a} is 2-dimensional data for the plotting, @code{-1} is the value of z-coordinate at which the contour should be plotted (at the bottom in this example). Analogously, one can draw density plot instead of contour lines and so on.
Another nice plot is contour lines plotted directly on the surface:
@verbatim
- Light(true); // switch on light for the surface
- Surf(a, "BbcyrR"); // select 'jet' colormap for the surface
- Cont(a, "y"); // and yellow color for contours
+ Light(true); // switch on light for the surface
+ Surf(a, "BbcyrR"); // select 'jet' colormap for the surface
+ Cont(a, "y"); // and yellow color for contours
@end verbatim
The possible difficulties arise in black&white case, when the color of the surface can be close to the color of a contour line. In that case I may suggest the following code:
@verbatim
- Light(true); // switch on light for the surface
- Surf(a, "kw"); // select 'gray' colormap for the surface
- CAxis(-1,0); // first draw for darker surface colors
- Cont(a, "w"); // white contours
- CAxis(0,1); // now draw for brighter surface colors
- Cont(a, "k"); // black contours
- CAxis(-1,1); // return color range to original state
+ Light(true); // switch on light for the surface
+ Surf(a, "kw"); // select 'gray' colormap for the surface
+ CAxis(-1,0); // first draw for darker surface colors
+ Cont(a, "w"); // white contours
+ CAxis(0,1); // now draw for brighter surface colors
+ Cont(a, "k"); // black contours
+ CAxis(-1,1); // return color range to original state
@end verbatim
The idea is to divide the color range on 2 parts (dark and bright) and to select the contrasting color for contour lines for each of part.
Similarly, one can plot flow thread over density plot of vector field amplitude (this is another amusing plot from Matlab) and so on. The list of compound graphics can be prolonged but I hope that the general idea is clear.
+Just for illustration I put here following sample code:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData a,b,d; mgls_prepare2v(&a,&b); d = a;
+ for(int i=0;i<a.nx*a.ny;i++) d.a[i] = hypot(a.a[i],b.a[i]);
+ mglData c; mgls_prepare3d(&c);
+ mglData v(10); v.Fill(-0.5,1);
+
+ gr->SubPlot(2,2,1,""); gr->Title("Flow + Dens");
+ gr->Flow(a,b,"br"); gr->Dens(d,"BbcyrR"); gr->Box();
+
+ gr->SubPlot(2,2,0); gr->Title("Surf + Cont"); gr->Rotate(50,60);
+ gr->Light(true); gr->Surf(a); gr->Cont(a,"y"); gr->Box();
+
+ gr->SubPlot(2,2,2); gr->Title("Mesh + Cont"); gr->Rotate(50,60);
+ gr->Box(); gr->Mesh(a); gr->Cont(a,"_");
+
+ gr->SubPlot(2,2,3); gr->Title("Surf3 + ContF3");gr->Rotate(50,60);
+ gr->Box(); gr->ContF3(v,c,"z",0); gr->ContF3(v,c,"x"); gr->ContF3(v,c);
+ gr->SetCutBox(mglPoint(0,-1,-1), mglPoint(1,0,1.1));
+ gr->ContF3(v,c,"z",c.nz-1); gr->Surf3(-0.5,c);
+ return 0;
+}
+@end verbatim
+
+@fig{png/combined, Example of ``combined'' plots}
+
@c ------------------------------------------------------------------
-@node Two axes in one plot, Titles for the plot, ``Compound'' graphics, Hints
-@subsection Two axes in one plot
+@node Transparency and lighting, Types of transparency, ``Compound'' graphics, Hints
+@subsection Transparency and lighting
-Developing the previous hint one can make a plot with 2 or more axes. The idea is that the change of settings does not influence on the already drawn graphics. So, for 2-axes plot let us set the first axis and draw everything concerning it. Then let us setup the second axis and draw things for the second axis. The corresponding code is (@pxref{2-axes sample}):
+Here I want to show how transparency and lighting both and separately change the look of a surface. So, there is code and picture for that:
@verbatim
- // set up first axis
- Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(-1,-1,-1));
- Axis(); // draw it
- Plot(y1,"b"); // draw something in first axis
- // set up second axis
- Axis(mglPoint(0,0,0),mglPoint(1,1,1),mglPoint(1,1,1));
- Axis(); // draw it
- Stem(y2,"r"); // draw something in second axis
+int sample(mglGraph *gr)
+{
+ mglData a; mgls_prepare2d(&a);
+ gr->SubPlot(2,2,0); gr->Title("default"); gr->Rotate(50,60);
+ gr->Box(); gr->Surf(a);
+
+ gr->SubPlot(2,2,1); gr->Title("light on"); gr->Rotate(50,60);
+ gr->Box(); gr->Light(true); gr->Surf(a);
+
+ gr->SubPlot(2,2,2); gr->Title("alpha on; light on"); gr->Rotate(50,60);
+ gr->Box(); gr->Alpha(true); gr->Surf(a);
+
+ gr->SubPlot(2,2,3); gr->Title("alpha on"); gr->Rotate(50,60);
+ gr->Box(); gr->Light(false); gr->Surf(a);
+ return 0;
+}
@end verbatim
-Note, that the first and the second axes look better if being placed in different corners. In the code presented above the first axis is placed in the left-bottom corner, and the second one is placed in the right-top corner.
+
+@fig{png/alpha, Example of transparency and lightings}
@c ------------------------------------------------------------------
-@node Titles for the plot, Changing of the color range, Two axes in one plot, Hints
-@subsection Titles for the plot
+@node Types of transparency, Adding fog, Transparency and lighting, Hints
+@subsection Types of transparency
-The printing of nice titles for the plot is not so trivial task in general case. The problem is that the rotation and aspect change lead to different looks for titles of different subplots. So, the resulting look is not so good as it could be. The solution is simple -- to print titles exactly after @code{SubPlot}() call and before any rotation, aspect change and so on! Analogously, the title for the whole picture looks better if it is printed first (before any @code{SubPlot()} calls). Alternatively you can use function @code{Title()} for plotting title for the picture at any time.
+MathGL library has advanced features for setting and handling the surface transparency. The simplest way to add transparency is the using of function @code{Alpha()}. As a result, all further surfaces (and isosurfaces, density plots and so on) become transparent. However, their look can be additionally improved.
-@c ------------------------------------------------------------------
-@node Changing of the color range, Management of a point cutting, Titles for the plot, Hints
-@subsection Changing of the color range
+The value of transparency can be different from surface to surface. To do it just use @code{SetAlphaDef} before the drawing of the surface, or use option @code{alpha} (see @ref{Command options}). If its value is close to 0 then the surface becomes more and more transparent. Contrary, if its value is close to 1 then the surface becomes practically non-transparent.
-By default (for the user comfort), the color range is set equal to z-range of the plot. However, there are different ranges. So, one can obtain amusing plot by the change of color range manually. For example, there are plots with one-color bottom (or top) or practically bi-color picture and so on.
+Also you can change the way how the light goes through overlapped surfaces. The function @code{SetTranspType} defines it. By default the usual transparency is used (@samp{0}) -- surfaces below is less visible than the upper ones. A ``glass-like'' transparency (@samp{1}) has a different look -- each surface just decreases the background light (the surfaces are commutable in this case).
-For example, compare 2 surfaces:
+A ``neon-like'' transparency (@samp{2}) has more interesting look. In this case a surface is the light source (like a lamp on the dark background) and just adds some intensity to the color. At this, the library sets automatically the black color for the background and changes the default line color to white.
+
+As example I shall show several plots for different types of transparency. The code is the same except the values of @code{SetTranspType} function:
@verbatim
- SubPlot(2,1,0)
- Surf(a); // usual coloring range
- SubPlot(2,1,1)
- CAxis(0,1);
- Surf(a); // bottom of the surface have one-colour filling
+int sample(mglGraph *gr)
+{
+ gr->Alpha(true); gr->Light(true);
+ mglData a; mgls_prepare2d(&a);
+ gr->SetTranspType(0); gr->Clf();
+ gr->SubPlot(2,2,0); gr->Rotate(50,60); gr->Surf(a); gr->Box();
+ gr->SubPlot(2,2,1); gr->Rotate(50,60); gr->Dens(a); gr->Box();
+ gr->SubPlot(2,2,2); gr->Rotate(50,60); gr->Cont(a); gr->Box();
+ gr->SubPlot(2,2,3); gr->Rotate(50,60); gr->Axial(a); gr->Box();
+ return 0;
+}
@end verbatim
-@c ------------------------------------------------------------------
-@node Management of a point cutting, Vector field visualization, Changing of the color range, Hints
-@subsection Management of a point cutting
+@fig{png/type0, Example of @code{SetTranspType(0)}.}
+@fig{png/type1, Example of @code{SetTranspType(1)}.}
+@fig{png/type2, Example of @code{SetTranspType(2)}.}
+
-Sometimes an experimental or numerical surface has outstanding points. Visualization of such surface will lead to the hole(s) in place of such points. The standard method of ``fighting'' -- to change data values -- is not always good and is not so convenient. MathGL library has another method -- to set variable @code{Cut=false}. As a consequence, all outstanding points will be projected on the bounding box.
+@c ------------------------------------------------------------------
+@node Adding fog, Several light sources, Types of transparency, Hints
+@subsection Adding fog
-Such method is good not only for outstanding points but also for the case when one need to plane the bottom or the top of the plot. Exactly such case is demonstrated in the code:
+MathGL can add a fog to the image. Its switching on is rather simple -- just use @code{Fog} function. There is the only feature -- fog is applied for whole image. Not to particular subplot. The sample code is:
@verbatim
- mglData a(20,30); // create some data
- a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
- // set lower border above the data minimal value
- Axis(mglPoint(-1,-1,0),mglPoint(1,1,1));
- Cut = false; // set off cutting flag
-` Surf(a); // and draw the surface
+int sample(mglGraph *gr)
+{
+ mglData a; mgls_prepare2d(&a);
+ gr->Title("Fog sample");
+ gr->Light(true); gr->Rotate(50,60); gr->Fog(1); gr->Box();
+ gr->Surf(a);
+ return 0;
+}
@end verbatim
-It is an interesting result, is not it?
+
+@fig{png/fog, Example of @code{Fog()}.}
@c ------------------------------------------------------------------
-@node Vector field visualization, Several light sources, Management of a point cutting, Hints
-@subsection Vector field visualization
+@node Several light sources, Using primitives, Adding fog, Hints
+@subsection Several light sources
-Vector field visualization (especially in 3d case @code{Vect3} or @code{VectC}) may look tangly -- there are too many overlapping lines. I may suggest 2 ways to solve this problem. The first one is to change @code{MeshNum} for decreasing the number of hachures. The second way is to use the flow thread chart @code{Flow}. Unfortunately, I don't know any other methods to visualize 3d vector field. If you know any, e-mail me and I shall add it to MathGL.
+In contrast to the most of other programs, MathGL supports several (up to 10) light sources. Moreover, the color each of them can be different: white (this is usual), yellow, red, cyan, green and so on. The use of several light sources may be interesting for the highlighting of some peculiarities of the plot or just to make an amusing picture. Note, each light source can be switched on/off individually. The sample code is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData a; mgls_prepare2d(&a);
+ gr->Title("Several light sources");
+ gr->Rotate(50,60); gr->Light(true);
+ gr->AddLight(1,mglPoint(0,1,0),'c');
+ gr->AddLight(2,mglPoint(1,0,0),'y');
+ gr->AddLight(3,mglPoint(0,-1,0),'m');
+ gr->Box(); gr->Surf(a,"h");
+ return 0;
+}
+@end verbatim
+
+@fig{png/several_light, Example of several light sources.}
@c ------------------------------------------------------------------
-@node Several light sources, CutMin and CutMax features, Vector field visualization, Hints
-@subsection Several light sources
+@node Using primitives, STFA sample, Several light sources, Hints
+@subsection Using primitives
-In contrast to the most of other programs, MathGL supports several (up to 10) light sources. Moreover, the color each of them can be different: white (this is usual), yellow, red, cyan, green and so on. The use of several light sources may be interesting for the highlighting of some peculiarities of the plot or just to make an amusing picture. Note, each light source can be switched on/off individually (@pxref{Several light sample}).
+MathGL provide a set of functions for drawing primitives (see @ref{Primitives}). Primitives are low level object, which used by most of plotting functions. Picture below demonstrate some of commonly used primitives.
+
+@fig{png/primitives, Primitives in MathGL.}
+
+Generally, you can create arbitrary new kind of plot using primitives. For example, MathGL don't provide any special functions for drawing molecules. However, you can do it using only one type of primitives @code{Drop}. The sample code is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ gr->Alpha(true); gr->Light(true);
+
+ gr->SubPlot(2,2,0,""); gr->Title("Methane, CH_4");
+ gr->StartGroup("Methane");
+ gr->Rotate(60,120);
+ gr->Sphere(mglPoint(0,0,0),0.25,"k");
+ gr->Drop(mglPoint(0,0,0),mglPoint(0,0,1),0.35,"h",1,2);
+ gr->Sphere(mglPoint(0,0,0.7),0.25,"g");
+ gr->Drop(mglPoint(0,0,0),mglPoint(-0.94,0,-0.33),0.35,"h",1,2);
+ gr->Sphere(mglPoint(-0.66,0,-0.23),0.25,"g");
+ gr->Drop(mglPoint(0,0,0),mglPoint(0.47,0.82,-0.33),0.35,"h",1,2);
+ gr->Sphere(mglPoint(0.33,0.57,-0.23),0.25,"g");
+ gr->Drop(mglPoint(0,0,0),mglPoint(0.47,-0.82,-0.33),0.35,"h",1,2);
+ gr->Sphere(mglPoint(0.33,-0.57,-0.23),0.25,"g");
+ gr->EndGroup();
+
+ gr->SubPlot(2,2,1,""); gr->Title("Water, H_{2}O");
+ gr->StartGroup("Water");
+ gr->Rotate(60,100);
+ gr->StartGroup("Water_O");
+ gr->Sphere(mglPoint(0,0,0),0.25,"r");
+ gr->EndGroup();
+ gr->StartGroup("Water_Bond_1");
+ gr->Drop(mglPoint(0,0,0),mglPoint(0.3,0.5,0),0.3,"m",1,2);
+ gr->EndGroup();
+ gr->StartGroup("Water_H_1");
+ gr->Sphere(mglPoint(0.3,0.5,0),0.25,"g");
+ gr->EndGroup();
+ gr->StartGroup("Water_Bond_2");
+ gr->Drop(mglPoint(0,0,0),mglPoint(0.3,-0.5,0),0.3,"m",1,2);
+ gr->EndGroup();
+ gr->StartGroup("Water_H_2");
+ gr->Sphere(mglPoint(0.3,-0.5,0),0.25,"g");
+ gr->EndGroup();
+ gr->EndGroup();
+
+ gr->SubPlot(2,2,2,""); gr->Title("Oxygen, O_2");
+ gr->StartGroup("Oxygen");
+ gr->Rotate(60,120);
+ gr->Drop(mglPoint(0,0.5,0),mglPoint(0,-0.3,0),0.3,"m",1,2);
+ gr->Sphere(mglPoint(0,0.5,0),0.25,"r");
+ gr->Drop(mglPoint(0,-0.5,0),mglPoint(0,0.3,0),0.3,"m",1,2);
+ gr->Sphere(mglPoint(0,-0.5,0),0.25,"r");
+ gr->EndGroup();
+
+ gr->SubPlot(2,2,3,""); gr->Title("Ammonia, NH_3");
+ gr->StartGroup("Ammonia");
+ gr->Rotate(60,120);
+ gr->Sphere(mglPoint(0,0,0),0.25,"b");
+ gr->Drop(mglPoint(0,0,0),mglPoint(0.33,0.57,0),0.32,"n",1,2);
+ gr->Sphere(mglPoint(0.33,0.57,0),0.25,"g");
+ gr->Drop(mglPoint(0,0,0),mglPoint(0.33,-0.57,0),0.32,"n",1,2);
+ gr->Sphere(mglPoint(0.33,-0.57,0),0.25,"g");
+ gr->Drop(mglPoint(0,0,0),mglPoint(-0.65,0,0),0.32,"n",1,2);
+ gr->Sphere(mglPoint(-0.65,0,0),0.25,"g");
+ gr->EndGroup();
+ return 0;
+}
+@end verbatim
+
+@fig{png/molecule, Example of molecules drawing.}
+
+Moreover, some of special plots can be more easily produced by primitives rather than by specialized function. For example, Venn diagram can be produced by @code{Error} plot:
+@verbatim
+int sample(mglGraph *gr)
+{
+ double xx[3]={-0.3,0,0.3}, yy[3]={0.3,-0.3,0.3}, ee[3]={0.7,0.7,0.7};
+ mglData x(3,xx), y(3,yy), e(3,ee);
+ gr->Title("Venn-like diagram"); gr->Alpha(true);
+ gr->Error(x,y,e,e,"!rgb@#o");
+ return 0;
+}
+@end verbatim
+You see that you have to specify and fill 3 data arrays. The same picture can be produced by just 3 calls of @code{Circle} function:
+@verbatim
+int sample(mglGraph *gr)
+{
+ gr->Title("Venn-like diagram"); gr->Alpha(true);
+ gr->Circle(mglPoint(-0.3,0.3),0.7,"rr@");
+ gr->Circle(mglPoint(0,-0.3),0.7,"gg@");
+ gr->Circle(mglPoint( 0.3,0.3),0.7,"bb@");
+ return 0;
+}
+@end verbatim
+Of course, the first variant is more suitable if you need to plot a lot of circles. But for few ones the usage of primitives looks easy.
+
+@fig{png/venn, Example of Venn diagram.}
@c ------------------------------------------------------------------
-@node CutMin and CutMax features, Mapping visualization, Several light sources, Hints
-@subsection CutMin and CutMax features
+@node STFA sample, Mapping visualization, Using primitives, Hints
+@subsection STFA sample
-MathGL library has a feature for cutting of points in some region @var{CutMin*CutMax}. Such an excision can be used to improve the look of the graphics. Moreover, this cutting may help to show an internal structure of an object (like @code{isocaps} plot in Matlab). For example, let us use the standard 3D data array and show its interior (@pxref{CutMinMax sample}).
+Short-time Fourier Analysis (STFA) is one of informative method for analyzing long rapidly oscillating 1D data arrays. It is used to determine the sinusoidal frequency and phase content of local sections of a signal as it changes over time.
+MathGL can find and draw STFA result. Just to show this feature I give following sample. Initial data arrays is 1D arrays with step-like frequency. Exactly this you can see at bottom on the STFA plot. The sample code is:
@verbatim
- mglData c(61,51,40); // create the data
- mglData v(10); v.Fill(-0.5,1);
- c.Modify("(-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1))");
- gr->CutMin = mglPoint(0,-1,-1); gr->CutMax = mglPoint(1,0,1.1);
- gr->Surf3(-0.5,c,"BbcyrR");
- gr->ContF3(v,c,'x',-1,"BbcyrR"); gr->ContF3(v,c,'y',-1,"BbcyrR");
- gr->ContF3(v,c,'z',0,"BbcyrR"); gr->ContF3(v,c,'z',39,"BbcyrR");
+int sample(mglGraph *gr)
+{
+ mglData a(2000), b(2000);
+ gr->Fill(a,"cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+\
+ cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)");
+ gr->SubPlot(1, 2, 0,"<_"); gr->Title("Initial signal");
+ gr->Plot(a);
+ gr->Axis();
+ gr->Label('x', "\\i t");
+
+ gr->SubPlot(1, 2, 1,"<_"); gr->Title("STFA plot");
+ gr->STFA(a, b, 64);
+ gr->Axis();
+ gr->Label('x', "\\i t");
+ gr->Label('y', "\\omega", 0);
+ return 0;
+}
@end verbatim
-One can also exclude points from arbitrary area in space. This area defined by textual formula @code{CutOff()} (@pxref{Cutting}). The algorithm is the same as shown for ``rectangular cutting''.
+@fig{png/stfa, Example of STFA().}
@c ------------------------------------------------------------------
-@node Mapping visualization, Log-scaled plot, CutMin and CutMax features, Hints
+@node Mapping visualization, Making histogram, STFA sample, Hints
@subsection Mapping visualization
Sometime ago I worked with mapping and have a question about its visualization. Let me remember you that mapping is some transformation rule for one set of number to another one. The 1d mapping is just an ordinary function -- it takes a number and transforms it to another one. The 2d mapping (which I used) is a pair of functions which take 2 numbers and transform them to another 2 ones. Except general plots (like @code{SurfC}, @code{SurfA}) there is a special plot -- Arnold diagram. It shows the area which is the result of mapping of some initial area (usually square).
I tried to make such plot in @code{Map}. It shows the set of points or set of faces, which final position is the result of mapping. At this, the color gives information about their initial position and the height describes Jacobian value of the transformation. Unfortunately, it looks good only for the simplest mapping but for the real multivalent quasi-chaotic mapping it produces a confusion. So, use it if you like :).
-@c ------------------------------------------------------------------
-@node Log-scaled plot, ``Templates'', Mapping visualization, Hints
-@subsection Log-scaled plot
+The sample code for mapping visualization is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData a(50, 40), b(50, 40);
+ gr->Puts(mglPoint(0, 0), "\\to", ":C", -1.4);
+ gr->SetRanges(-1,1,-1,1,-2,2);
-Log-scaled plot can be drawn by 2 steps. First, one should change the scale of axis by call @code{SetFunc("lg(x)", "lg(y)");} (in this example, x- and y-axis will be log-scaled). Second, one should set logarithmic scale for axis ticks by changing variables: @code{SetTicks('x',0); SetTicks('y',0);}. Finally, one should check (or change) the axis ranges and origin so that their values to be positive. For example of log-log plot @pxref{Log-log sample}.
+ gr->SubPlot(2, 1, 0);
+ gr->Fill(a,"x"); gr->Fill(b,"y");
+ gr->Puts(mglPoint(0, 1.1), "\\{x, y\\}", ":C", -2); gr->Box();
+ gr->Map(a, b, "brgk");
-@c ------------------------------------------------------------------
-@node ``Templates'', Nonlinear fitting hints, Log-scaled plot, Hints
-@subsection ``Templates''
+ gr->SubPlot(2, 1, 1);
+ gr->Fill(a,"(x^3+y^3)/2"); gr->Fill(b,"(x-y)/2");
+ gr->Puts(mglPoint(0, 1.1), "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", ":C", -2);
+ gr->Box();
+ gr->Map(a, b, "brgk");
+ return 0;
+}
+@end verbatim
-As I have noted before, the change of settings will influence only for the further plotting commands. This allows one to create template function which will contain settings and primitive drawing for often used plots. Correspondingly one may call this template-function for drawing simplification.
+@fig{png/map, Example of Map().}
-For example, let one has a set of points (experimental or numerical) and wants to compare it with theoretical law (for example, with exponent law @math{\exp(-x/2), x \in [0, 20]}). The template-function for this task is:
-@verbatim
- void template(mglGraph *gr)
- {
- mglData law(100); // create the law
- law.Modify("exp(-10*x)");
- gr->Axis(mglPoint(0,0.0001), mglPoint(20,1), mglPoint(0,0.0001));
- gr->SetFunc(0,"lg(y)",0); gr->dy = 0;
- gr->Plot(law,"r2");
- gr->Text(mglPoint(10,0.2),"Theoretical law: e^x","rL");
- gr->Label('x',"x val."); gr->Label('y',"y val.");
- gr->Axis(); gr->Grid("xy","g;"); gr->Box();
- }
-@end verbatim
-At this, one will only write a few lines for data drawing:
+@c ------------------------------------------------------------------
+@node Making histogram, Nonlinear fitting sample, Mapping visualization, Hints
+@subsection Making histogram
+
+Using the @code{Hist} function(s) for making regular distributions is one of useful fast methods to process and plot irregular data. @code{Hist} can be used to find some momentum of set of points by specifying weight function. It is possible to create not only 1D distributions but also 2D and 3D ones. Below I place the simplest sample code which demonstrate @code{Hist} usage:
@verbatim
- template(gr); // apply settings and default drawing from template
- mglData dat("fname.dat"); // load the data
- // and draw it (suppose that data file have 2 columns)
- gr->Plot(dat.SubData(0),dat.SubData(1),"bx ");
+int sample(mglGraph *gr)
+{
+ mglData a(50, 40), b(50, 40);
+ gr->Puts(mglPoint(0, 0), "\\to", ":C", -1.4);
+ gr->SetRanges(-1,1,-1,1,-2,2);
+
+ gr->SubPlot(2, 1, 0);
+ gr->Fill(a,"x"); gr->Fill(b,"y");
+ gr->Puts(mglPoint(0, 1.1), "\\{x, y\\}", ":C", -2); gr->Box();
+ gr->Map(a, b, "brgk");
+
+ gr->SubPlot(2, 1, 1);
+ gr->Fill(a,"(x^3+y^3)/2"); gr->Fill(b,"(x-y)/2");
+ gr->Puts(mglPoint(0, 1.1), "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", ":C", -2);
+ gr->Box();
+ gr->Map(a, b, "brgk");
+ return 0;
+}
@end verbatim
-A template-function can also contain settings for font, transparency, lightning, color scheme and so on.
+
+@fig{png/hist, Example of Hist().}
+
@c ------------------------------------------------------------------
-@node Nonlinear fitting hints, PDE solving hints, ``Templates'', Hints
+@node Nonlinear fitting sample, PDE solving hints, Making histogram, Hints
@subsection Nonlinear fitting hints
-Nonlinear fitting is rather simple. All that you need is the data to fit, the approximation formula and the list of coefficients to fit (better with its initial guess values). Let me demonstrate it on the following simple example (@pxref{Fitting sample}). First, let us use sin function with some random noise:
+Nonlinear fitting is rather simple. All that you need is the data to fit, the approximation formula and the list of coefficients to fit (better with its initial guess values). Let me demonstrate it on the following simple example. First, let us use sin function with some random noise:
@verbatim
- mglData rnd(100), idl(50); //data to be fitted and ideal data
- rnd.Modify("0.4*rnd+0.1+sin(4*pi*x)");
- idl.Modify("0.3+sin(4*pi*x)");
+ mglData rnd(100), in(100); //data to be fitted and ideal data
+ gr->Fill(rnd,"0.4*rnd+0.1+sin(2*pi*x)");
+ gr->Fill(in,"0.3+sin(2*pi*x)");
@end verbatim
and plot it to see that data we will fit
@verbatim
- gr->Axis(mglPoint(-1,-2), mglPoint(1,2));
- gr->Plot(rnd, ". "); gr->Plot(idl, "b");
- gr->Box();
- gr->Text(mglPoint(0,2.2), "initial: y = 0.3+sin(2\pi x)", "C:b", -1);
+ gr->Title("Fitting sample");
+ gr->SetRange('y',-2,2); gr->Box(); gr->Plot(rnd, ". ");
+ gr->Axis(); gr->Plot(in, "b");
+ gr->Puts(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "b");
@end verbatim
The next step is the fitting itself. For that let me specify an initial values @var{ini} for coefficients @samp{abc} and do the fitting for approximation formula @samp{a+b*sin(c*x)}
@verbatim
- mglData res; // The data for found formula
- float ini[3] = {1, 1, 3};
- gr->Fit(res, rnd, "a+b*sin(c*x)", "abc", ini);
+ float ini[3] = {1,1,3};
+ mglData Ini(3,ini);
+ mglData res = gr->Fit(rnd, "a+b*sin(c*x)", "abc", Ini);
@end verbatim
Now display it
@verbatim
- gr->Plot(res, "r");
- gr->Text(mglPoint(-1,-1.3), "fitted:", "L:r", -1);
- gr->PutsFit(mglPoint(0,-1.8), "y = ", "C:r", -1);
+ gr->Plot(res, "r");
+ gr->Puts(mglPoint(-0.9, -1.3), "fitted:", "r:L");
+ gr->PutsFit(mglPoint(0, -1.8), "y = ", "r");
@end verbatim
NOTE! the fitting results may have strong dependence on initial values for coefficients due to algorithm features. The problem is that in general case there are several local "optimums" for coefficients and the program returns only first found one! There are no guaranties that it will be the best. Try for example to set @code{ini[3] = @{0, 0, 0@}} in the code above.
+The full sample code for nonlinear fitting is:
+@verbatim
+int sample(mglGraph *gr)
+{
+ mglData rnd(100), in(100);
+ gr->Fill(rnd,"0.4*rnd+0.1+sin(2*pi*x)");
+ gr->Fill(in,"0.3+sin(2*pi*x)");
+ float ini[3] = {1,1,3};
+ mglData Ini(3,ini);
+
+ mglData res = gr->Fit(rnd, "a+b*sin(c*x)", "abc", Ini);
+
+ gr->Title("Fitting sample");
+ gr->SetRange('y',-2,2); gr->Box(); gr->Plot(rnd, ". ");
+ gr->Axis(); gr->Plot(res, "r"); gr->Plot(in, "b");
+ gr->Puts(mglPoint(-0.9, -1.3), "fitted:", "r:L");
+ gr->PutsFit(mglPoint(0, -1.8), "y = ", "r");
+ gr->Puts(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "b");
+ return 0;
+}
+@end verbatim
+
+@fig{png/fit, Example of nonlinear fitting.}
+
@c ------------------------------------------------------------------
-@node PDE solving hints, MGL parser using, Nonlinear fitting hints, Hints
+@node PDE solving hints, MGL parser using, Nonlinear fitting sample, Hints
@subsection PDE solving hints
-Solving of Partial Differential Equations (PDE, including beam tracing) and ray tracing (or finding particle trajectory) are more or less common task. So, MathGL have several functions for that. There are @code{mglRay()} for ray tracing, @code{mglPDE()} for PDE solving, @code{mglQO2d()} for beam tracing in 2D case (@pxref{Global functions}). Note, that these functions take ``Hamiltonian'' or equations as string values. And I don't plan now to allow one to use user-defined functions. There are 2 reasons: the complexity of corresponding interface; and the basic nature of used methods which are good for samples but may not good for serious scientific calculations.
+Solving of Partial Differential Equations (PDE, including beam tracing) and ray tracing (or finding particle trajectory) are more or less common task. So, MathGL have several functions for that. There are @code{mglRay()} for ray tracing, @code{mglPDE()} for PDE solving, @code{mglQO2d()} for beam tracing in 2D case (see @ref{Global functions}). Note, that these functions take ``Hamiltonian'' or equations as string values. And I don't plan now to allow one to use user-defined functions. There are 2 reasons: the complexity of corresponding interface; and the basic nature of used methods which are good for samples but may not good for serious scientific calculations.
The ray tracing can be done by @code{mglRay()} function. Really ray tracing equation is Hamiltonian equation for 3D space. So, the function can be also used for finding a particle trajectory (i.e. solve Hamiltonian ODE) for 1D, 2D or 3D cases. The function have a set of arguments. First of all, it is Hamiltonian which defined the media (or the equation) you are planning to use. The Hamiltonian is defined by string which may depend on coordinates @samp{x}, @samp{y}, @samp{z}, time @samp{t} (for particle dynamics) and momentums @samp{p}=@math{p_x}, @samp{q}=@math{p_y}, @samp{v}=@math{p_z}. Next, you have to define the initial conditions for coordinates and momentums at @samp{t}=0 and set the integrations step (default is 0.1) and its duration (default is 10). The Runge-Kutta method of 4-th order is used for integration.
@verbatim
- mglData r,a,re(128),im(128);
- r = mglRay("p^2+q^2-x-1", mglPoint(-0.7, -1), mglPoint(0, 0.5));
- gr->Plot(r.SubData(0), r.SubData(1));
+ const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)";
+ mglData r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2);
@end verbatim
This example calculate the reflection from linear layer (media with Hamiltonian @samp{p^2+q^2-x-1}=@math{p_x^2+p_y^2-x-1}). This is parabolic curve. The resulting array have 7 columns which contain data for @{x,y,z,p,q,v,t@}.
The solution of PDE is a bit more complicated. As previous you have to specify the equation as pseudo-differential operator @math{\hat H(x, \nabla)} which is called sometime as ``Hamiltonian'' (for example, in beam tracing). As previously, it is defined by string which may depend on coordinates @samp{x}, @samp{y}, @samp{z} (but not time!), momentums @samp{p}=@math{(d/dx)/i k_0}, @samp{q}=@math{(d/dy)/i k_0} and field amplitude @samp{u}=@math{|u|}. The evolutionary coordinate is @samp{z} in all cases. So that, the equation look like @math{du/dz = ik_0 H(x,y,\hat p, \hat q, |u|)[u]}. Dependence on field amplitude @samp{u}=@math{|u|} allows one to solve nonlinear problems too. For example, for nonlinear Shrodinger equation you may set @code{ham="p^2 + q^2 - u^2"}. Also 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{H = Hre+i*Him}).
-Next step is specifing the initial conditions at @samp{z}=@code{Min.z}. The function need 2 arrays for real and for imaginary part. Note, that coordinates x,y,z are supposed to be in specified range [Min, Max]. So, the data arrays should have corresponding scales. Finally, you may set the integration step and paramter k0=@math{k_0}. Also keep in mind, that internally the 2 times large box is used (for suppressing numerical reflection from boundaries) and the equation should well defined even in this extended range.
+Next step is specifying the initial conditions at @samp{z}=@code{Min.z}. The function need 2 arrays for real and for imaginary part. Note, that coordinates x,y,z are supposed to be in specified range [Min, Max]. So, the data arrays should have corresponding scales. Finally, you may set the integration step and parameter k0=@math{k_0}. Also keep in mind, that internally the 2 times large box is used (for suppressing numerical reflection from boundaries) and the equation should well defined even in this extended range.
Final comment is concerning the possible form of pseudo-differential operator @math{H}. At this moment, simplified form of operator @math{H} is supported -- all ``mixed'' terms (like @samp{x*p}->x*d/dx) are excluded. For example, in 2D case this operator is effectively @math{H = f(p,z) + g(x,z,u)}. However commutable combinations (like @samp{x*q}->x*d/dy) are allowed for 3D case.
-So, for example let solve the equation for beam deflected from linear layer and absorbed later. The operator will have the form @samp{"p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)"} that correspond to equation @math{ik_0 \partial_z u + \Delta u + x \cdot u + i (x+z)/2 \cdot u = 0}. This is typical equation for Electron Cyclotron (EC) absorption in magnetized plasmas. For initial conditions let me select the beam with plane phase front @math{exp(-48*(x+0.7)^2)}. The corresponding code looks like this (@pxref{PDE sample}):
+So, for example let solve the equation for beam deflected from linear layer and absorbed later. The operator will have the form @samp{"p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)"} that correspond to equation @math{ik_0 \partial_z u + \Delta u + x \cdot u + i (x+z)/2 \cdot u = 0}. This is typical equation for Electron Cyclotron (EC) absorption in magnetized plasmas. For initial conditions let me select the beam with plane phase front @math{exp(-48*(x+0.7)^2)}. The corresponding code looks like this:
@verbatim
- mglData a,re(128),im(128);
- re.Fill("exp(-48*(x+0.7)^2)", gr->Min, gr->Max);
- a = mglPDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im,
- gr->Min, gr->Max, 0.01, 30);
- a.Transpose("yxz");
- gr->CAxis(0, 1);
- gr->Dens(a,"wyrRk");
+int sample(mglGraph *gr)
+{
+ mglData a,re(128),im(128);
+ gr->Fill(re,"exp(-48*(x+0.7)^2)");
+ a = gr->PDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, 0.01, 30);
+ a.Transpose("yxz");
+ gr->SubPlot(1,1,0,"<_"); gr->Title("PDE solver");
+ gr->SetRange('c',0,1); gr->Dens(a,"wyrRk");
+ gr->Axis(); gr->Label('x', "\\i x"); gr->Label('y', "\\i z");
+ gr->FPlot("-x", "k|");
+ gr->Puts(mglPoint(0, 0.85), "absorption: (x+z)/2 for x+z>0");
+ gr->Puts(mglPoint(0,1.1),"Equation: ik_0\\partial_zu + \\Delta u + x\\cdot u + i \\frac{x+z}{2}\\cdot u = 0");
+ return 0;
+}
@end verbatim
+@fig{png/pde, Example of PDE solving.}
+
The last example is example of beam tracing. Beam tracing equation is special kind of PDE equation written in coordinates accompanied to a ray. Generally this is the same parameters and limitation as for PDE solving but the coordinates are defined by the ray and by parameter of grid width @var{w} in direction transverse the ray. So, you don't need to specify the range of coordinates. @strong{BUT} there is limitation. The accompanied coordinates are well defined only for smooth enough rays, i.e. then the ray curvature @math{K} (which is defined as @math{1/K^2 = (|\ddot r|^2 |\dot r|^2 - (\ddot r, \dot r)^2)/|\dot r|^6}) is much large then the grid width: @math{K>>w}. So, you may receive incorrect results if this condition will be broken.
You may use following code for obtaining the same solution as in previous example:
@verbatim
- mglData r, xx, yy, a, im(128), re(128);
- const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)";
- r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2);
- // now start beam tracing
- re.Fill("exp(-48*x^2)", gr->Min, gr->Max);
- a = mglQO2d(ham, re, im, r, 1, 30, &xx, &yy);
- gr->CAxis(0, 1);
- gr->Dens(xx, yy, a, "wyrRk");
+int sample(mglGraph *gr)
+{
+ mglData r, xx, yy, a, im(128), re(128);
+ const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)";
+ r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2);
+ gr->SubPlot(1,1,0,"<_"); gr->Title("Beam and ray tracing");
+ gr->Plot(r.SubData(0), r.SubData(1), "k");
+ gr->Axis(); gr->Label('x', "\\i x"); gr->Label('y', "\\i z");
+
+ // now start beam tracing
+ gr->Fill(re,"exp(-48*x^2)");
+ a = mglQO2d(ham, re, im, r, xx, yy, 1, 30);
+ gr->SetRange('c',0, 1);
+ gr->Dens(xx, yy, a, "wyrRk");
+ gr->FPlot("-x", "k|");
+ gr->Puts(mglPoint(0, 0.85), "absorption: (x+y)/2 for x+y>0");
+ gr->Puts(mglPoint(0.7, -0.05), "central ray");
+ return 0;
+}
@end verbatim
+@fig{png/qo2d, Example of beam tracing.}
+
@c ------------------------------------------------------------------
-@node MGL parser using, Stereo image, PDE solving hints, Hints
+@node MGL parser using, ``Templates'', PDE solving hints, Hints
@subsection MGL parser using
-Sometimes you may prefer to use MGL scripts in yours code. It is simpler (especially in comparison with C/Fortran interfaces) and fast way to plot the data with annotations, labels and so on. Class @code{mglParse} (@pxref{mglParse class} parse MGL scripts in C++. It have also the corresponding interface for C/Fortran.
+Sometimes you may prefer to use MGL scripts in yours code. It is simpler (especially in comparison with C/Fortran interfaces) and provide faster way to plot the data with annotations, labels and so on. Class @code{mglParse} (@pxref{mglParse class} parse MGL scripts in C++. It have also the corresponding interface for C/Fortran.
-The key function here is @code{mglParse::Parse()} (or @code{mgl_parse()} for C/Fortran) which execute one command per string. At this the detailed information about the possible errors or warnings is passed as function value. Or you may execute the whole script as long string with lines separated by @samp{\n}. Functions @code{mglParse::Execute()} and @code{mgl_parse_text()} perform it. Also you may set the values of paramters @samp{$0}...@samp{$9} for the script by functions @code{mglParse::AddParam()} or @code{mgl_add_param()}, allow/disable picture resizing, check ``once'' status and so on. The usage is rather stright-forward.
+The key function here is @code{mglParse::Parse()} (or @code{mgl_parse()} for C/Fortran) which execute one command per string. At this the detailed information about the possible errors or warnings is passed as function value. Or you may execute the whole script as long string with lines separated by @samp{\n}. Functions @code{mglParse::Execute()} and @code{mgl_parse_text()} perform it. Also you may set the values of parameters @samp{$0}...@samp{$9} for the script by functions @code{mglParse::AddParam()} or @code{mgl_add_param()}, allow/disable picture resizing, check ``once'' status and so on. The usage is rather straight-forward.
-The only non-obvious thing is data transition between script and yours program. There are 2 stages: add or find variable; and set data to variable. In C++ you may use functions @code{mglParse::AddVar()} and @code{mglParse::FindVar()} which return pointer to @code{mglVar} structure. This structure contain data itself, the variable name and callback function which will be called if variable destroied. Last feature allows you to control the presence of the variable and, for example, close a window with data if this variable is destroyed. In C/Fortran the corresponding functions are @code{mgl_add_var()}, @code{mgl_find_var()}. But these functions return the data array only. Note, you @strong{must not delete or free} the data obtained from these functions!
+The only non-obvious thing is data transition between script and yours program. There are 2 stages: add or find variable; and set data to variable. In C++ you may use functions @code{mglParse::AddVar()} and @code{mglParse::FindVar()} which return pointer to @code{mglData}. In C/Fortran the corresponding functions are @code{mgl_add_var()}, @code{mgl_find_var()}. This data pointer is valid until next @code{Parse()} or @code{Execute()} call. Note, you @strong{must not delete or free} the data obtained from these functions!
So, some simple example at the end. Here I define a data array, create variable, put data into it and plot it. The C++ code looks like this:
@verbatim
- float a[100]; // let a_i = sin(4*pi*x), x=0...1
- for(int i=0;i<100;i++) a[i]=sin(4*M_PI*i/99);
- mglParse *parser = new mglParse;
- mglData &d = (parser->AddVar("dat"))->d;
- d.Set(a,100); // set data to variable
- parser->Execute(gr, "plot dat; xrange 0 1\nbox\naxis");
- // you may break script at any line do something
- // and continue after that
- parser->Execute(gr, "xlabel 'x'\nylabel 'y'");
- // also you may use cycles or conditions in script
- parser->Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext");
- gr->WritePNG("test.png"); // don't forgot to save picture
+int sample(mglGraph *gr)
+{
+ gr->Title("MGL parser sample");
+ float a[100]; // let a_i = sin(4*pi*x), x=0...1
+ for(int i=0;i<100;i++)a[i]=sin(4*M_PI*i/99);
+ mglParse *parser = new mglParse;
+ mglData *d = parser->AddVar("dat");
+ d->Set(a,100); // set data to variable
+ parser->Execute(gr, "plot dat; xrange 0 1\nbox\naxis");
+ // you may break script at any line do something
+ // and continue after that
+ parser->Execute(gr, "xlabel 'x'\nylabel 'y'\nbox");
+ // also you may use cycles or conditions in script
+ parser->Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext");
+ delete parser;
+ return 0;
+}
@end verbatim
The code in C/Fortran looks practically the same:
@verbatim
- float a[100]; // let a_i = sin(4*pi*x), x=0...1
- int i;
- for(i=0;i<100;i++) a[i]=sin(4*M_PI*i/99);
- HMPR parser = mgl_create_parser();
- HMDT d = mgl_add_var(parser, "dat");
- mgl_data_set_float(d,a,100,1,1); // set data to variable
- mgl_parse_text(gr, parser, "plot dat; xrange 0 1\nbox\naxis");
- // you may break script at any line do something
- // and continue after that
- mgl_parse_text(gr, parser, "xlabel 'x'\nylabel 'y'");
- // also you may use cycles or conditions in script
- mgl_parse_text(gr, parser, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext");
- mgl_write_png(gr, "test.png", ""); // don't forgot to save picture
+int sample(HMGL gr)
+{
+ mgl_title(gr, "MGL parser sample")
+ float a[100]; // let a_i = sin(4*pi*x), x=0...1
+ int i;
+ for(i=0;i<100;i++) a[i]=sin(4*M_PI*i/99);
+ HMPR parser = mgl_create_parser();
+ HMDT d = mgl_add_var(parser, "dat");
+ mgl_data_set_float(d,a,100,1,1); // set data to variable
+ mgl_parse_text(gr, parser, "plot dat; xrange 0 1\nbox\naxis");
+ // you may break script at any line do something
+ // and continue after that
+ mgl_parse_text(gr, parser, "xlabel 'x'\nylabel 'y'");
+ // also you may use cycles or conditions in script
+ mgl_parse_text(gr, parser, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext");
+ mgl_write_png(gr, "test.png", ""); // don't forgot to save picture
+ return 0;
+}
@end verbatim
+@fig{png/parser, Example of MGL script parsing.}
+
@c ------------------------------------------------------------------
-@node Stereo image, , MGL parser using, Hints
+@node ``Templates'', Nonlinear fitting sample, MGL parser using, Hints
+@subsection ``Templates''
+
+As I have noted before, the change of settings will influence only for the further plotting commands. This allows one to create ``template'' function which will contain settings and primitive drawing for often used plots. Correspondingly one may call this template-function for drawing simplification.
+
+For example, let one has a set of points (experimental or numerical) and wants to compare it with theoretical law (for example, with exponent law @math{\exp(-x/2), x \in [0, 20]}). The template-function for this task is:
+@verbatim
+void template(mglGraph *gr)
+{
+ mglData law(100); // create the law
+ law.Modify("exp(-10*x)");
+ gr->SetRanges(0,20, 0.0001,1);
+ gr->SetFunc(0,"lg(y)",0);
+ gr->Plot(law,"r2");
+ gr->Puts(mglPoint(10,0.2),"Theoretical law: e^x","r:L");
+ gr->Label('x',"x val."); gr->Label('y',"y val.");
+ gr->Axis(); gr->Grid("xy","g;"); gr->Box();
+}
+@end verbatim
+At this, one will only write a few lines for data drawing:
+@verbatim
+ template(gr); // apply settings and default drawing from template
+ mglData dat("fname.dat"); // load the data
+ // and draw it (suppose that data file have 2 columns)
+ gr->Plot(dat.SubData(0),dat.SubData(1),"bx ");
+@end verbatim
+A template-function can also contain settings for font, transparency, lightning, color scheme and so on.
+
+I understand that this is obvious thing for any professional programmer, but I several times receive suggestion about ``templates'' ... So, I decide to point out it here.
+
+@c ------------------------------------------------------------------
+@node Stereo image, , ``Templates'', Hints
@subsection Stereo image
-One can easily create stereo image in MathGL. Stereo image can be produced by making two subplots with slightly different rotation angles. The corresponding code looks like this (@pxref{Stereo image sample}):
+One can easily create stereo image in MathGL. Stereo image can be produced by making two subplots with slightly different rotation angles. The corresponding code looks like this:
@verbatim
- gr->SubPlot(2,1,0); // left image
- gr->Rotate(40,60+3);
- // draw something here
+int sample(mglGraph *gr)
+{
+ mglData a; mgls_prepare2d(&a);
+ gr->Light(true);
+
+ gr->SubPlot(2,1,0); gr->Rotate(50,60+3);
+ gr->Box(); gr->Surf(a);
- gr->SubPlot(2,1,1); // right image
- gr->Rotate(40,60-3);
- // draw the same here
+ gr->SubPlot(2,1,1); gr->Rotate(50,60-3);
+ gr->Box(); gr->Surf(a);
+ return 0;
+}
@end verbatim
+@fig{png/stereo, Example of stereo image.}
+
@node FAQ, , Hints, Examples
@section FAQ
@emph{AT&T function} -- @code{void mgl_fplot_(uintptr_t *graph, const char *fy, const char *stl, int *n, int ly, int ls);}
-@item I have a class Foo and a drawing method Foo::draw(mglGraph *gr). How I can use it in FLTK or GLUT window?
-The member-functions of classes have a hidden parameter (the pointer to a class instance) in C++. So, their direct usage is impossible. The solution is to write an interface function:
-@example
-int foo_draw(mglGraph *gr, void *par)
-@{ ((Foo *)foo)->draw(gr); @}
-@end example
-and to use it in the call of @code{Window()} function:
-@example
-gr->Window(argc,argv,foo_draw,"Title",this);
-@end example
-
-Alternatively you can inherit your class from @code{mglDraw} class and use the functions like @code{gr->Window(argc, argv, foo, "Title");}.
-
@item How can I print in Russian/Spanish/Arabic/Japanese, and so on?
The standard way is to use Unicode encoding for the text output. But the MathGL library also has interface for 8-bit (char *) strings with internal conversion to Unicode. This conversion depends on the current locale OS. You may change it by @code{setlocale()} function. For example, for Russian text in CP1251 encoding you may use @code{setlocale(LC_CTYPE, "ru_RU.cp1251");} (under MS Windows the name of locale may differ -- @code{setlocale(LC_CTYPE, "russian_russia.1251")}). I strongly recommend not to use the constant @code{LC_ALL} in the conversion. Since it also changes the number format, it may lead to mistakes in formula writing and reading of the text in data files. For example, the program will await a @samp{,} as a decimal point but the user will enter @samp{.}.
@item How can I exclude a point or a region of plot from the drawing?
-There are 3 general ways. First, the point with @code{NAN} value as one of the coordinates will never be plotted. Second, special variables @var{CutMin}, @var{CutMax} or function @code{CutOff}() define the condition when the points should be omitted (@pxref{Cutting}). Last, you may change the transparency of a part of the plot by the help of functions @code{SurfA()}, @code{Surf3A()} (@pxref{Dual plotting}). In this last case the transparency is switched on smoothly.
+There are 3 general ways. First, the point with @code{NAN} value as one of the coordinates will never be plotted. Second, special variables @var{CutMin}, @var{CutMax} or function @code{CutOff}() define the condition when the points should be omitted (see @ref{Cutting}). Last, you may change the transparency of a part of the plot by the help of functions @code{SurfA()}, @code{Surf3A()} (see @ref{Dual plotting}). In this last case the transparency is switched on smoothly.
@item I use VisualStudio, CBuilder or some other compiler (not MinGW/gcc). How can I link the MathGL library?
In version 2.0, the recommended class @code{mglGraph} (header file @code{#include <mgl/mgl.h>}) contains only @code{inline} functions and is acceptable for any compiler with the same binary files. However, if you plan to access low-level features (i.e. classes mglBase, mglCanvas and so on) then you have to recompile MathGL by yours compiler.
@item How I can build MathGL under Windows?
The simplest way is using the combination CMake+MinGW. Also you need some extra libraries like GSL, PNG, JPEG and so on. All of them can be found at @url{http://gnuwin32.sourceforge.net/packages.html}. After installing all components, just run CMake configurator and make the MathGL itself.
-@item How I can create FLTK/GLUT/Qt window in parallel with calculation?
-You should create a separate thread for processing window messages. The cross-platform way is using the @code{pthread} library. You can update the data by calling @code{mglGraphFLTK::Update()} function. The code can look like this:
-@verbatim
-//-----------------------------------------------------------------------------
-#include <mgl/window.h>
-#include <pthread.h>
-
-mglPoint pnt; // some global variable for changable data
-//-----------------------------------------------------------------------------
-int sample(mglGraph *gr)
-{
- gr->Box(); gr->Line(mglPoint(),pnt,"Ar2"); // just draw a vector
- return 0;
-}
-//-----------------------------------------------------------------------------
-void *mgl_fltk_tmp(void *) { mglFlRun(); return 0; }
-int main (int argc, char ** argv)
-{
- mglWindow gr(0,sample,"test"); // create window
- static pthread_t tmp;
- pthread_create(&tmp, 0, mgl_fltk_tmp, 0);
- pthread_detach(tmp); // run window handling in the separate thread
- for(int i=0;i<10;i++) // do calculation
- {
- sleep(1); // which can be very long
- pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1);
- gr.Update(); // update window
- }
- return 0; // finish calculations and close the window
-}
-//-----------------------------------------------------------------------------
-@end verbatim
-If you just need a static image with current results of calculation then you can set @code{NULL} as plotting function and call @code{Update()} when you want to update the image. This way is also usefult for Fortran users.
-@verbatim
-//-----------------------------------------------------------------------------
-#include <mgl/window.h>
-//-----------------------------------------------------------------------------
-int sample(mglGraph *gr)
-{
- gr->Box(); gr->Line(mglPoint(),pnt,"Ar2"); // just draw a vector
- return 0;
-}
-//-----------------------------------------------------------------------------
-void *mgl_fltk_tmp(void *) { mglFlRun(); return 0; }
-int main (int argc, char ** argv)
-{
- mglWindow gr(0,NULL,"test"); // create window
- for(int i=0;i<10;i++) // do calculation
- {
- sleep(1); // which can be very long
- pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1);
- sample(&gr); // draw picture
- gr.Update(); // update window
- }
- return 0; // finish calculations and close the window
-}
-//-----------------------------------------------------------------------------
-@end verbatim
-
-
@item How many people write this library?
Most of the library was written by one person. This is a result of nearly a year of work (mostly in the evening and on holidays): I spent half a year to write the kernel and half a year to a year on extending, improving the library and writing documentation. This process continues now :). The autoconf/automake script was written mostly by D.Kulagin, and the export to IDTF was written mostly by M.Vidassov.
@item How can I draw tick out of a bounding box?
Just set a negative value in @var{SetTickLen}. For example, use @code{gr->SetTickLen(-0.1);}.
-@end table
-
-
+@item How can I prevent text rotation?
+Just use @code{SetRotatedText(false)}.
-@c ------------------------------------------------------------------
-@node Surface transparency, , Plots for 3D data, Data plotting
-@subsection Surface transparency
-
-MathGL library has advanced features for setting and handling the surface transparency. The simplest way to add transparency is the using of function @code{Alpha()}. As a result, all further surfaces (and isosurfaces, density plots and so on) become transparent. However, their look can be additionally improved.
+@item What is @code{*.so}? What is @code{gcc}? How I can use @code{make}?
+This standard GNU tool. There is special FAQ about its usage under Windows -- @uref{http://www.mingw.org/wiki/FAQ}.
-First, the selected surface will be non-transparent if one sets the flag @code{Transparent} before the surface drawing and sets it off after the drawing.
-
-Second, the value of transparency can be different from surface to surface. To do it just change the value of @code{AlphaDef} before the drawing of the selected surface. If its value is close to 0 then the surface becomes more and more transparent. Contrary, if its value is close to 1 then the surface becomes practically non-transparent. This is some analogue of @code{Transparent=true}.
-
-Third feature is the changing of the way how the light goes through overlapped surfaces. The variable @code{TranspType} defines it. By default the usual transparency is used (@code{TranspType=0}) -- surfaces below is less visible than the upper ones. A ``glass-like'' transparency (@code{TranspType=1}) has a different look when the surface just decreases the background light (the surfaces are commutable in this case).
-
-A ``neon-like'' transparency (@code{TranspType=2}) has more interesting look. In this case a surface is the light source (like a lamp on the dark background) and just adds some intensity to the color. At this, the library sets automatically the black color for the background and changes the default line color to white.
-
-As example I shall show the variant of plot from @ref{Plots for 2D data} (grid drawing is disabled) for different types of transparency.
-@float
-@image{../png/type0, 7cm}
-@caption{Example of @code{TranspType=0}.}
-@end float
-@float
-@image{../png/type1, 7cm}
-@caption{Example of @code{TranspType=1}.}
-@end float
-@float
-@image{../png/type2, 7cm}
-@caption{Example of @code{TranspType=2}.}
-@end float
+@end table
* Index::
@end menu
+@ifhtml
+@macro fig {fname,text}
+@center @image{../\fname\, 11cm, , \text\, .png}
+@end macro
+@end ifhtml
+
+@ifnothtml
+@iftex
+@macro fig {fname,text}
+@center @image{\fname\, 11cm, , \text\, .png}
+@end macro
+@end iftex
+
+@ifnottex
+@macro fig {fname,text}
+@c @center @image{\fname\, 11cm, , \text\, .png}
+@end macro
+@end ifnottex
+@end ifnothtml
+
+
@rmacro sref {arg}
@xref{\arg\}, for sample code and picture.
@end rmacro
-@macro tdref{nam}
+@macro tdref {nam}
@uref{http://mathgl.sourceforge.net/pdf_u3d/\nam\.pdf, 3D pdf}
@end macro
--- /dev/null
+.\" Process this file with
+.\" groff -man -Tascii mgl.5
+.\"
+.TH MGL 5 "MARCH 2012" MathGL "User Manuals"
+.SH NAME
+MGL \- MathGL script.
+.SH DESCRIPTION
+.B MGL
+script is textual file which contain commands for making scientific graphics using MathGL library. Is is primarily designed for quick viewing or processing data files as well as produce high-quality plots as output. MGL support animation by defining special comments in file.
+
+For a full description of MGL script language please see the MathGL manual.
+.SH AVAILABILITY
+http://mathgl.sourceforge.net/
+.SH AUTHOR
+Alexey Balakin http://mathgl.sourceforge.net/
+.SH "SEE ALSO"
+.BR mglview (1),
+.BR mglconv (1)
@end ifnottex
@menu
-* Overview::
-* Examples::
+@c * Overview::
+@c * Examples::
* MGL scripts::
* General concepts::
* MathGL core::
* Index::
@end menu
+@ifhtml
+@macro fig {fname,text}
+@center @image{../\fname\, 11cm, , \text\, .png}
+@end macro
+@end ifhtml
+
+@ifnothtml
+@iftex
+@macro fig {fname,text}
+@center @image{\fname\, 11cm, , \text\, .png}
+@end macro
+@end iftex
+
+@ifnottex
+@macro fig {fname,text}
+@c @center @image{\fname\, 11cm, , \text\, .png}
+@end macro
+@end ifnottex
+@end ifnothtml
+
@rmacro sref {arg}
@end rmacro
-@macro tdref{nam}
+@macro tdref {nam}
@end macro
@set UDAV
-@node Overview, Examples, , Top
-@include overview_en.texi
+@c @node Overview, Examples, , Top
+@c @include overview_en.texi
-@node Examples, MGL scripts, Overview, Top
-@include ex_mgl_en.texi
+@c @node Examples, MGL scripts, Overview, Top
+@c @include ex_mgl_en.texi
-@node MGL scripts, General concepts, Examples, Top
+@node MGL scripts, General concepts, , Top
@include parse_en.texi
@node General concepts, MathGL core, MGL scripts, Top
--- /dev/null
+.\" Process this file with
+.\" groff -man -Tascii mglconv.1
+.\"
+.TH MGLCONV 1 "MARCH 2012" MathGL "User Manuals"
+.SH NAME
+mglconv \- Execute MathGL scripts to generate graphical output.
+.SH SYNOPSIS
+.B mglconv
+[parameters] scriptfile
+.SH DESCRIPTION
+.B mglconv
+reads MGL scripts from
+.I scriptfile
+to produce plots of specified functions or data. Result can be saved in bitmap (PNG/JPEG/GIF/BMP) or vector (EPS/SVG/LaTeX/OFF/STL/OBJ/X3D) format. You can use
+.B -
+as file name for reading script from standard input.
+.SH OPTIONS
+.IP "\fB-1 string\fP"
+Set
+.I string
+as argument $1 for script.
+.IP "\fB...\fP"
+.IP "\fB-9 string\fP"
+Set
+.I string
+as argument $9 for script.
+.IP "\fB-A value\fP"
+Add
+.I value
+into the list of animation parameters.
+.IP "\fB-C v1:v2[:dv]\fP"
+Add values in range
+.I v1:v2
+with step
+.I dv
+(default is 1) into the list of animation parameters.
+.IP "\fB-L locname\fP"
+Set the locale to
+.I locname.
+.IP "\fB-o name\fP"
+Set output file name.
+.IP "\fB-h\fP"
+Print help message.
+.SH AUTHOR
+mglconv was written by Alexey Balakin, http://mathgl.sourceforge.net/
+.SH "SEE ALSO"
+.BR mglview (1),
+.BR mgl (5)
--- /dev/null
+.\" Process this file with
+.\" groff -man -Tascii mglview.1
+.\"
+.TH MGLVIEW 1 "MARCH 2012" MathGL "User Manuals"
+.SH NAME
+mglview \- Execute MathGL scripts and show in an window
+.SH SYNOPSIS
+.B mglview
+[parameters] scriptfile
+.SH DESCRIPTION
+.B mglview
+reads MGL scripts from
+.I scriptfile
+to produce plots of specified functions or data. The program will create a GUI window showing the script result. You can use
+.B -
+as file name for reading script from standard input. Another option is using *.mgld files for quick viewing 3d pictures.
+.SH OPTIONS
+.IP "\fB-1 string\fP"
+Set
+.I string
+as argument $1 for script.
+.IP "\fB...\fP"
+.IP "\fB-9 string\fP"
+Set
+.I string
+as argument $9 for script.
+.IP "\fB-L locname\fP"
+Set the locale to
+.I locname.
+.IP "\fB-h\fP"
+Print help message.
+.SH AUTHOR
+mglview was written by Alexey Balakin, http://mathgl.sourceforge.net/
+.SH "SEE ALSO"
+.BR mglconv (1),
+.BR mgl (5)
@c ------------------------------------------------------------------
@chapter Other classes
+There are only 5 end-user classes: @code{mglGraph} (see @ref{MathGL core}), @code{mglWindow} and @code{mglGLUT} (see @ref{Widget classes}), @code{mglData} (see @ref{Data processing}), @code{mglParse} (see @ref{MGL scripts}). Exactly these classes I recommend to use in most of user programs. All methods in all of these classes are inline and have exact C/Fortran analogue functions. This give compiler independent binary libraries for MathGL.
+
+However, sometimes you may need to extend MathGL by writing yours own plotting functions or handling yours own data structures. In these cases you may need to use low-level API. This chapter describes it.
+
+@fig{classes, Class diagram for MathGL}
+
+The internal structure of MathGL is rather complicated. There are C++ classes @code{mglBase}, @code{mglCanvas}, ... for drawing primitives and positioning the plot (blue ones in the figure). There is a layer of C functions, which include interface for most important methods of these classes. Also most of plotting functions are implemented as C functions. After it, there are ``inline'' front-end classes which are created for user convenience (yellow ones in the figure). Also there are 2 classes which are widgets for FLTK and Qt libraries (green ones in the figure).
+
+Below I show how this internal classes can be used.
+
@menu
-* mglFormula class::
+* mglBase class::
+* mglDataA class::
* mglColor class::
* mglPoint class::
* mglFont class::
@c ------------------------------------------------------------------
-@node mglFormula class, mglColor class, , Other classes
-@section mglFormula class
-@cindex mglFormula
+@node mglBase class, mglDataA class, , Other classes
+@subsection Define new kind of plot (mglBase class)
+
+Basically most of new kinds of plot can be created using just MathGL primitives (see @ref{Primitives}). However the usage of @code{mglBase} methods can give you higher speed of drawing and better control of plot settings.
+
+All plotting functions should use a pointer to @code{mglBase} class (or @code{HMGL} type in C functions) due to compatibility issues. Exactly such type of pointers are used in front-end classes (@code{mglGraph, mglWindow}) and in widgets (@code{QMathGL, Fl_MathGL}).
+
+MathGL tries to remember all vertexes and all primitives and plot creation stage, and to use them for making final picture by demand. Basically for making plot, you need to add vertexes by @code{AddPnt()} function, which return index for new vertex, and call one of primitive drawing function (like @code{mark_plot(), arrow_plot(), line_plot(), trig_plot(), quad_plot(), text_plot()}), using vertex indexes as argument(s). @code{AddPnt()} function use 2 float numbers for color specification. First one is positioning in textures -- integer part is texture index, fractional part is relative coordinate in the texture. Second number is like a transparency of plot (or second coordinate in the 2D texture).
+
+I don't want to put here detailed description of @code{mglBase} class. It was rather well documented in @code{mgl/base.h} file. I just show and example of its usage on the base of circle drawing.
+
+First, we should prototype new function @code{circle()} as C function.
+@verbatim
+#ifdef __cplusplus
+extern "C" {
+#endif
+void circle(HMGL gr, float x, float y, float z, float r, const char *stl, const char *opt);
+#ifdef __cplusplus
+}
+#endif
+@end verbatim
+This is done for generating compiler independent binary. Because only C-functions have standard naming mechanism, the same for any compilers.
+
+Now, we create a C++ file and put the code of function. I'll write it line by line and try to comment all important points.
+@verbatim
+void circle(HMGL gr, float x, float y, float z, float r, const char *stl, const char *opt)
+{
+@end verbatim
+First, we need to check all input arguments and send warnings if something is wrong. In our case it is negative value of @var{r} argument. We just send warning, since it is not critical situation -- other plot still can be drawn.
+@verbatim
+ if(r<=0) { gr->SetWarn(mglWarnNeg,"Circle"); return; }
+@end verbatim
+Next step is creating a group. Group keep some general setting for plot (like options) and useful for export in 3d files.
+@verbatim
+ static int cgid=1; gr->StartGroup("Circle",cgid++);
+@end verbatim
+Now let apply options. Options are rather useful things, generally, which allow one easily redefine axis range(s), transparency and other settings (see @ref{Command options}).
+@verbatim
+ gr->SaveState(opt);
+@end verbatim
+I use global setting for determining the number of points in circle approximation. Note, that user can change @code{MeshNum} by options easily.
+@verbatim
+ const int n = gr->MeshNum>1?gr->MeshNum : 41;
+@end verbatim
+Let try to determine plot specific flags. MathGL functions expect that most of flags will be sent in string. In our case it is symbol @samp{@@} which set to draw filled circle instead of border only (last will be default). Note, you have to handle @code{NULL} as string pointer.
+@verbatim
+ bool fill = stl && strchr(stl,'@');
+@end verbatim
+Now, time for coloring. I use palette mechanism because circle have few colors: one for filling and another for border. @code{SetPenPal()} function parse input string and write resulting texture index in @var{pal}. Function return the character for marker, which can be specified in string @var{str}. Marker will be plotted at the center of circle. I'll show on next sample how you can use color schemes (smooth colors) too.
+@verbatim
+ long pal=0;
+ char mk=gr->SetPenPal(stl,&pal);
+@end verbatim
+Next step, is determining colors for filling and for border. First one for filling.
+@verbatim
+ float c=gr->NextColor(pal), d;
+@end verbatim
+Second one for border. I use black color (call @code{gr->AddTexture('k')}) if second color is not specified.
+@verbatim
+ float k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k');
+@end verbatim
+If user want draw only border (@code{fill=false}) then I use first color for border.
+@verbatim
+ if(!fill) k=c;
+@end verbatim
+Now we should reserve space for vertexes. This functions need @code{n} for border, @code{n+1} for filling and @code{1} for marker. So, maximal number of vertexes is @code{2*n+2}. Note, that such reservation is not required for normal work but can sufficiently speed up the plotting.
+@verbatim
+ gr->Reserve(2*n+2);
+@end verbatim
+We've done with setup and ready to start drawing. First, we need to add vertex(es). Let define NAN as normals, since I don't want handle lighting for this plot,
+@verbatim
+ mglPoint q(NAN,NAN);
+@end verbatim
+and start adding vertexes. First one for central point of filling. I use @code{-1} if I don't need this point. The arguments of @code{AddPnt()} function is: @code{mglPoint(x,y,z)} -- coordinate of vertex, @code{c} -- vertex color, @code{q} -- normal at vertex, @code{-1} -- vertex transparency (@code{-1} for default), @code{3} bitwise flag which show that coordinates will be scaled (@code{0x1}) and will not be cutted (@code{0x2}).
+@verbatim
+ long n0,n1,n2,m1,m2,i;
+ n0 = fill ? gr->AddPnt(mglPoint(x,y,z),c,q,-1,3):-1;
+@end verbatim
+Similar for marker, but we use different color @var{k}.
+@verbatim
+ n2 = mk ? gr->AddPnt(mglPoint(x,y,z),k,q,-1,3):-1;
+@end verbatim
+Draw marker.
+@verbatim
+ if(mk) gr->mark_plot(n2,mk);
+@end verbatim
+Time for drawing circle itself. I use @code{-1} for @var{m1}, @var{n1} as sign that primitives shouldn't be drawn for first point @code{i=0}.
+@verbatim
+ for(i=0,m1=n1=-1;i<n;i++)
+ {
+@end verbatim
+Each function should check @code{Stop} variable and return if it is non-zero. It is done for interrupting drawing for system which don't support multi-threading.
+@verbatim
+ if(gr->Stop) return;
+@end verbatim
+Let find coordinates of vertex.
+@verbatim
+ float t = i*2*M_PI/(n-1.);
+ mglPoint p(x+r*cos(t), y+r*sin(t), z);
+@end verbatim
+Save previous vertex and add next one
+@verbatim
+ n2 = n1; n1 = gr->AddPnt(p,c,q,-1,3);
+@end verbatim
+and copy it for border but with different color. Such copying is much faster than adding new vertex using @code{AddPnt()}.
+@verbatim
+ m2 = m1; m1 = gr->CopyNtoC(n1,k);
+@end verbatim
+Now draw triangle for filling internal part
+@verbatim
+ if(fill) gr->trig_plot(n0,n1,n2);
+@end verbatim
+and draw line for border.
+@verbatim
+ gr->line_plot(m1,m2);
+ }
+@end verbatim
+Drawing is done. Let close group and return.
+@verbatim
+ gr->EndGroup();
+}
+@end verbatim
+
+Another sample I want to show is exactly the same function but with smooth coloring using color scheme. So, I'll add comments only in the place of difference.
+
+@verbatim
+void circle_cs(HMGL gr, float x, float y, float z, float r, const char *stl, const char *opt)
+{
+@end verbatim
+In this case let allow negative radius too. Formally it is not the problem for plotting (formulas the same) and this allow us to handle all color range.
+@verbatim
+//if(r<=0) { gr->SetWarn(mglWarnNeg,"Circle"); return; }
+
+ static int cgid=1; gr->StartGroup("CircleCS",cgid++);
+ gr->SaveState(opt);
+ const int n = gr->MeshNum>1?gr->MeshNum : 41;
+ bool fill = stl && strchr(stl,'@');
+@end verbatim
+Here is main difference. We need to create texture for color scheme specified by user
+@verbatim
+ long ss = gr->AddTexture(stl);
+@end verbatim
+But we need also get marker and color for it (if filling is enabled). Let suppose that marker and color is specified after @samp{:}. This is standard delimiter which stop color scheme entering. So, just lets find it and use for setting pen.
+@verbatim
+ const char *pen=0;
+ if(stl) pen = strchr(stl,':');
+ if(pen) pen++;
+@end verbatim
+The substring is placed in @var{pen} and it will be used as line style.
+@verbatim
+ long pal=0;
+ char mk=gr->SetPenPal(pen,&pal);
+@end verbatim
+Next step, is determining colors for filling and for border. First one for filling.
+@verbatim
+ float c=gr->GetC(ss,r);
+@end verbatim
+Second one for border.
+@verbatim
+ float k=gr->NextColor(pal);
+@end verbatim
+The rest part is the same as in previous function.
+@verbatim
+ if(!fill) k=c;
+
+ gr->Reserve(2*n+2);
+ mglPoint q(NAN,NAN);
+ long n0,n1,n2,m1,m2,i;
+ n0 = fill ? gr->AddPnt(mglPoint(x,y,z),c,q,-1,3):-1;
+ n2 = mk ? gr->AddPnt(mglPoint(x,y,z),k,q,-1,3):-1;
+ if(mk) gr->mark_plot(n2,mk);
+ for(i=0,m1=n1=-1;i<n;i++)
+ {
+ if(gr->Stop) return;
+ float t = i*2*M_PI/(n-1.);
+ mglPoint p(x+r*cos(t), y+r*sin(t), z);
+ n2 = n1; n1 = gr->AddPnt(p,c,q,-1,3);
+ m2 = m1; m1 = gr->CopyNtoC(n1,k);
+ if(fill) gr->trig_plot(n0,n1,n2);
+ gr->line_plot(m1,m2);
+ }
+ gr->EndGroup();
+}
+@end verbatim
+
+The last thing which we can do is derive our own class with new plotting functions. Good idea is to derive it from @code{mglGraph} (if you don't need extended window), or from @code{mglWindow} (if you need to extend window). So, in our case it will be
+@verbatim
+class MyGraph : public mglGraph
+{
+public:
+ inline void Circle(mglPoint p, float r, const char *stl="", const char *opt="")
+ { circle(p.x,p.y,p.z, r, stl, opt); }
+ inline void CircleCS(mglPoint p, float r, const char *stl="", const char *opt="")
+ { circle_cs(p.x,p.y,p.z, r, stl, opt); }
+};
+@end verbatim
+Note, that I use @code{inline} modifier for using the same binary code with different compilers.
+
+So, the complete sample will be
+@verbatim
+#include <mgl/mgl.h>
+//---------------------------------------------------------
+#ifdef __cplusplus
+extern "C" {
+#endif
+void circle(HMGL gr, float x, float y, float z, float r, const char *stl, const char *opt);
+void circle_cs(HMGL gr, float x, float y, float z, float r, const char *stl, const char *opt);
+#ifdef __cplusplus
+}
+#endif
+//---------------------------------------------------------
+class MyGraph : public mglGraph
+{
+public:
+ inline void CircleCF(mglPoint p, float r, const char *stl="", const char *opt="")
+ { circle(p.x,p.y,p.z, r, stl, opt); }
+ inline void CircleCS(mglPoint p, float r, const char *stl="", const char *opt="")
+ { circle_cs(p.x,p.y,p.z, r, stl, opt); }
+};
+//---------------------------------------------------------
+void circle(HMGL gr, float x, float y, float z, float r, const char *stl, const char *opt)
+{
+ if(r<=0) { gr->SetWarn(mglWarnNeg,"Circle"); return; }
+ static int cgid=1; gr->StartGroup("Circle",cgid++);
+ gr->SaveState(opt);
+ const int n = gr->MeshNum>1?gr->MeshNum : 41;
+ bool fill = stl && strchr(stl,'@');
+ long pal=0;
+ char mk=gr->SetPenPal(stl,&pal);
+ float c=gr->NextColor(pal), d;
+ float k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k');
+ if(!fill) k=c;
+ gr->Reserve(2*n+2);
+ mglPoint q(NAN,NAN);
+ long n0,n1,n2,m1,m2,i;
+ n0 = fill ? gr->AddPnt(mglPoint(x,y,z),c,q,-1,3):-1;
+ n2 = mk ? gr->AddPnt(mglPoint(x,y,z),k,q,-1,3):-1;
+ if(mk) gr->mark_plot(n2,mk);
+ for(i=0,m1=n1=-1;i<n;i++)
+ {
+ if(gr->Stop) return;
+ float t = i*2*M_PI/(n-1.);
+ mglPoint p(x+r*cos(t), y+r*sin(t), z);
+ n2 = n1; n1 = gr->AddPnt(p,c,q,-1,3);
+ m2 = m1; m1 = gr->CopyNtoC(n1,k);
+ if(fill) gr->trig_plot(n0,n1,n2);
+ gr->line_plot(m1,m2);
+ }
+ gr->EndGroup();
+}
+//---------------------------------------------------------
+void circle_cs(HMGL gr, float x, float y, float z, float r, const char *stl, const char *opt)
+{
+ static int cgid=1; gr->StartGroup("CircleCS",cgid++);
+ gr->SaveState(opt);
+ const int n = gr->MeshNum>1?gr->MeshNum : 41;
+ bool fill = stl && strchr(stl,'@');
+ long ss = gr->AddTexture(stl);
+ const char *pen=0;
+ if(stl) pen = strchr(stl,':');
+ if(pen) pen++;
+ long pal=0;
+ char mk=gr->SetPenPal(pen,&pal);
+ float c=gr->GetC(ss,r);
+ float k=gr->NextColor(pal);
+ if(!fill) k=c;
+
+ gr->Reserve(2*n+2);
+ mglPoint q(NAN,NAN);
+ long n0,n1,n2,m1,m2,i;
+ n0 = fill ? gr->AddPnt(mglPoint(x,y,z),c,q,-1,3):-1;
+ n2 = mk ? gr->AddPnt(mglPoint(x,y,z),k,q,-1,3):-1;
+ if(mk) gr->mark_plot(n2,mk);
+ for(i=0,m1=n1=-1;i<n;i++)
+ {
+ if(gr->Stop) return;
+ float t = i*2*M_PI/(n-1.);
+ mglPoint p(x+r*cos(t), y+r*sin(t), z);
+ n2 = n1; n1 = gr->AddPnt(p,c,q,-1,3);
+ m2 = m1; m1 = gr->CopyNtoC(n1,k);
+ if(fill) gr->trig_plot(n0,n1,n2);
+ gr->line_plot(m1,m2);
+ }
+ gr->EndGroup();
+}
+//---------------------------------------------------------
+int main()
+{
+ MyGraph gr;
+ gr.Box();
+ // first let draw circles with fixed colors
+ for(int i=0;i<10;i++)
+ gr.CircleCF(mglPoint(2*mgl_rnd()-1, 2*mgl_rnd()-1), mgl_rnd());
+ // now let draw circles with color scheme
+ for(int i=0;i<10;i++)
+ gr.CircleCS(mglPoint(2*mgl_rnd()-1, 2*mgl_rnd()-1), 2*mgl_rnd()-1);
+}
+@end verbatim
-Class for evaluating of formula specified by the string. This class is defined in @code{#include <mgl/eval.h>}. This class is accessible only from C++ (and only from GNU compilers in default binary files).
-It is the fast variant of formula evaluation. At creation it will be recognized and compiled to tree-like internal code. At evaluation stage only fast calculations are performed. There is no difference between lower or upper case in formulas. If argument value lie outside the range of function definition then function returns NaN. @xref{Textual formulas}.
-@deftypemethod mglFormula @code{} mglFormula (@code{const char *}str)
-Parses the formula @var{str} and creates formula-tree. Constructor recursively parses the formula and creates a tree-like structure containing functions and operators for fast further evaluating by @code{Calc()} or @code{CalcD()} functions.
-@end deftypemethod
-@deftypemethod mglFormula @code{float} Calc (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}, @code{float} u=@code{0})
-Evaluates the formula for @code{'x','r'}=@var{x}, @code{'y','n'}=@var{y}, @code{'z','t'}=@var{z}, @code{'a','u'}=@var{u}. Error code (if one) can be obtained from function @code{GetError()}.
-@end deftypemethod
-@deftypemethod mglFormula @code{float} Calc (@code{float} x, @code{float} y, @code{float} z, @code{float} u, @code{float} v, @code{float} w)
-Evaluates the formula for @code{'x'}=@var{x}, @code{'y'}=@var{y}, @code{'z'}=@var{z}, @code{'u'}=@var{u}, @code{'v'}=@var{v}, @code{'w'}=@var{w}. Error code (if one) can be obtained from function @code{GetError()}.
-@end deftypemethod
-@deftypemethod mglFormula @code{float} Calc (@code{float} var@code{['z'-'a'+1]})
-Evaluates the formula for variables in array @var{var}['z'-'a']. Error code (if one) can be obtained from function @code{GetError()}.
-@end deftypemethod
-@deftypemethod mglFormula @code{float} CalcD (@code{float} var@code{['z'-'a'+1]}, @code{char} diff)
-Evaluates the formula derivation respect to @var{diff} for variables in array @var{var}['z'-'a']. Error code (if one) can be obtained from function @code{GetError()}.
-@end deftypemethod
-@deftypemethod mglFormula @code{int} GetError ()
-Returns error code: @code{0} means no error; @code{ERR_LOG} means error in logarithm or power functions; @code{ERR_ARC} means error in inverse functions (like asin); @code{ERR_SQRT} means error in sqrt function.
-@end deftypemethod
+
+@c ------------------------------------------------------------------
+@node mglDataA class, mglColor class, mglBase class, Other classes
+@subsection User defined types (mglDataA class)
+
+@code{mglData} class have abstract predecessor class @code{mglDataA}. Exactly the pointers to @code{mglDataA} instances are used in all plotting functions and some of data processing functions. This was done for taking possibility to define yours own class, which will handle yours own data (for example, complex numbers, or differently organized data). And this new class will be almost the same as @code{mglData} for plotting purposes.
+
+However, the most of data processing functions will be slower as if you used @code{mglData} instance. This is more or less understandable -- I don't know how data in yours particular class will be organized, and couldn't optimize the these functions generally.
+
+There are few virtual functions which must be provided in derived classes. This functions give:
+@itemize @bullet
+@item
+the sizes of the data (@code{GetNx}, @code{GetNy}, @code{GetNz}),
+@item
+give data value and numerical derivatives for selected cell (@code{v}, @code{dvx}, @code{dvy}, @code{dvz}),
+@item
+give maximal and minimal values (@code{Maximal}, @code{Minimal}) -- you can use provided functions (like @code{mgl_data_max} and @code{mgl_data_min}), but yours own realization can be more efficient,
+@item
+give access to all element as in single array (@code{vthr}) -- you need this only if you want using MathGL's data processing functions.
+@end itemize
+
+Let me, for example define class @code{mglComplex} which will handle complex number and draw its amplitude or phase, depending on flag @var{use_abs}:
+@verbatim
+#include <complex>
+#include <mgl/mgl.h>
+#define dual std::complex<double>
+class mglComplex : public mglDataA
+{
+public:
+ long nx; ///< number of points in 1st dimensions ('x' dimension)
+ long ny; ///< number of points in 2nd dimensions ('y' dimension)
+ long nz; ///< number of points in 3d dimensions ('z' dimension)
+ dual *a; ///< data array
+ bool use_abs; ///< flag to use abs() or arg()
+
+ inline mglComplex(long xx=1,long yy=1,long zz=1)
+ { a=0; use_abs=true; Create(xx,yy,zz); }
+ virtual ~mglComplex() { if(a) delete []a; }
+
+ /// Get sizes
+ inline long GetNx() const { return nx; }
+ inline long GetNy() const { return ny; }
+ inline long GetNz() const { return nz; }
+ /// Create or recreate the array with specified size and fill it by zero
+ inline void Create(long mx,long my=1,long mz=1)
+ { nx=mx; ny=my; nz=mz; if(a) delete []a;
+ a = new dual[nx*ny*nz]; }
+ /// Get maximal value of the data
+ inline float Maximal() const { return mgl_data_max(this); }
+ /// Get minimal value of the data
+ inline float Minimal() const { return mgl_data_min(this); }
+
+protected:
+ inline mreal v(long i,long j=0,long k=0) const
+ { return use_abs ? abs(a[i+nx*(j+ny*k)]) : arg(a[i+nx*(j+ny*k)]); }
+ inline mreal vthr(long i) const
+ { return use_abs ? abs(a[i]) : arg(a[i]); }
+ inline mreal dvx(long i,long j=0,long k=0) const
+ { register long i0=i+nx*(j+ny*k);
+ std::complex<double> res=i>0? (i<nx-1? (a[i0+1]-a[i0-1])/2.:a[i0]-a[i0-1]) : a[i0+1]-a[i0];
+ return use_abs? abs(res) : arg(res); }
+ inline mreal dvy(long i,long j=0,long k=0) const
+ { register long i0=i+nx*(j+ny*k);
+ std::complex<double> res=j>0? (j<ny-1? (a[i0+nx]-a[i0-nx])/2.:a[i0]-a[i0-nx]) : a[i0+nx]-a[i0];
+ return use_abs? abs(res) : arg(res); }
+ inline mreal dvz(long i,long j=0,long k=0) const
+ { register long i0=i+nx*(j+ny*k), n=nx*ny;
+ std::complex<double> res=k>0? (k<nz-1? (a[i0+n]-a[i0-n])/2.:a[i0]-a[i0-n]) : a[i0+n]-a[i0];
+ return use_abs? abs(res) : arg(res); }
+};
+int main()
+{
+ mglComplex dat(20);
+ for(long i=0;i<20;i++)
+ dat.a[i] = 3*exp(-0.05*(i-10)*(i-10))*dual(cos(M_PI*i*0.3), sin(M_PI*i*0.3));
+ mglGraph gr;
+ gr.SetRange('y', -M_PI, M_PI); gr.Box();
+
+ gr.Plot(dat,"r","legend 'abs'");
+ dat.use_abs=false;
+ gr.Plot(dat,"b","legend 'arg'");
+ gr.Legend();
+ gr.WritePNG("complex.png");
+ return 0;
+}
+@end verbatim
@c ------------------------------------------------------------------
-@node mglColor class, mglPoint class, mglFormula class, Other classes
+@node mglColor class, mglPoint class, mglDataA class, Other classes
@section mglColor class
@cindex mglColor
* Quick guide::
* Changes from v.1::
* Utilities::
-* Thanks::
@end menu
@node What is MathGL?, MathGL features, , Overview
Script @code{./configure} have several additional options which are switched off by default. They are: @code{--enable-fltk, --enable-glut, --enable-qt} for ebabling FLTK, GLUT and/or Qt windows; @code{--enable-jpeg, --enable-gif, --enable-hdf5} for enabling corresponding file formats; @code{--enable-all} for enabling all additional features. For using @code{double} as base internal data type use option @code{--enable-double}. For enabling language interfaces use @code{--enable-python, --enable-octave} or @code{--enable-langall} for all languages. The full list of options can be viewed by command @code{./configure --help}.
@item
-One can use also CMake for building MathGL library if autoconf/automake tools are absent. For example, it is the typical situation for Windows, MacOS and/or using of non-GNU compilers. You can use WYSIWYG tools to change CMake build options. Just specify the features you need and resolve all possible conflicts -- specify the paths for header files or libraries if they are not found automatically. After it run @code{make} and @code{make install} with root/sudo rights.
+One can use also CMake (@uref{http://www.cmake.org/}) for building MathGL library if autoconf/automake tools are absent. For example, it is the typical situation for Windows, MacOS and/or using of non-GNU compilers. You can use WYSIWYG tools to change CMake build options. Just specify the features you need and resolve all possible conflicts -- specify the paths for header files or libraries if they are not found automatically. After it run @code{make} and @code{make install} with root/sudo rights.
@item
Use a precompiled binary. There are binaries for MinGW (platform Win32). For a precompiled variant one needs only to unpack the archive to the location of the compiler (or in any other folder and setup paths). By default, precompiled versions include the support of GSL (www.gsl.org) and PNG. So, one needs to have these libraries installed on system (it can be found, for example, at @uref{http://gnuwin32.sourceforge.net/packages.html}).
@node Changes from v.1, Utilities, Quick guide, Overview
@section Changes from v.1.*
-* 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.
-* Move most of arguments of plotting functions into the string parameter and/or options.
-* ``Bright'' colors (like @{b8@}) can be used in color schemes and line styles.
-* Intensively use pthread internally for parallelization of drawing and data processing.
-* Add tick labels rotation and skipping. Add ticks in time/date format.
-* New kinds of plots (Tape(), Label(), ...). Extend existing plots. New primitives (Circle(), Ellipse(), Rhomb(), ...).
-* Improve MGL scripts. Add 'ask' command and allow string concatenation from different lines.
-* Export to LaTeX and to 3D formats (OBJ, OFF, STL, X3D).
-
-
-@c ------------------------------------------------------------------
-@node Utilities, Thanks, Changes from v.1, Overview
-@section Utilities for parsing MGL
-
-MathGL library provides several tools for parsing MGL scripts. There is tools saving it to bitmap or vectorial images (@code{mgl2conv}). 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.
-
-Both tools expect stdin input if script file is not specified. This allows to use Linux pipes to send script and produce plot.
-
-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.
-
-
-@node Thanks, , Utilities, Overview
-@section Thanks
-
+There are a lot of changes for v.2. Here I denote only main of them.
@itemize @bullet
@item
-My special thanks to Marina Balakina for the patience during the writing of this library and for the help in documentation writing and spelling.
+mglGraph class is single plotter class instead of mglGraphZB, mglGraphPS and so on.
+@item
+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.*.
@item
-I'm thankful to D. Kulagin and S.M. Plis for making Debian packages.
+ColumnPlot() indexing is reverted.
@item
-I'm thankful to M. Vidassov for the help in handling solid UTF-8 fonts.
+Move most of arguments of plotting functions into the string parameter and/or options.
@item
-I'm thankful to N. Troickiy and V. Lipatov for making RPM packages.
+``Bright'' colors (like @{b8@}) can be used in color schemes and line styles.
@item
-I'm thankful to S. Skobelev, A. Korotkevich, V. Onuchin, S.M. Plis, R. Kiselev, A. Ivanov, M. Vidiassov and V. Lipatov for fruitful comments.
+Intensively use pthread internally for parallelization of drawing and data processing.
+@item
+Add tick labels rotation and skipping. Add ticks in time/date format.
+@item
+New kinds of plots (Tape(), Label(), Cones(), ContV()). Extend existing plots. New primitives (Circle(), Ellipse(), Rhomb(), ...). New plot positioning (MultiPlot(), GridPlot())
+@item
+Improve MGL scripts. Add 'ask' command and allow string concatenation from different lines.
+@item
+Export to LaTeX and to 3D formats (OBJ, OFF, STL, X3D).
+@item
+Add pipes support in utilities (@code{mglconv, mglview}).
+@end itemize
+
+@c ------------------------------------------------------------------
+@node Utilities, , Changes from v.1, Overview
+@section Utilities for parsing MGL
+
+MathGL library provides several tools for parsing MGL scripts. There is tools saving it to bitmap or vectorial images (@code{mglconv}). Tool @code{mglview} show MGL script and allow to rotate and setup the image. Another feature of @code{mglview} is loading *.mgld files (see @code{ExportMGLD()}) for quick viewing 3d pictures.
+
+Both tools have similar set of arguments. They can be name of script file or options. You can use @samp{-} as script name for using standard input (i.e. pipes). Options are:
+@itemize
+@item @strong{-1} @var{str}
+set @var{str} as argument $1 for script;
+@item ...
+...
+@item @strong{-9} @var{str}
+set @var{str} as argument $9 for script;
+@item @strong{-A} @var{val}
+add @var{val} into the list of animation parameters;
+@item @strong{-C} @var{v1}:@var{v2}[:@var{dv}]
+add values from @var{v1} ot @var{v2} with step @var{dv} (default is 1) into the list of animation parameters;
+@item @strong{-L} @var{loc}
+set locale to @var{loc};
+@item @strong{-o} @var{name}
+set output file name;
+@item @strong{-h}
+print help message.
@end itemize
+
+Additionally you can create animated GIF file or a set of JPEG files with names @samp{frameNNNN.jpg} (here @samp{NNNN} is frame index). Values of the parameter @code{$0} for making animation 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{-A val}. Also you can specify a cycle for animation by comment @code{##c v1 v2 dv} or by option @code{-C v1:v2:dv}. In the case of found/specified animation parameters, tool will execute script several times -- once for each value of @code{$0}.
+
@c ------------------------------------------------------------------
@chapter MGL scripts
-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.
+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
+@ifclear UDAV
+, @pxref{Utilities}) or in the frame of the library using.
+@end ifclear
@ifclear UDAV
@menu
+++ /dev/null
-@c ------------------------------------------------------------------
-@chapter Samples
-This chapter contain a lot of sample codes for all types of plots and for most important examples and hints. The same sample (with pictures) you can find at @uref{http://mathgl.sf.net/pictures.html}.
-@ifclear UDAV
-Most of examples have the sample code on 5 languages: C++, MGL, C, Fortran and Python. However, I put only C++ code for some of examples due to a lot of them and clearency how to write code for other languages. All samples are divided on 6 large categories.
-The minimal code to view the samples for different languages are following.
-@strong{C++/Python code}
-For compilation use: @code{g++ -o sample sample.cpp -lmgl}.
-@verbatim
-#include <mgl/mgl_zb.h>
-int main()
-{
- mglGraph gr;
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // put sample code here
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- gr.ShowImage(); return 0;
-}
-@end verbatim
-@strong{MGL code}
-For preview use: @code{mglview sample.mgl}.
-@verbatim
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# put sample code here
-# --> you may use sample as is :)
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@end verbatim
-@strong{C/Fortran code}
-For compilation use: @code{gcc -o sample sample.c -lmgl}.
-@verbatim
-#include <mgl/mgl_c.h>
-int main()
-{
- HMGL gr = mgl_create_graph_zb(600,400);
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- /* put sample code here */
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- mgl_show_image(gr,"",0);
- mgl_delete_graph(gr);
- return 0;
-}
-@end verbatim
-@strong{Fortran code}
-For compilation use: @code{gfortran -o sample sample.f90 -lmgl}. Note, fortran don't have argument checking. So you have to take special attention to pass real variables to real arguments of functions and integer variables to integer arguments of functions. There is no other special checking for that!!! Note you should use @code{integer} variables for any pointers (to data, to grapher, to parser and so on). Sometimes you may need to add @code{call} keyword before function calls.
-@verbatim
-integer gr, mgl_create_graph_zb
-gr = mgl_create_graph_zb(600,400)
-!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-! put sample code here
-!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-call mgl_show_image(gr,'',0)
-call mgl_delete_graph(gr)
-end
-@end verbatim
-@strong{Python}
-For preview use: @code{python sample.py}.
-@verbatim
-from mathgl import *
-gr = mglGraph();
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# put sample code here
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-gr.ShowImage();
-@end verbatim
-@end ifclear
-@menu
-* 1D plotting samples::
-* 2D plotting samples::
-* 3D plotting samples::
-* Dual plotting samples::
-* Basic features::
-* Additional features::
-* Advanced features::
-@end menu
-@c ------------------------------------------------------------------
-@node 1D plotting samples, 2D plotting samples, , Samples
-@section 1D plotting samples
-@menu
-* Plot sample::
-* Radar sample::
-* Tens sample::
-* Area sample::
-* Bars sample::
-* Barh sample::
-* Step sample::
-* Stem sample::
-* Region sample::
-* Error sample::
-* BoxPlot sample::
-* Mark sample::
-* TextMark sample::
-* Tube sample::
-* Text sample::
-* Torus sample::
-* Chart sample::
-@end menu
-@c ------------------------------------------------------------------
-@node Plot sample, Radar sample, , 1D plotting samples
-@subsection Plot sample
-@cindex Plot
-@float
-@image{../png/plot, 7cm}
-@c @caption{Example of Plot. @tdref{plot}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.Box();
-gr.Plot(y);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-box
-plot y
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_box(gr,1);
-mgl_plot(gr,y,"");
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Radar sample, Tens sample, Plot sample, 1D plotting samples
-@subsection Radar sample
-@cindex Radar
-@float
-@image{../png/radar, 7cm}
-@c @caption{Example of Plot. @tdref{radar}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(10,3);
-y.Modify("0.4*sin(pi*(2*x+y/2))+0.1*rnd");
-gr.Radar(y,"#");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 10 3
-modify y '0.4*sin(pi*(2*x+y/2))+0.1*rnd'
-radar y '#'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(10,3,1);
-mgl_data_modify(y,"0.4*sin(pi*(2*x+y/2))+0.1*rnd",0);
-mgl_radar(gr,y,"#",-1);
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Tens sample, Area sample, Radar sample, 1D plotting samples
-@subsection Tens sample
-@cindex Tens
-@float
-@image{../png/tens, 7cm}
-@c @caption{Example of Plot. @tdref{plot}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.Box();
-gr.Tens(y.SubData(-1,0), y.SubData(-1,1));
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-box
-tens y(:.0) y(:,1)
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_box(gr,1);
-mgl_plot(gr,y,"");
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Area sample, Bars sample, Tens sample, 1D plotting samples
-@subsection Area sample
-@cindex Area
-@float
-@image{../png/area, 7cm}
-@c @caption{Example of Area. @tdref{area}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.Org=mglPoint(0,0);
-gr.Box();
-gr.Area(y);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-origin 0 0
-box
-area y
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_area(gr,y,"");
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Bars sample, Barh sample, Area sample, 1D plotting samples
-@subsection Bars sample
-@cindex Bars
-@float
-@image{../png/bars, 7cm}
-@c @caption{Example of Bars. @tdref{bars}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr.Org=mglPoint(0,0);
-gr.Box();
-gr.Bars(y);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 10 3
-modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd'
-origin 0 0
-box
-bars y
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(10,3,1);
-mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_bars(gr,y,"");
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-
-@c ------------------------------------------------------------------
-@node Barh sample, Step sample, Bars sample, 1D plotting samples
-@subsection Barh sample
-@cindex Barh
-@float
-@image{../png/barh, 7cm}
-@c @caption{Example of Barh. @tdref{barh}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr.Org=mglPoint(0,0);
-gr.Box();
-gr.Barh(y);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 10 3
-modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd'
-origin 0 0
-box
-barh y
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(10,3,1);
-mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_barh(gr,y,"");
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Step sample, Stem sample, Barh sample, 1D plotting samples
-@subsection Step sample
-@cindex Step
-@float
-@image{../png/step, 7cm}
-@c @caption{Example of Step. @tdref{step}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.Box();
-gr.Step(y);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-box
-step y
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_box(gr,1);
-mgl_step(gr,y,"");
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Stem sample, Region sample, Step sample, 1D plotting samples
-@subsection Stem sample
-@cindex Stem
-@float
-@image{../png/stem, 7cm}
-@c @caption{Example of Stem. @tdref{stem}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.Org=mglPoint(0,0);
-gr.Box();
-gr.Stem(y,"o");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-origin 0 0
-box
-stem y 'o'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_stem(gr,y,"o");
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Region sample, Error sample, Stem sample, 1D plotting samples
-@subsection Region sample
-@cindex Region
-@float
-@image{../png/region, 7cm}
-@c @caption{Example of Region. @tdref{region}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y1(50), y2(50);
-y1.Modify("0.3*sin(2*pi*x)");
-y2.Modify("0.5+0.3*cos(2*pi*x)");
-gr.Box();
-gr.Region(y1,y2,"r");
-gr.Plot(y1,"k2");
-gr.Plot(y2,"k2");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y1 50
-new y2 50
-modify y1 '0.3*sin(2*pi*x)'
-modify y2 '0.5+0.3*cos(2*pi*x)'
-box
-region y1 y2 'r'
-plot y1 'k2'
-plot y2 'k2'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y1 = mgl_create_data_size(50,1,1);
-HMDT y2 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y1,"0.3*sin(2*pi*x)",0);
-mgl_data_modify(y2,"0.5+0.3*cos(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_region(gr,y1,y2,"r",1);
-mgl_plot(gr,y1,"k2");
-mgl_plot(gr,y2,"k2");
-mgl_delete_data(y1);
-mgl_delete_data(y2);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Error sample, BoxPlot sample, Region sample, 1D plotting samples
-@subsection Error sample
-@cindex Error
-@float
-@image{../png/error, 7cm}
-@c @caption{Example of Error. @tdref{error}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,1), x0(10), y0(10), ex(10), ey(10);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-x0.Modify("2*x-1 + 0.1*rnd-0.05");
-y0.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x) + 0.2*rnd-0.1");
-ey.Modify("0.2"); ex.Modify("0.1");
-gr.Box();
-gr.Plot(y);
-gr.Error(x0,y0,ex,ey,"ko");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50
-new x0 10
-new y0 10
-new ex 10
-new ey 10
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify x0 '2*x-1 + 0.1*rnd-0.05'
-modify y0 '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x) + 0.2*rnd-0.1'
-modify ey '0.2'
-modify ex '0.1'
-box
-plot y
-error x0 y0 ex ey 'ko'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,1,1);
-HMDT x0 = mgl_create_data_size(10,1,1);
-HMDT y0 = mgl_create_data_size(10,1,1);
-HMDT ex = mgl_create_data_size(10,1,1);
-HMDT ey = mgl_create_data_size(10,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(x0,"2*x-1 + 0.1*rnd-0.05",0);
-mgl_data_modify(y0,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x) + 0.2*rnd-0.1",0);
-mgl_data_modify(ey,"0.2",0); mgl_data_modify(ex,"0.1",0);
-mgl_box(gr,1);
-mgl_plot(gr,y,"");
-mgl_error_exy(gr,x0,y0,ex,ey,"ko");
-mgl_delete_data(x0); mgl_delete_data(y0);
-mgl_delete_data(ex); mgl_delete_data(ey);
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node BoxPlot sample, Mark sample, Error sample, 1D plotting samples
-@subsection BoxPlot sample
-@cindex BoxPlot
-@float
-@image{../png/boxplot, 7cm}
-@c @caption{Example of BoxPlot. @tdref{boxplot}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(10,7);
-a.Modify("(2*rnd-1)^3/2");
-gr.BoxPlot(a);
-gr.Box();
-gr.Plot(a," ko");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 10 7
-modify a '(2*rnd-1)^3/2'
-boxplot a
-box:plot a ' ko'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(10,7,1);
-mgl_data_modify(a,"(2*rnd-1)^3/2",0);
-mgl_box(gr,1);
-mgl_plot(gr,a," ko");
-mgl_boxplot(gr,a,"");
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Mark sample, TextMark sample, BoxPlot sample, 1D plotting samples
-@subsection Mark sample
-@cindex Mark
-@float
-@image{../png/mark, 7cm}
-@c @caption{Example of Mark. @tdref{mark}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3), y1(50);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-gr.Box();
-gr.Mark(y,y1,"bs");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-new y1 50
-modify y1 '0.5+0.3*cos(2*pi*x)'
-box
-mark y y1 'bs'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-HMDT y1 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_mark_y(gr,y,y1,"bs");
-mgl_delete_data(y);
-mgl_delete_data(y1);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node TextMark sample, Tube sample, Mark sample, 1D plotting samples
-@subsection TextMark sample
-@cindex TextMark
-@float
-@image{../png/textmark, 7cm}
-@c @caption{Example of TextMark. @tdref{textmark}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3), y1(50);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-gr.Box();
-gr.TextMark(y,y1,"\\gamma");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-new y1 50
-modify y1 '0.5+0.3*cos(2*pi*x)'
-box
-textmark y y1 '\gamma'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y, y1;
-y = mgl_create_data_size(50,3,1);
-y1 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_textmark_yr(gr,y,y1,"\\gamma","");
-mgl_delete_data(y);
-mgl_delete_data(y1);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Tube sample, Text sample, TextMark sample, 1D plotting samples
-@subsection Tube sample
-@cindex Tube
-@float
-@image{../png/tube, 7cm}
-@c @caption{Example of Tube. @tdref{tube}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Box();
-gr.Tube(y,0.05);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-rotate 40 60
-light on
-box
-tube y 0.05
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_tube(gr,y,0.05,"");
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Text sample, Torus sample, Tube sample, 1D plotting samples
-@subsection Text sample
-@cindex Text
-@float
-@image{../png/text, 7cm}
-@c @caption{Example of Text. @tdref{text}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.Box();
-gr.Plot(y.SubData(-1,0));
-gr.Text(y,"This is very long string drawn along a curve",":k");
-gr.Text(y,"Another string drawn above a curve","T:r");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-box
-plot y(:,0)
-text y 'This is very long string drawn along a curve' ':k'
-text y 'Another string drawn above a curve' 'T:r'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_box(gr,1);
-mgl_plot(gr,y,"");
-mgl_text_y(gr,y,"This is very long string drawn along a curve",":k",-1.);
-mgl_text_y(gr,y,"Another string drawn above a curve","T:r",-1.);
-mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Torus sample, Chart sample, Text sample, 1D plotting samples
-@subsection Torus sample
-@cindex Torus
-@float
-@image{../png/torus, 7cm}
-@c @caption{Example of Torus. @tdref{torus}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y1(50), y2(50);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-y2.Modify("0.3*sin(2*pi*x)");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Box();
-gr.Torus(y1,y2,"pz");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y1 50
-new y2 50
-modify y1 '0.5+0.3*cos(2*pi*x)'
-modify y2 '0.3*sin(2*pi*x)'
-rotate 40 60
-light on
-box
-torus y1 y2 'pz'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y1 = mgl_create_data_size(50,1,1);
-HMDT y2 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0);
-mgl_data_modify(y2,"0.3*sin(2*pi*x)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_torus(gr,y1,y2,"pz");
-mgl_delete_data(y1);
-mgl_delete_data(y2);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Chart sample, , Torus sample, 1D plotting samples
-@subsection Chart sample
-@cindex Chart
-@float
-@image{../png/chart, 7cm}
-@c @caption{Example of Chart. @tdref{chart}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData ch(7,2);
-ch.Modify("rnd+0.1");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Box();
-gr.Chart(ch,"#");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new ch 7 2
-modify ch 'rnd+0.1'
-rotate 40 60
-light on
-box
-chart ch
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT ch = mgl_create_data_size(7,2,1);
-mgl_data_modify(ch,"rnd+0.1",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_chart(gr,ch,"#");
-mgl_delete_data(ch);
-@end verbatim
-@end ifclear
-
-@c ------------------------------------------------------------------
-@node 2D plotting samples, 3D plotting samples, 1D plotting samples, Samples
-@section 2D plotting samples
-@menu
-* Surf sample::
-* Mesh sample::
-* Fall sample::
-* Belt sample::
-* Tile sample::
-* Boxs sample::
-* Dens sample::
-* Cont sample::
-* ContF sample::
-* ContD sample::
-* ContV sample::
-* Axial sample::
-* Grad sample::
-@end menu
-@c ------------------------------------------------------------------
-@node Surf sample, Mesh sample, , 2D plotting samples
-@subsection Surf sample
-@cindex Surf
-@float
-@image{../png/surf, 7cm}
-@c @caption{Example of Surf. @tdref{surf}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Box();
-gr.Surf(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-surf a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Mesh sample, Fall sample, Surf sample, 2D plotting samples
-@subsection Mesh sample
-@cindex Mesh
-@float
-@image{../png/mesh, 7cm}
-@c @caption{Example of Mesh. @tdref{mesh}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Box();
-gr.Mesh(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-box
-mesh a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_mesh(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Fall sample, Belt sample, Mesh sample, 2D plotting samples
-@subsection Fall sample
-@cindex Fall
-@float
-@image{../png/fall, 7cm}
-@c @caption{Example of Fall. @tdref{fall}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Box();
-gr.Fall(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-box
-fall a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_fall(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Belt sample, Tile sample, Fall sample, 2D plotting samples
-@subsection Belt sample
-@cindex Belt
-@float
-@image{../png/belt, 7cm}
-@c @caption{Example of Belt. @tdref{belt}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Box();
-gr.Belt(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-belt a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_belt(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Tile sample, Boxs sample, Belt sample, 2D plotting samples
-@subsection Tile sample
-@cindex Tile
-@float
-@image{../png/tile, 7cm}
-@c @caption{Example of Tile. @tdref{tile}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Box();
-gr.Tile(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-tile a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_tile(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Boxs sample, Dens sample, Tile sample, 2D plotting samples
-@subsection Boxs sample
-@cindex Boxs
-@float
-@image{../png/boxs, 7cm}
-@c @caption{Example of Boxs. @tdref{boxs}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(true);
-gr.Org = mglPoint(0,0,0);
-gr.Box();
-gr.Boxs(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-origin 0 0 0
-box
-boxs a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_boxs(gr,a,0,0.);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dens sample, Cont sample, Boxs sample, 2D plotting samples
-@subsection Dens sample
-@cindex Dens
-@cindex Colorbar
-@float
-@image{../png/dens, 7cm}
-@c @caption{Example of Dens & Colorbar. @tdref{dens}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.Dens(a);
-gr.Colorbar();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-dens a
-colorbar
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_dens(gr,a,0,0);
-mgl_colorbar(gr,"",0);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cont sample, ContF sample, Dens sample, 2D plotting samples
-@subsection Cont sample
-@cindex Cont
-@float
-@image{../png/cont, 7cm}
-@c @caption{Example of Cont. @tdref{cont}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Box();
-gr.Cont(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-box
-cont a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_cont(gr,a,0,7,NAN);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node ContF sample, ContD sample, Cont sample, 2D plotting samples
-@subsection ContF sample
-@cindex ContF
-@float
-@image{../png/contf, 7cm}
-@c @caption{Example of ContF. @tdref{contf}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(true);
-gr.Box();
-gr.ContF(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-contf a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_contf(gr,a,0,7,NAN);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node ContD sample, ContV sample, ContF sample, 2D plotting samples
-@subsection ContD sample
-@cindex ContD
-@float
-@image{../png/contd, 7cm}
-@c @caption{Example of ContD. @tdref{contd}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40), v(9);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-v.Fill(-1,1);
-gr.Box();
-gr.ContD(v,a);
-gr.Colorbar(v);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-var v 9 -1 1
-box
-contd v a
-colorbar v
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-HMDT v = mgl_create_data_size(9,1,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_fill(v,-1.,1.,'x');
-mgl_box(gr,1);
-mgl_contd_val(gr,v,a,0,0);
-mgl_colorbar_val(gr,v,"",0);
-mgl_delete_data(a);
-mgl_delete_data(v);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node ContV sample, Axial sample, ContD sample, 2D plotting samples
-@subsection ContV sample
-@cindex Cont
-@float
-@image{../png/contv, 7cm}
-@c @caption{Example of Cont. @tdref{cont}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Box();
-gr.ContV(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-box
-contv a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_contv(gr,a,0,7,NAN);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Axial sample, Grad sample, ContD sample, 2D plotting samples
-@subsection Axial sample
-@cindex Axial
-@float
-@image{../png/axial, 7cm}
-@c @caption{Example of Axial. @tdref{axial}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Alpha(true);
-gr.Box();
-gr.Axial(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-alpha on
-box
-axial a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_axial(gr,a,"",3);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Grad sample, , Axial sample, 2D plotting samples
-@subsection Grad sample
-@cindex Grad
-@float
-@image{../png/grad, 7cm}
-@c @caption{Example of Grad. @tdref{grad}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Box(); gr.Alpha(true); gr.Dens(a);
-gr.Grad(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box:alpha on:dens a
-grad a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_set_alpha(gr,1);
-mgl_dens(gr,a,0,0);
-mgl_grad(gr,a,0,0);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node 3D plotting samples, Dual plotting samples, 2D plotting samples, Samples
-@section 3D plotting samples
-@menu
-* Surf3 sample::
-* Cloud sample::
-* Dens3 sample::
-* Cont3 sample::
-* ContF3 sample::
-* Cont projection sample::
-* Dens projection sample::
-@end menu
-@c ------------------------------------------------------------------
-@node Surf3 sample, Cloud sample, , 3D plotting samples
-@subsection Surf3 sample
-@cindex Surf3
-@float
-@image{../png/surf3, 7cm}
-@c @caption{Example of Surf3. @tdref{surf3}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Alpha(true);
-gr.Box();
-gr.Surf3(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-light on
-alpha on
-box
-surf3 a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_surf3(gr,a,0,3);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cloud sample, Dens3 sample, Surf3 sample, 3D plotting samples
-@subsection Cloud sample
-@cindex Cloud
-@float
-@image{../png/cloud, 7cm}
-@c @caption{Example of Cloud. @tdref{cloud}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60);
-gr.Alpha(true);
-gr.Box();
-gr.Cloud(a,"wyrRk");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-alpha on
-box
-cloud a 'wyrRk'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_cloud(gr,a,"wyrRk",1.);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dens3 sample, Cont3 sample, Cloud sample, 3D plotting samples
-@subsection Dens3 sample
-@cindex Dens3
-@cindex Axis
-@float
-@image{../png/densa, 7cm}
-@c @caption{Example of Dens3. @tdref{densa}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Alpha(true); gr.Org = mglPoint(0,0,0);
-gr.Box();
-gr.DensA(a);
-gr.Axis();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-alpha on
-origin 0 0 0
-box
-densa a
-axis
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_alpha(gr,1);
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_dens3_all(gr,a,0);
-mgl_axis(gr,"xyz");
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cont3 sample, ContF3 sample, Dens3 sample, 3D plotting samples
-@subsection Cont3 sample
-@cindex Cont3
-@float
-@image{../png/conta, 7cm}
-@c @caption{Example of Cont3. @tdref{conta}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60);
-gr.Box();
-gr.ContA(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-box
-conta a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_cont_all(gr,a,0,7);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node ContF3 sample, Cont projection sample, Cont3 sample, 3D plotting samples
-@subsection ContF3 sample
-@cindex ContF3
-@float
-@image{../png/contfa, 7cm}
-@c @caption{Example of ContF3. @tdref{contfa}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Light(true);
-gr.Box();
-gr.ContFA(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-light on
-box
-contfa a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_contf_all(gr,a,0,7);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cont projection sample, Dens projection sample, ContF3 sample, 3D plotting samples
-@subsection Cont projection sample
-@cindex ContX
-@cindex ContY
-@cindex ContZ
-@float
-@image{../png/cont_xyz, 7cm}
-@c @caption{Example of projection by Cont[XYZ]. @tdref{cont_xyz}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60);
-gr.Box();
-gr.ContX(a.Sum("x"),"",-1);
-gr.ContY(a.Sum("y"),"",1);
-gr.ContZ(a.Sum("z"),"",-1);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-box
-sum s a 'x'
-contx s '' -1
-sum s a 'y'
-conty s '' 1
-sum s a 'z'
-contz s '' -1
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40), s;
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-s=mgl_data_sum(a,"x"); mgl_cont_x(gr,s,0,-1.,7); mgl_delete_data(s);
-s=mgl_data_sum(a,"y"); mgl_cont_y(gr,s,0,1.,7); mgl_delete_data(s);
-s=mgl_data_sum(a,"z"); mgl_cont_z(gr,s,0,-1.,7); mgl_delete_data(s);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dens projection sample, , Cont projection sample, 3D plotting samples
-@subsection Dens projection sample
-@cindex DensX
-@cindex DensY
-@cindex DensZ
-@float
-@image{../png/dens_xyz, 7cm}
-@c @caption{Example of projection by Dens[XYZ]. @tdref{dens_xyz}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60);
-gr.Box();
-gr.DensX(a.Sum("x"),"",-1);
-gr.DensY(a.Sum("y"),"",1);
-gr.DensZ(a.Sum("z"),"",-1);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-box
-sum s a 'x'
-densx s '' -1
-sum s a 'y'
-densy s '' 1
-sum s a 'z'
-densz s '' -1
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a, s; a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-s=mgl_data_sum(a,"x"); mgl_dens_x(gr,s,0,-1.); mgl_delete_data(s);
-s=mgl_data_sum(a,"y"); mgl_dens_y(gr,s,0,1.); mgl_delete_data(s);
-s=mgl_data_sum(a,"z"); mgl_dens_z(gr,s,0,-1.); mgl_delete_data(s);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-
-
-@c ------------------------------------------------------------------
-@node Dual plotting samples, Basic features, 3D plotting samples, Samples
-@section Dual plotting samples
-@menu
-* SurfC sample::
-* SurfA sample::
-* TileS sample::
-* Map sample::
-* Traj sample::
-* Vect sample::
-* Flow sample::
-* Pipe sample::
-* Dew sample::
-* Surf3C sample::
-* Surf3A sample::
-@end menu
-@c ------------------------------------------------------------------
-@node SurfC sample, SurfA sample, , Dual plotting samples
-@subsection SurfC sample
-@cindex SurfC
-@float
-@image{../png/surfc, 7cm}
-@c @caption{Example of SurfC. @tdref{surfc}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40), b(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Box();
-gr.SurfC(a,b);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-surfc a b
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-HMDT b = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_surfc(gr,a,b,0);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node SurfA sample, TileS sample, SurfC sample, Dual plotting samples
-@subsection SurfA sample
-@cindex SurfA
-@float
-@image{../png/surfa, 7cm}
-@c @caption{Example of SurfA. @tdref{surfa}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40), b(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Alpha(true);
-gr.Box();
-gr.SurfA(a,b);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-alpha on
-box
-surfa a b
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a, b;
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_surfa(gr,a,b,0);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node TileS sample, Map sample, SurfA sample, Dual plotting samples
-@subsection TileS sample
-@cindex TileS
-@float
-@image{../png/tiles, 7cm}
-@c @caption{Example of TileS. @tdref{tiles}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40), b(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.TileS(a,b);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-tile a b
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a, b;
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_tiles(gr,a,b,0);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Map sample, Traj sample, TileS sample, Dual plotting samples
-@subsection Map sample
-@cindex Map
-@float
-@image{../png/map, 7cm}
-@c @caption{Example of Map. @tdref{map}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50, 40), b(50, 40);
-gr.Puts(mglPoint(0, 0), "\\to", "", -1.4);
-gr.Axis(mglPoint(-1,-1,-2),mglPoint(1,1,2));
-gr.SubPlot(2, 1, 0);
-a.Fill("x", gr.Min, gr.Max); b.Fill("y", gr.Min, gr.Max);
-gr.Puts(mglPoint(0, 1.1), "\\{x, y\\}", "C", -2); gr.Box();
-gr.Map(a, b, "brgk", 0, false);
-gr.SubPlot(2, 1, 1);
-a.Fill("(x^3+y^3)/2", gr.Min, gr.Max);
-b.Fill("(x-y)/2", gr.Min, gr.Max);
-gr.Puts(mglPoint(0, 1.1), "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2);
-gr.Box();
-gr.Map(a, b, "brgk", 0, false);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-text 0 0 '\to'
-zrange -2 2
-subplot 2 1 0
-text 0 1.1 '\{x, y\}' '' -2
-box
-fill a 'x'
-fill b 'y'
-map a b 'brgk' 0 0
-subplot 2 1 1
-text 0 1.1 '\{\frac{x^3+y^3}{2}, \frac{x-y}{2}\}' '' -2
-box
-fill a '(x^3+y^3)/2'
-fill b '(x-y)/2'
-map a b 'brgk' 0 0
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-HMDT b = mgl_create_data_size(50,40,1);
-mgl_puts_ext(gr, 0.,0.,0., "\\to", "", -1.4, 't');
-mgl_set_axis_3d(gr,-1.,-1.,-2.,1.,1.,2.);
-mgl_subplot(gr, 2, 1, 0);
-mgl_data_fill_eq(gr, a, "x", 0, 0);
-mgl_data_fill_eq(gr, b, "y", 0, 0);
-mgl_puts_ext(gr, 0.,1.1,0., "\\{x, y\\}", "C", -2., 't');
-mgl_box(gr,1);
-mgl_map(gr, a, b, "brgk", 0, 0);
-mgl_subplot(gr, 2, 1, 1);
-mgl_data_fill_eq(gr, a, "(x^3+y^3)/2", 0, 0);
-mgl_data_fill_eq(gr, b, "(x-y)/2", 0, 0);
-mgl_puts_ext(gr, 0.,1.1,0., "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2., 't');
-mgl_box(gr,1);
-mgl_map(gr, a, b, "brgk", 0, 0);
-mgl_box(gr,1);
-mgl_map(gr,a,b,0,0,1);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Traj sample, Vect sample, Map sample, Dual plotting samples
-@subsection Traj sample
-@cindex Traj
-@float
-@image{../png/traj, 7cm}
-@c @caption{Example of Plot. @tdref{traj}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y(50,3), x(50), y1(50), y2(50);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-y2.Modify("0.3*sin(2*pi*x)");
-x.Fill(-1,1,'x');
-gr.Box();
-gr.Plot(x,y);
-gr.Traj(x,y,y1,y2);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y 50 3
-new x 50
-new y1 50
-new y2 50
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-fill x -1 1
-modify y1 '0.5+0.3*cos(2*pi*x)'
-modify y2 '0.3*sin(2*pi*x)'
-box
-plot x y
-traj x y y1 y2
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-HMDT x= mgl_create_data_size(50,1,1);
-HMDT y1 = mgl_create_data_size(50,1,1);
-HMDT y2 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_data_modify(x,"2*x-1",0);
-mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0);
-mgl_data_modify(y2,"0.3*sin(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_plot_xy(gr,x,y,"");
-mgl_traj_xy(gr,yx,y,y1,y2,"",0,0);
-mgl_delete_data(y); mgl_delete_data(y1);
-mgl_delete_data(x); mgl_delete_data(y2);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Vect sample, Flow sample, Traj sample, Dual plotting samples
-@subsection Vect sample
-@cindex Vect
-@float
-@image{../png/vect, 7cm}
-@c @caption{Example of Vect. @tdref{vect}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.Vect(a,b);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-vect a b
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(20,30,1);
-HMDT b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_vect_2d(gr,a,b,0,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Flow sample, Pipe sample, Vect sample, Dual plotting samples
-@subsection Flow sample
-@cindex Flow
-@float
-@image{../png/flow, 7cm}
-@c @caption{Example of Flow. @tdref{flow}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.Flow(a,b);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-flow a b
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(20,30,1);
-HMDT b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_flow_2d(gr,a,b,0,5,1,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Pipe sample, Dew sample, Flow sample, Dual plotting samples
-@subsection Pipe sample
-@cindex Pipe
-@float
-@image{../png/pipe, 7cm}
-@c @caption{Example of Pipe. @tdref{pipe}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Light(true);
-gr.Box();
-gr.Pipe(a,b);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-light on
-box
-pipe a b
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(20,30,1);
-HMDT b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_pipe_2d(gr,a,b,0,0.05,5,1,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dew sample, Surf3C sample, Pipe sample, Dual plotting samples
-@subsection Dew sample
-@cindex Dew
-@float
-@image{../png/dew, 7cm}
-@c @caption{Example of Dew. @tdref{dew}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.Light(true);
-gr.Dew(a,b);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-light on
-dew a b
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(20,30,1);
-HMDT b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_set_light(gr,1);
-mgl_dew_2d(gr,a,b,0,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Surf3C sample, Surf3A sample, Dew sample, Dual plotting samples
-@subsection Surf3C sample
-@cindex Surf3C
-@float
-@image{../png/surf3c, 7cm}
-@c @caption{Example of Surf3C. @tdref{surf3c}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(60,50,40), b(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-b.Modify("1-2*tanh(4*(x+y-1)^2)");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Alpha(true);
-gr.Box();
-gr.Surf3C(a, b);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 60 50 40
-new b 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-modify b '1-2*tanh(4*(x+y-1)^2)'
-rotate 40 60
-light on
-alpha on
-box
-surf3c a b
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-HMDT b = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_data_modify(b,"1-2*tanh(4*(x+y-1)^2)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_surf3c(gr,a,b,0,3);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Surf3A sample, , Surf3C sample, Dual plotting samples
-@subsection Surf3A sample
-@cindex Surf3A
-@float
-@image{../png/surf3a, 7cm}
-@c @caption{Example of Surf3A. @tdref{surf3a}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(60,50,40), b(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-b.Modify("1-2*tanh(4*(x+y-1)^2)");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Alpha(true);
-gr.Box();
-gr.Surf3A(a, b);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 60 50 40
-new b 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-modify b '1-2*tanh(4*(x+y-1)^2)'
-rotate 40 60
-light on
-alpha on
-box
-surf3a a b
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a, b; a = mgl_create_data_size(60,50,40);
-b = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_data_modify(b,"1-2*tanh(4*(x+y-1)^2)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_surf3a(gr,a,b,0,3);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@end ifclear
-
-@c ------------------------------------------------------------------
-@node Basic features, Additional features, Dual plotting samples, Samples
-@section Basic features
-@menu
-* 1D plot sample::
-* 2D plot sample::
-* 3D plot sample::
-* Line styles sample::
-* Arrow styles sample::
-* Text styles sample::
-* TeX parsing sample::
-* Font faces sample::
-* Colors sample::
-* Color schemes sample::
-* Normal transparency::
-* Glass-like transparency::
-* Lamp-like transparency::
-@end menu
-@c ------------------------------------------------------------------
-@node 1D plot sample, 2D plot sample, , Basic features
-@subsection 1D plot sample
-@cindex Plot
-@cindex Bars
-@cindex SubPlot
-@float
-@image{../png/sample8, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y0(50); y0.Modify("sin(pi*(2*x-1))");
-gr.SubPlot(2,2,0);
-gr.Plot(y0); gr.Box();
-
-gr.SubPlot(2,2,1);
-mglData y1(50,2);
-y1.Modify("sin(pi*2*x-pi)"); y1.Modify("cos(pi*2*x-pi)/2",1);
-gr.Plot(y1); gr.Box();
-
-mglData x(50); x.Modify("cos(pi*2*x-pi)");
-gr.Plot(x,y0,"Y+");
-
-gr.Plot(y1.SubData(-1,0),y1.SubData(-1,1),"q|");
-
-gr.SubPlot(2,2,2); gr.Rotate(60,40);
-mglData z(50); z.Modify("2*x-1");
-gr.Plot(x,y0,z); gr.Box();
-
-mglData y2(10,3); y2.Modify("cos(pi*(2*x-1-y))");
-y2.Modify("2*x-1",2);
-gr.Plot(y2.SubData(-1,0),y2.SubData(-1,1),y2.SubData(-1,2),"bo ");
-
-gr.SubPlot(2,2,3); gr.Rotate(60,40);
-gr.Bars(x,y0,z,"ri"); gr.Box();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y0 50: modify y0 'sin(pi*(2*x-1))'
-subplot 2 2 0
-plot y0: box
-
-subplot 2 2 1
-new y1 50 2
-modify y1 'sin(pi*2*x-pi)'
-modify y1 'cos(pi*2*x-pi)/2' 1
-plot y1: box
-
-new x 50: modify x 'cos(pi*2*x-pi)'
-plot x y0 'Y+'
-plot y1(:,0) y(:,1) 'q|'
-
-subplot 2 2 2:rotate 60 40
-new z 50: modify z '2*x-1'
-plot x y0 z 'g':box
-new y2 10 3
-modify y2 'cos(pi*(2*x-1-y))'
-modify y2 '2*x-1' 2
-plot y2(:,0) y2(:,1) y2(:,2) 'bo '
-
-subplot 2 2 3:rotate 60 40
-bars x y0 z 'r':box
-@end verbatim
-@c ------------------------------------------------------------------
-@node 2D plot sample, 3D plot sample, 1D plot sample, Basic features
-@subsection 2D plot sample
-@cindex Surf
-@cindex Dens
-@cindex Alpha
-@float
-@image{../png/sample9, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Light(true);
-mglData a0(50,40);
-a0.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.SubPlot(2,2,0); gr.Rotate(60,40);
-gr.Surf(a0); gr.Box();
-
-mglData x(50,40),y(50,40),z(50,40);
-x.Modify("0.8*sin(2*pi*x)*sin(pi*y)");
-y.Modify("0.8*cos(2*pi*x)*sin(pi*y)");
-z.Modify("0.8*cos(pi*y)");
-gr.SubPlot(2,2,1); gr.Rotate(60,40);
-gr.Surf(x,y,z,"BbwrR"); gr.Box();
-
-mglData a1(50,40,3);
-a1.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*sin(3*pi*(x*y))",1);
-a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",2);
-gr.SubPlot(2,2,2); gr.Rotate(60,40);
-gr.Alpha(true);
-gr.Surf(a1); gr.Box();
-
-gr.SubPlot(2,2,3); gr.Rotate(60,40);
-gr.Dens(a1); gr.Box();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-light on
-
-new a0 50 40
-modify a0 '0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))'
-subplot 2 2 0:rotate 60 40
-surf a0: box
-
-new x 50 40: new y 50 40: new z 50 40
-modify x '0.8*sin(2*pi*x)*sin(pi*y)'
-modify y '0.8*cos(2*pi*x)*sin(pi*y)'
-modify z '0.8*cos(pi*y)'
-subplot 2 2 1:rotate 60 40
-surf x y z 'bbwrr': box
-
-new a1 50 40 3
-modify a1 '0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))'
-modify a1 '0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*sin(3*pi*(x*y))' 1
-modify a1 '0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))' 2
-subplot 2 2 2:rotate 60 40
-alpha on
-surf a1: box
-
-subplot 2 2 3: rotate 60 40
-dens a1: box
-@end verbatim
-@c ------------------------------------------------------------------
-@node 3D plot sample, Line styles sample, 2D plot sample, Basic features
-@subsection 3D plot sample
-@cindex Surf
-@cindex Dens
-@cindex Alpha
-@float
-@image{../png/sampleb, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Alpha(true); gr.Light(true); gr.Light(0,mglPoint(0,0,1));
-mglData a(30,30,30), b(30,30,30);
-a.Modify("exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))");
-b.Modify("16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)");
-gr.CAxis(0,1);
-
-gr.SubPlot(2,2,0); gr.Rotate(40,60);
-gr.Surf3(a,"wgk"); gr.Box();
-gr.SubPlot(2,2,1); gr.Rotate(40,60);
-gr.DensA(a); gr.Box(); gr.Axis();
-gr.SubPlot(2,2,2); gr.Rotate(40,60);
-gr.Cloud(a); gr.Box();
-gr.SubPlot(2,2,3); gr.Rotate(40,60);
-gr.Surf3A(b,a,"q"); gr.Box();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-alpha on: light on
-light 0 0 0 1
-new a 30 30 30: new b 30 30 30
-modify a 'exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))'
-modify b '16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)'
-caxis 0 1
-
-subplot 2 2 0: rotate 40 60
-surf3 a 'wgk': box
-subplot 2 2 1: rotate 40 60
-densa a: box: axis
-subplot 2 2 2: rotate 40 60
-cloud a: box
-subplot 2 2 3: rotate 40 60
-surf3a b a 'q': box
-@end verbatim
-@c ------------------------------------------------------------------
-@node Line styles sample, Arrow styles sample, 3D plot sample, Basic features
-@subsection Line styles sample
-@cindex Mark
-@cindex Line
-@float
-@image{../png/sample5, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-float d,x1,x2,x0,y=0.95;
-d=0.3, x0=0.2, x1=0.5, x2=0.6;
-gr.Line(mglPoint(x0,1-0*d),mglPoint(x1,1-0*d),"k-"); gr.Puts(mglPoint(x2,y-0*d),"Solid '-'","rL");
-gr.Line(mglPoint(x0,1-1*d),mglPoint(x1,1-1*d),"k|"); gr.Puts(mglPoint(x2,y-1*d),"Long Dash '|'","rL");
-gr.Line(mglPoint(x0,1-2*d),mglPoint(x1,1-2*d),"k;"); gr.Puts(mglPoint(x2,y-2*d),"Dash ';'","rL");
-gr.Line(mglPoint(x0,1-3*d),mglPoint(x1,1-3*d),"k="); gr.Puts(mglPoint(x2,y-3*d),"Small dash '='","rL");
-gr.Line(mglPoint(x0,1-4*d),mglPoint(x1,1-4*d),"kj"); gr.Puts(mglPoint(x2,y-4*d),"Dash-dot 'j'","rL");
-gr.Line(mglPoint(x0,1-5*d),mglPoint(x1,1-5*d),"ki"); gr.Puts(mglPoint(x2,y-5*d),"Small dash-dot 'i'","rL");
-gr.Line(mglPoint(x0,1-6*d),mglPoint(x1,1-6*d),"k:"); gr.Puts(mglPoint(x2,y-6*d),"Dots ':'","rL");
-gr.Line(mglPoint(x0,1-7*d),mglPoint(x1,1-7*d),"k "); gr.Puts(mglPoint(x2,y-7*d),"None ' '","rL");
-
-d=0.25; x1=-1; x0=-0.8; y = -0.05;
-gr.Mark(mglPoint(x1,5*d),'.'); gr.Puts(mglPoint(x0,y+5*d),"'.'","rL");
-gr.Mark(mglPoint(x1,4*d),'+'); gr.Puts(mglPoint(x0,y+4*d),"'+'","rL");
-gr.Mark(mglPoint(x1,3*d),'x'); gr.Puts(mglPoint(x0,y+3*d),"'x'","rL");
-gr.Mark(mglPoint(x1,2*d),'*'); gr.Puts(mglPoint(x0,y+2*d),"'*'","rL");
-gr.Mark(mglPoint(x1,d),'s'); gr.Puts(mglPoint(x0,y+d),"'s'","rL");
-gr.Mark(mglPoint(x1,0),'d'); gr.Puts(mglPoint(x0,y),"'d'","rL");
-gr.Mark(mglPoint(x1,-d,0),'o'); gr.Puts(mglPoint(x0,y-d),"'o'","rL");
-gr.Mark(mglPoint(x1,-2*d,0),'^'); gr.Puts(mglPoint(x0,y-2*d),"'\\^'","rL");
-gr.Mark(mglPoint(x1,-3*d,0),'v'); gr.Puts(mglPoint(x0,y-3*d),"'v'","rL");
-gr.Mark(mglPoint(x1,-4*d,0),'<'); gr.Puts(mglPoint(x0,y-4*d),"'<'","rL");
-gr.Mark(mglPoint(x1,-5*d,0),'>'); gr.Puts(mglPoint(x0,y-5*d),"'>'","rL");
-
-d=0.25; x1=-0.5; x0=-0.3; y = -0.05;
-gr.Mark(mglPoint(x1,5*d),'C'); gr.Puts(mglPoint(x0,y+5*d),"'\\#.'","rL");
-gr.Mark(mglPoint(x1,4*d),'P'); gr.Puts(mglPoint(x0,y+4*d),"'\\#+'","rL");
-gr.Mark(mglPoint(x1,3*d),'X'); gr.Puts(mglPoint(x0,y+3*d),"'\\#x'","rL");
-gr.Mark(mglPoint(x1,2*d),'Y'); gr.Puts(mglPoint(x0,y+2*d),"'\\#*'","rL");
-gr.Mark(mglPoint(x1,d),'S'); gr.Puts(mglPoint(x0,y+d),"'\\#s'","rL");
-gr.Mark(mglPoint(x1,0),'D'); gr.Puts(mglPoint(x0,y),"'\\#d'","rL");
-gr.Mark(mglPoint(x1,-d,0),'O'); gr.Puts(mglPoint(x0,y-d),"'\\#o'","rL");
-gr.Mark(mglPoint(x1,-2*d,0),'T'); gr.Puts(mglPoint(x0,y-2*d),"'\\#\\^'","rL");
-gr.Mark(mglPoint(x1,-3*d,0),'V'); gr.Puts(mglPoint(x0,y-3*d),"'\\#v'","rL");
-gr.Mark(mglPoint(x1,-4*d,0),'L'); gr.Puts(mglPoint(x0,y-4*d),"'\\#<'","rL");
-gr.Mark(mglPoint(x1,-5*d,0),'R'); gr.Puts(mglPoint(x0,y-5*d),"'\\#>'","rL");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-TO BE DONE
-@end verbatim
-@c ------------------------------------------------------------------
-@node Arrow styles sample, Text styles sample, Line styles sample, Basic features
-@subsection Arrow styles sample
-@cindex Line
-@float
-@image{../png/sampled, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-float a=0.1,b=0.4,c=0.5;
-gr.Line(mglPoint(a,1),mglPoint(b,1),"k-A"); gr.Puts(mglPoint(c,1),"Style 'A' or 'A\\_'","rL");
-gr.Line(mglPoint(a,0.8),mglPoint(b,0.8),"k-V"); gr.Puts(mglPoint(c,0.8),"Style 'V' or 'V\\_'","rL");
-gr.Line(mglPoint(a,0.6),mglPoint(b,0.6),"k-K"); gr.Puts(mglPoint(c,0.6),"Style 'K' or 'K\\_'","rL");
-gr.Line(mglPoint(a,0.4),mglPoint(b,0.4),"k-I"); gr.Puts(mglPoint(c,0.4),"Style 'I' or 'I\\_'","rL");
-gr.Line(mglPoint(a,0.2),mglPoint(b,0.2),"k-D"); gr.Puts(mglPoint(c,0.2),"Style 'D' or 'D\\_'","rL");
-gr.Line(mglPoint(a,0),mglPoint(b,0),"k-S"); gr.Puts(mglPoint(c,0),"Style 'S' or 'S\\_'","rL");
-gr.Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"k-O"); gr.Puts(mglPoint(c,-0.2),"Style 'O' or 'O\\_'","rL");
-gr.Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"k-T"); gr.Puts(mglPoint(c,-0.4),"Style 'T' or 'T\\_'","rL");
-gr.Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-_"); gr.Puts(mglPoint(c,-0.6),"Style '\\_' or none","rL");
-gr.Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-AS"); gr.Puts(mglPoint(c,-0.8),"Style 'AS'","rL");
-gr.Line(mglPoint(a,-1),mglPoint(b,-1),"k-_A"); gr.Puts(mglPoint(c,-1),"Style '\\_A'","rL");
-
-a=-1; b=-0.7; c=-0.6;
-gr.Line(mglPoint(a,1),mglPoint(b,1),"kAA"); gr.Puts(mglPoint(c,1),"Style 'AA'","rL");
-gr.Line(mglPoint(a,0.8),mglPoint(b,0.8),"kVV"); gr.Puts(mglPoint(c,0.8),"Style 'VV'","rL");
-gr.Line(mglPoint(a,0.6),mglPoint(b,0.6),"kKK"); gr.Puts(mglPoint(c,0.6),"Style 'KK'","rL");
-gr.Line(mglPoint(a,0.4),mglPoint(b,0.4),"kII"); gr.Puts(mglPoint(c,0.4),"Style 'II'","rL");
-gr.Line(mglPoint(a,0.2),mglPoint(b,0.2),"kDD"); gr.Puts(mglPoint(c,0.2),"Style 'DD'","rL");
-gr.Line(mglPoint(a,0),mglPoint(b,0),"kSS"); gr.Puts(mglPoint(c,0),"Style 'SS'","rL");
-gr.Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"kOO"); gr.Puts(mglPoint(c,-0.2),"Style 'OO'","rL");
-gr.Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"kTT"); gr.Puts(mglPoint(c,-0.4),"Style 'TT'","rL");
-gr.Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-__"); gr.Puts(mglPoint(c,-0.6),"Style '\\_\\_'","rL");
-gr.Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-VA"); gr.Puts(mglPoint(c,-0.8),"Style 'VA'","rL");
-gr.Line(mglPoint(a,-1),mglPoint(b,-1),"k-AV"); gr.Puts(mglPoint(c,-1),"Style 'AV'","rL");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-TO BE DONE
-@end verbatim
-@c ------------------------------------------------------------------
-@node Text styles sample, TeX parsing sample, Arrow styles sample, Basic features
-@subsection Text styles sample
-@cindex Puts
-@float
-@image{../png/sample4, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Putsw(mglPoint(0,1),L"Text can be in ASCII and in Unicode");
-gr.Puts(mglPoint(0,0.6),"It can be \\wire{wire}, \\big{big} or #r{colored}");
-gr.Puts(mglPoint(0,0.2),"One can change style in string: "
- "\\b{bold}, \\i{italic, \\b{both}}");
-gr.Puts(mglPoint(0,-0.2),"Easy to \\a{overline} or "
- "\\u{underline}");
-gr.Puts(mglPoint(0,-0.6),"Easy to change indexes ^{up} _{down} @{center}");
-gr.Puts(mglPoint(0,-1),"It parse TeX: \\int \\alpha \\cdot "
- "\\sqrt3{sin(\\pi x)^2 + \\gamma_{i_k}} dx");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-text 0 1 'Text can be in ASCII and in Unicode'
-text 0 0.6 'It can be \wire{wire}, \big{big} or #r{colored}'
-text 0 0.2 'One can change style in string: \b{bold}, \i{italic, \b{both}}'
-text 0 -0.2 'Easy to \a{overline} or \u{underline}'
-text 0 -0.6 'Easy to change indexes ^{up} _{down} @{center}'
-text 0 -1 'It parse TeX: \int \alpha \cdot \sqrt3{sin(\pi x)^2 + \gamma_{i_k}} dx'
-@end verbatim
-@c ------------------------------------------------------------------
-@node TeX parsing sample, Font faces sample, Text styles sample, Basic features
-@subsection TeX parsing sample
-@cindex Puts
-@float
-@image{../png/samplee, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Puts(mglPoint(0), "\\sqrt{\\frac{\\alpha^{\\gamma^2}+"
- "\\overset 1{\\big\\infty}}{\\sqrt3{2+b}}}", 0, -4);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-text 0 0 '\sqrt{\frac{\alpha^{\gamma^2}+\overset 1{\big\infty}}{\sqrt3{2+b}}}' '' -4
-@end verbatim
-@c ------------------------------------------------------------------
-@node Font faces sample, Colors sample, TeX parsing sample, Basic features
-@subsection Font faces sample
-@cindex Puts
-@float
-@image{../png/fonts, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-float h=1.1, d=0.25;
-gr.LoadFont("STIX"); gr.Puts(mglPoint(0,h), "default font (STIX)");
-gr.LoadFont("adventor"); gr.Puts(mglPoint(0,h-d), "adventor font");
-gr.LoadFont("bonum"); gr.Puts(mglPoint(0,h-2*d), "bonum font");
-gr.LoadFont("chorus"); gr.Puts(mglPoint(0,h-3*d), "chorus font");
-gr.LoadFont("cursor"); gr.Puts(mglPoint(0,h-4*d), "cursor font");
-gr.LoadFont("heros"); gr.Puts(mglPoint(0,h-5*d), "heros font");
-gr.LoadFont("heroscn"); gr.Puts(mglPoint(0,h-6*d), "heroscn font");
-gr.LoadFont("pagella"); gr.Puts(mglPoint(0,h-7*d), "pagella font");
-gr.LoadFont("schola"); gr.Puts(mglPoint(0,h-8*d), "schola font");
-gr.LoadFont("termes"); gr.Puts(mglPoint(0,h-9*d), "termes font");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@c ------------------------------------------------------------------
-@node Colors sample, Color schemes sample, Font faces sample, Basic features
-@subsection Colors sample
-@float
-@image{../png/colors, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-//#LENUQ
-gr.FaceZ(-1, -1, 0, 0.4, 0.3, "L#"); gr.Puts(mglPoint(-0.8,-0.9), "L", "C:w", -1.4);
-gr.FaceZ(-0.6, -1, 0, 0.4, 0.3, "E#"); gr.Puts(mglPoint(-0.4,-0.9), "E", "C:w", -1.4);
-gr.FaceZ(-0.2, -1, 0, 0.4, 0.3, "N#"); gr.Puts(mglPoint(0, -0.9), "N", "C:w", -1.4);
-gr.FaceZ(0.2, -1, 0, 0.4, 0.3, "U#"); gr.Puts(mglPoint(0.4,-0.9), "U", "C:w", -1.4);
-gr.FaceZ(0.6, -1, 0, 0.4, 0.3, "Q#"); gr.Puts(mglPoint(0.8,-0.9), "Q", "C:w", -1.4);
-//#lenuq
-gr.FaceZ(-1, -0.7, 0, 0.4, 0.3, "l#"); gr.Puts(mglPoint(-0.8,-0.6), "l", "C:k", -1.4);
-gr.FaceZ(-0.6, -0.7, 0, 0.4, 0.3, "e#"); gr.Puts(mglPoint(-0.4,-0.6), "e", "C:k", -1.4);
-gr.FaceZ(-0.2, -0.7, 0, 0.4, 0.3, "n#"); gr.Puts(mglPoint(0, -0.6), "n", "C:k", -1.4);
-gr.FaceZ(0.2, -0.7, 0, 0.4, 0.3, "u#"); gr.Puts(mglPoint(0.4,-0.6), "u", "C:k", -1.4);
-gr.FaceZ(0.6, -0.7, 0, 0.4, 0.3, "q#"); gr.Puts(mglPoint(0.8,-0.6), "q", "C:k", -1.4);
-//#CMYkP
-gr.FaceZ(-1, -0.4, 0, 0.4, 0.3, "C#"); gr.Puts(mglPoint(-0.8,-0.3), "C", "C:w", -1.4);
-gr.FaceZ(-0.6, -0.4, 0, 0.4, 0.3, "M#"); gr.Puts(mglPoint(-0.4,-0.3), "M", "C:w", -1.4);
-gr.FaceZ(-0.2, -0.4, 0, 0.4, 0.3, "Y#"); gr.Puts(mglPoint(0, -0.3), "Y", "C:w", -1.4);
-gr.FaceZ(0.2, -0.4, 0, 0.4, 0.3, "k#"); gr.Puts(mglPoint(0.4,-0.3), "k", "C:w", -1.4);
-gr.FaceZ(0.6, -0.4, 0, 0.4, 0.3, "P#"); gr.Puts(mglPoint(0.8,-0.3), "P", "C:w", -1.4);
-//#cmywp
-gr.FaceZ(-1, -0.1, 0, 0.4, 0.3, "c#"); gr.Puts(mglPoint(-0.8, 0), "c", "C:k", -1.4);
-gr.FaceZ(-0.6, -0.1, 0, 0.4, 0.3, "m#"); gr.Puts(mglPoint(-0.4, 0), "m", "C:k", -1.4);
-gr.FaceZ(-0.2, -0.1, 0, 0.4, 0.3, "y#"); gr.Puts(mglPoint(0, 0), "y", "C:k", -1.4);
-gr.FaceZ(0.2, -0.1, 0, 0.4, 0.3, "w#"); gr.Puts(mglPoint(0.4, 0), "w", "C:k", -1.4);
-gr.FaceZ(0.6, -0.1, 0, 0.4, 0.3, "p#"); gr.Puts(mglPoint(0.8, 0), "p", "C:k", -1.4);
-//#BGRHW
-gr.FaceZ(-1, 0.2, 0, 0.4, 0.3, "B#"); gr.Puts(mglPoint(-0.8, 0.3), "B", "C:w", -1.4);
-gr.FaceZ(-0.6, 0.2, 0, 0.4, 0.3, "G#"); gr.Puts(mglPoint(-0.4, 0.3), "G", "C:w", -1.4);
-gr.FaceZ(-0.2, 0.2, 0, 0.4, 0.3, "R#"); gr.Puts(mglPoint(0, 0.3), "R", "C:w", -1.4);
-gr.FaceZ(0.2, 0.2, 0, 0.4, 0.3, "H#"); gr.Puts(mglPoint(0.4, 0.3), "H", "C:w", -1.4);
-gr.FaceZ(0.6, 0.2, 0, 0.4, 0.3, "W#"); gr.Puts(mglPoint(0.8, 0.3), "W", "C:w", -1.4);
-//#bgrhw
-gr.FaceZ(-1, 0.2, 0, 0.4, 0.3, "b#"); gr.Puts(mglPoint(-0.8, 0.6), "b", "C:k", -1.4);
-gr.FaceZ(-0.6, 0.5, 0, 0.4, 0.3, "g#"); gr.Puts(mglPoint(-0.4, 0.6), "g", "C:k", -1.4);
-gr.FaceZ(-0.2, 0.2, 0, 0.4, 0.3, "r#"); gr.Puts(mglPoint(0, 0.6), "r", "C:k", -1.4);
-gr.FaceZ(0.2, 0.2, 0, 0.4, 0.3, "h#"); gr.Puts(mglPoint(0.4, 0.6), "h", "C:k", -1.4);
-gr.FaceZ(0.6, 0.2, 0, 0.4, 0.3, "w#"); gr.Puts(mglPoint(0.8, 0.6), "w", "C:k", -1.4);
-//#brighted
-gr.FaceZ(-1, 0.8, 0, 0.4, 0.3, "r1#"); gr.Puts(mglPoint(-0.8, 0.9), "r1", "C:w", -1.4);
-gr.FaceZ(-0.6, 0.8, 0, 0.4, 0.3, "r3#"); gr.Puts(mglPoint(-0.4, 0.9), "r3", "C:w", -1.4);
-gr.FaceZ(-0.2, 0.8, 0, 0.4, 0.3, "r5#"); gr.Puts(mglPoint(0, 0.9), "r5", "C:k", -1.4);
-gr.FaceZ(0.2, 0.8, 0, 0.4, 0.3, "r7#"); gr.Puts(mglPoint(0.4, 0.9), "r7", "C:k", -1.4);
-gr.FaceZ(0.6, 0.8, 0, 0.4, 0.3, "r9#"); gr.Puts(mglPoint(0.8, 0.9), "r9", "C:k", -1.4);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-#LENUQ
-facez -1 -1 0 0.4 0.3 'L#': text -0.8 -0.9 'L' 'C:w'
-facez -0.6 -1 0 0.4 0.3 'E#': text -0.4 -0.9 'E' 'C:w'
-facez -0.2 -1 0 0.4 0.3 'N#': text 0 -0.9 'N' 'C:w'
-facez 0.2 -1 0 0.4 0.3 'U#': text 0.4 -0.9 'U' 'C:w'
-facez 0.6 -1 0 0.4 0.3 'Q#': text 0.8 -0.9 'Q' 'C:w'
-#lenuq
-facez -1 -0.7 0 0.4 0.3 'l#': text -0.8 -0.6 'l' 'C:k'
-facez -0.6 -0.7 0 0.4 0.3 'e#': text -0.4 -0.6 'e' 'C:k'
-facez -0.2 -0.7 0 0.4 0.3 'n#': text 0 -0.6 'n' 'C:k'
-facez 0.2 -0.7 0 0.4 0.3 'u#': text 0.4 -0.6 'u' 'C:k'
-facez 0.6 -0.7 0 0.4 0.3 'q#': text 0.8 -0.6 'q' 'C:k'
-#CMYkP
-facez -1 -0.4 0 0.4 0.3 'C#': text -0.8 -0.3 'C' 'C:w'
-facez -0.6 -0.4 0 0.4 0.3 'M#': text -0.4 -0.3 'M' 'C:w'
-facez -0.2 -0.4 0 0.4 0.3 'Y#': text 0 -0.3 'Y' 'C:w'
-facez 0.2 -0.4 0 0.4 0.3 'k#': text 0.4 -0.3 'k' 'C:w'
-facez 0.6 -0.4 0 0.4 0.3 'P#': text 0.8 -0.3 'P' 'C:w'
-#lenuq
-facez -1 -0.1 0 0.4 0.3 'c#': text -0.8 0 'c' 'C:k'
-facez -0.6 -0.1 0 0.4 0.3 'm#': text -0.4 0 'm' 'C:k'
-facez -0.2 -0.1 0 0.4 0.3 'y#': text 0 0 'y' 'C:k'
-facez 0.2 -0.1 0 0.4 0.3 'w#': text 0.4 0 'w' 'C:k'
-facez 0.6 -0.1 0 0.4 0.3 'p#': text 0.8 0 'p' 'C:k'
-#BGRHW
-facez -1 0.2 0 0.4 0.3 'B#': text -0.8 0.3 'B' 'C:k'
-facez -0.6 0.2 0 0.4 0.3 'G#': text -0.4 0.3 'G' 'C:k'
-facez -0.2 0.2 0 0.4 0.3 'R#': text 0 0.3 'R' 'C:k'
-facez 0.2 0.2 0 0.4 0.3 'H#': text 0.4 0.3 'H' 'C:k'
-facez 0.6 0.2 0 0.4 0.3 'W#': text 0.8 0.3 'W' 'C:k'
-#bgrhw
-facez -1 0.5 0 0.4 0.3 'b#': text -0.8 0.6 'b' 'C:w'
-facez -0.6 0.5 0 0.4 0.3 'g#': text -0.4 0.6 'g' 'C:w'
-facez -0.2 0.5 0 0.4 0.3 'r#': text 0 0.6 'r' 'C:w'
-facez 0.2 0.5 0 0.4 0.3 'h#': text 0.4 0.6 'h' 'C:w'
-facez 0.6 0.5 0 0.4 0.3 'w#': text 0.8 0.6 'w' 'C:w'
-#brighted
-facez -1 0.8 0 0.4 0.3 'r1#': text -0.8 0.9 'r1' 'C:k'
-facez -0.6 0.8 0 0.4 0.3 'r3#': text -0.4 0.9 'r3' 'C:k'
-facez -0.2 0.8 0 0.4 0.3 'r5#': text 0 0.9 'r5' 'C:k'
-facez 0.2 0.8 0 0.4 0.3 'r7#': text 0.4 0.9 'r7' 'C:k'
-facez 0.6 0.8 0 0.4 0.3 'r9#': text 0.8 0.9 'r9' 'C:k'
-@end verbatim
-@c ------------------------------------------------------------------
-@node Color schemes sample, Normal transparency, Colors sample, Basic features
-@subsection Color schemes sample
-@cindex Colorbar
-@float
-@image{../png/color_schemes, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(256,2); a.Fill(-1,1);
-gr.SubPlot(2,10,0,0.2); gr.Dens(a,"kw", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "kw", "C", -8);
-gr.SubPlot(2,10,1,0.2); gr.Dens(a,"wk", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "wk", "C", -8);
-gr.SubPlot(2,10,2,0.2); gr.Dens(a,"kHCcw", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "kHCcw", "C", -8);
-gr.SubPlot(2,10,3,0.2); gr.Dens(a,"kBbcw", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "kBbcw", "C", -8);
-gr.SubPlot(2,10,4,0.2); gr.Dens(a,"kRryw", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "kRryw", "C", -8);
-gr.SubPlot(2,10,5,0.2); gr.Dens(a,"kGgew", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "kGgew", "C", -8);
-gr.SubPlot(2,10,6,0.2); gr.Dens(a,"BbwrR", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "BbwrR", "C", -8);
-gr.SubPlot(2,10,7,0.2); gr.Dens(a,"BbwgG", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "BbwgG", "C", -8);
-gr.SubPlot(2,10,8,0.2); gr.Dens(a,"GgwmM", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "GgwmM", "C", -8);
-gr.SubPlot(2,10,9,0.2); gr.Dens(a,"UuwqR", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "UuwqR", "C", -8);
-gr.SubPlot(2,10,10,0.2); gr.Dens(a,"QqwcC", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "QqwcC", "C", -8);
-gr.SubPlot(2,10,11,0.2); gr.Dens(a,"CcwyY", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "CcwyY", "C", -8);
-gr.SubPlot(2,10,12,0.2); gr.Dens(a,"bcwyr", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "bcwyr", "C", -8);
-gr.SubPlot(2,10,13,0.2); gr.Dens(a,"bwr", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "bwr", "C", -8);
-gr.SubPlot(2,10,14,0.2); gr.Dens(a,"BbcyrR", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "BbcyrR", "C", -8);
-gr.SubPlot(2,10,15,0.2); gr.Dens(a,"UbcyqR", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "UbcyqR", "C", -8);
-gr.SubPlot(2,10,16,0.2); gr.Dens(a,"BbcwyrR", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "BbcwyrR", "C", -8);
-gr.SubPlot(2,10,17,0.2); gr.Dens(a,"bcyr", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "bcyr", "C", -8);
-gr.SubPlot(2,10,18,0.2); gr.Dens(a,"BbcyrR|", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "BbcyrR|", "C", -8);
-gr.SubPlot(2,10,19,0.2); gr.Dens(a,"bgr", nan);
-gr.Puts(mglPoint(-1.4, -0.3), "bgr", "C", -8);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 256 2: fill a 'x'
-subplot 2 10 0 0.2:dens a 'kw'
-text -1.4 -0.3 'kw' '' -8
-subplot 2 10 1 0.2:dens a 'wk'
-text -1.4 -0.3 'wk' '' -8
-subplot 2 10 2 0.2:dens a 'kHCcw'
-text -1.4 -0.3 'kHCcw' '' -8
-subplot 2 10 3 0.2:dens a 'kBbcw'
-text -1.4 -0.3 'kBbcw' '' -8
-subplot 2 10 4 0.2:dens a 'kRryw'
-text -1.4 -0.3 'kRryw' '' -8
-subplot 2 10 5 0.2:dens a 'kGgew'
-text -1.4 -0.3 'kGgew' '' -8
-subplot 2 10 6 0.2:dens a 'BbwrR'
-text -1.4 -0.3 'BbwrR' '' -8
-subplot 2 10 7 0.2:dens a 'BbwgG'
-text -1.4 -0.3 'BbwgG' '' -8
-subplot 2 10 8 0.2:dens a 'GgwmM'
-text -1.4 -0.3 'GgwmM' '' -8
-subplot 2 10 9 0.2:dens a 'UuwqR'
-text -1.4 -0.3 'UuwqR' '' -8
-subplot 2 10 10 0.2:dens a 'QqwcC'
-text -1.4 -0.3 'QqwcC' '' -8
-subplot 2 10 11 0.2:dens a 'CcwyY'
-text -1.4 -0.3 'CcwyY' '' -8
-subplot 2 10 12 0.2:dens a 'bcwyr'
-text -1.4 -0.3 'bcwyr' '' -8
-subplot 2 10 13 0.2:dens a 'bwr'
-text -1.4 -0.3 'bwr' '' -8
-subplot 2 10 14 0.2:dens a 'BbcyrR'
-text -1.4 -0.3 'BbcyrR' '' -8
-subplot 2 10 15 0.2:dens a 'UbcyqR'
-text -1.4 -0.3 'UbcyqR' '' -8
-subplot 2 10 16 0.2:dens a 'BbcwyrR'
-text -1.4 -0.3 'BbcwyrR' '' -8
-subplot 2 10 17 0.2:dens a 'bcyr'
-text -1.4 -0.3 'bcyr' '' -8
-subplot 2 10 18 0.2:dens a 'BbcyrR|'
-text -1.4 -0.3 'BbcyrR|' '' -8
-subplot 2 10 19 0.2:dens a 'bgr'
-text -1.4 -0.3 'bgr' '' -8
-@end verbatim
-@c ------------------------------------------------------------------
-@node Normal transparency, Glass-like transparency, Color schemes sample, Basic features
-@subsection Normal transparency
-@cindex TranspType
-@float
-@image{../png/type0, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Alpha(true); gr.Light(true);
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-
-gr.TranspType = 0; gr.Clf();
-gr.SubPlot(2,2,0); gr.Rotate(40,60); gr.Surf(a); gr.Box();
-gr.SubPlot(2,2,1); gr.Rotate(40,60); gr.Dens(a); gr.Box();
-gr.SubPlot(2,2,2); gr.Rotate(40,60); gr.Cont(a); gr.Box();
-gr.SubPlot(2,2,3); gr.Rotate(40,60); gr.Axial(a); gr.Box();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-alpha on: light on
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-
-transptype 0: clf
-subplot 2 2 0: rotate 40 60: surf a: box
-subplot 2 2 1: rotate 40 60: dens a: box
-subplot 2 2 2: rotate 40 60: cont a: box
-subplot 2 2 3: rotate 40 60: axial a: box
-@end verbatim
-@c ------------------------------------------------------------------
-@node Glass-like transparency, Lamp-like transparency, Normal transparency, Basic features
-@subsection Glass-like transparency
-@cindex TranspType
-@float
-@image{../png/type1, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Alpha(true); gr.Light(true);
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-
-gr.TranspType = 1; gr.Clf();
-gr.SubPlot(2,2,0); gr.Rotate(40,60); gr.Surf(a); gr.Box();
-gr.SubPlot(2,2,1); gr.Rotate(40,60); gr.Dens(a); gr.Box();
-gr.SubPlot(2,2,2); gr.Rotate(40,60); gr.Cont(a); gr.Box();
-gr.SubPlot(2,2,3); gr.Rotate(40,60); gr.Axial(a); gr.Box();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-alpha on: light on
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-
-transptype 1: clf
-subplot 2 2 0: rotate 40 60: surf a: box
-subplot 2 2 1: rotate 40 60: dens a: box
-subplot 2 2 2: rotate 40 60: cont a: box
-subplot 2 2 3: rotate 40 60: axial a: box
-@end verbatim
-@c ------------------------------------------------------------------
-@node Lamp-like transparency, , Glass-like transparency, Basic features
-@subsection Lamp-like transparency
-@cindex TranspType
-@float
-@image{../png/type2, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Alpha(true); gr.Light(true);
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-
-gr.TranspType = 2; gr.Clf();
-gr.SubPlot(2,2,0); gr.Rotate(40,60); gr.Surf(a); gr.Box();
-gr.SubPlot(2,2,1); gr.Rotate(40,60); gr.Dens(a); gr.Box();
-gr.SubPlot(2,2,2); gr.Rotate(40,60); gr.Cont(a); gr.Box();
-gr.SubPlot(2,2,3); gr.Rotate(40,60); gr.Axial(a); gr.Box();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-alpha on: light on
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-
-transptype 2: clf
-subplot 2 2 0: rotate 40 60: surf a: box
-subplot 2 2 1: rotate 40 60: dens a: box
-subplot 2 2 2: rotate 40 60: cont a: box
-subplot 2 2 3: rotate 40 60: axial a: box
-@end verbatim
-
-
-
-@node Additional features, Advanced features, Dual plotting samples, Samples
-@section Additional features
-@menu
-* Legend sample::
-* Adding mesh sample::
-* Surf & Cont sample::
-* Flow & Dens sample::
-* Several light sample::
-* Mirrored surface sample::
-* Cont with labels sample::
-* Ternary plot sample::
-* Quaternary plot sample::
-* Drops sample::
-* Molecules drawing sample::
-@end menu
-@c ------------------------------------------------------------------
-@node Legend sample, Adding mesh sample, , Additional features
-@subsection Legend sample
-@cindex Plot
-@cindex Legend
-@cindex AddLegend
-@float
-@image{../png/legend, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData f(50,3);
-f.Modify("sin(2*pi*x*x)",0);
-f.Modify("sin(2*pi*x)",1);
-f.Modify("sin(2*pi*sqrt(x))",2);
-gr.Axis(mglPoint(0,-1),mglPoint(1,1));
-gr.Box(); gr.Plot(f); gr.Axis();
-gr.AddLegend("sin(\\pi {x^2})","b");
-gr.AddLegend("sin(\\pi x)","g*");
-gr.AddLegend("sin(\\pi \\sqrt{\\a x})","r+");
-gr.Legend();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new f 50 3
-modify f 'sin(2*pi*x*x)'
-modify f 'sin(2*pi*x)' 1
-modify f 'sin(2*pi*sqrt(x))' 2
-axis 0 -1 1 1
-box
-plot f
-axis
-addlegend 'sin(\pi {x^2})' 'b'
-addlegend 'sin(\pi x)' 'g*'
-addlegend 'sin(\pi \sqrt{\a x})' 'r+'
-legend
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT f = mgl_create_data_size(50,3,1);
-mgl_data_modify(f,"sin(2*pi*x*x)",0);
-mgl_data_modify(f,"sin(2*pi*x)",1);
-mgl_data_modify(f,"sin(2*pi*sqrt(x))",2);
-mgl_set_axis(gr, 0.,-1.,0., 1.,1.,1., 0.,0.,0.);
-mgl_box(gr,1);
-mgl_plot(gr,f,"");
-mgl_axis(gr,"xy");
-mgl_add_legend(gr,"sin(\\pi {x^2})","b");
-mgl_add_legend(gr,"sin(\\pi x)","g*");
-mgl_add_legend(gr,"sin(\\pi \\sqrt{\\a x})","r+");
-mgl_legend(gr,3,"rL",-1.,0.1);
-mgl_delete_data(f);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Adding mesh sample, Surf & Cont sample, Legend sample, Additional features
-@subsection Adding mesh sample
-@cindex SubPlot
-@cindex Surf
-@cindex Dens
-@cindex Cont
-@cindex Axial
-@float
-@image{../png/samplea, 7cm}
-@c @caption{Example of adding mesh. @tdref{samplea}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Light(true);
-gr.Alpha(true);
-gr.SubPlot(2,2,0); gr.Rotate(40,60);
-gr.Surf(a,"BbcyrR#"); gr.Box();
-gr.SubPlot(2,2,1); gr.Rotate(40,60);
-gr.Dens(a,"BbcyrR#"); gr.Box();
-gr.SubPlot(2,2,2); gr.Rotate(40,60);
-gr.Cont(a,"BbcyrR#"); gr.Box();
-gr.SubPlot(2,2,3); gr.Rotate(40,60);
-gr.Axial(a,"BbcyrR#"); gr.Box();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-alpha on
-light on
-subplot 2 2 0
-rotate 40 60
-surf a 'BbcyrR#'
-box
-subplot 2 2 1
-rotate 40 60
-dens a 'BbcyrR#'
-box
-subplot 2 2 2
-rotate 40 60
-cont a 'BbcyrR#'
-box
-subplot 2 2 3
-rotate 40 60
-axial a 'BbcyrR#'
-box
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_set_alpha(gr,1);
-mgl_set_light(gr,1);
-mgl_subplot(gr,2,2,0); mgl_rotate(gr,40.,60.,0.);
-mgl_surf(gr,a,"BbcyrR#"); mgl_box(gr,1);
-mgl_subplot(gr,2,2,1); mgl_rotate(gr,40.,60.,0.);
-mgl_dens(gr,a,"BbcyrR#",-1.); mgl_box(gr,1);
-mgl_subplot(gr,2,2,2); mgl_rotate(gr,40.,60.,0.);
-mgl_cont(gr,a,"BbcyrR#",7,NAN); mgl_box(gr,1);
-mgl_subplot(gr,2,2,3); mgl_rotate(gr,40.,60.,0.);
-mgl_axial(gr,a,"BbcyrR#",3); mgl_box(gr,1);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Surf & Cont sample, Flow & Dens sample, Adding mesh sample, Additional features
-@subsection Surf & Cont sample
-@cindex Surf
-@cindex Cont
-@float
-@image{../png/surf_cont_y, 7cm}
-@c @caption{Example of Surf & Cont. @tdref{surf_cont_y}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Box();
-gr.Surf(a);
-gr.Cont(a,"y");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-surf a
-cont a 'y'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_cont(gr,a,"y",7,NAN);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Flow & Dens sample, Several light sample, Surf & Cont sample, Additional features
-@subsection Flow & Dens sample
-@cindex Flow
-@cindex Dens
-@float
-@image{../png/flow_dens, 7cm}
-@c @caption{Example of Flow & Dens. @tdref{flow_dens}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40), b(50,40), d(a);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-d.Modify("sqrt(v^2+w^2)",a,b);
-gr.Box();
-gr.Flow(a,b,"br"); gr.Dens(d,"BbcyrR");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-copy d a
-modify d 'sqrt(v^2+w^2)' a b
-box
-flow a b 'br'
-dens d 'BbcyrR'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a, b, d;
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-d = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(d,"sqrt(v^2+w^2)",a,b);
-mgl_box(gr,1);
-mgl_flow_2d(gr,a,b,"br",5,1,0.);
-mgl_dens(gr,d,"BbcyrR",-1.);
-mgl_delete_data(a); mgl_delete_data(b); mgl_delete_data(d);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Several light sample, Mirrored surface sample, Flow & Dens sample, Additional features
-@subsection Several light sample
-@cindex Surf
-@cindex Light
-@float
-@image{../png/several_light, 7cm}
-@c @caption{Example of Surf with several light. @tdref{several_light}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Light(1,mglPoint(0,1,0),'c');
-gr.Light(2,mglPoint(1,0,0),'y');
-gr.Light(3,mglPoint(0,-1,0),'m');
-gr.Box();
-gr.Surf(a,"h");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-light 1 0 1 0 'c'
-light 2 1 0 0 'y'
-light 3 0 -1 0 'm'
-box
-surf a 'h'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_add_light_rgb(gr,1,0.,1.,0.,1, 0.,1.,1.,0.5);
-mgl_add_light_rgb(gr,2,1.,0.,0.,1, 1.,1.,0.,0.5);
-mgl_add_light_rgb(gr,3,0.,-1.,0.,1, 1.,0.,1.,0.5);
-mgl_box(gr,1);
-mgl_surf(gr,a,"h");
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Mirrored surface sample, Cont with labels sample, Several light sample, Additional features
-@subsection Mirrored surface sample
-@cindex Surf
-@float
-@image{../png/mirror, 7cm}
-@c @caption{Example of mirrored surface. @tdref{mirror}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(30,40),x(30),y1(40),y2(40);
-a.Modify("pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)");
-x.Fill(-1,1); y1.Fill(0,1); y2.Fill(0,-1);
-gr.Rotate(40,60);
-gr.Light(true);
-gr.Box();
-gr.Surf(x,y1,a,"r"); gr.Surf(x,y2,a,"b");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 30 40
-modify a 'pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)'
-rotate 40 60
-light on
-surf a 'r'; yrange 0 1
-surf a 'b'; yrange 0 -1
-box
-@end verbatim
-or
-@verbatim
-new a 30 40
-var x 30 -1 1
-var y1 40 0 1
-var y2 40 0 -1
-modify a 'pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)'
-rotate 40 60
-light on
-surf x y1 a 'r'
-surf x y2 a 'b'
-box
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a,x,y1,y2;
-a = mgl_create_data_size(30,40,1);
-x = mgl_create_data_size(30,1,1);
-y1 = mgl_create_data_size(40,1,1);
-y2 = mgl_create_data_size(40,1,1);
-mgl_data_modify(a,"pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)",0);
-mgl_data_fill(x,-1.,1.,'x');
-mgl_data_fill(y1,0.,1.,'x');
-mgl_data_fill(y2,0.,-1.,'x');
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_surf_xy(gr,x,y1,a,"r"); mgl_surf_xy(gr,x,y2,a,"b");
-mgl_delete_data(a); mgl_delete_data(y1);
-mgl_delete_data(x); mgl_delete_data(y2);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cont with labels sample, Ternary plot sample, Mirrored surface sample, Additional features
-@subsection Cont with labels sample
-@cindex Cont
-@float
-@image{../png/contt, 7cm}
-@c @caption{Example of Cont with labels. @tdref{contt}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.Cont(a,"BbcyrRt");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-cont a 'BbcyrRt'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_cont(gr,a,"BbcyrRt",7,0);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Ternary plot sample, Quaternary plot sample, Cont with labels sample, Additional features
-@subsection Ternary plot sample
-@cindex Ternary
-@float
-@image{../png/ternary, 7cm}
-@c @caption{Example of Ternary plot. @tdref{ternary}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData x(50),y(50),rx(10),ry(10), a(20,30);
-a.Modify("4*x*y");
-x.Modify("0.25*(1+cos(2*pi*x))");
-y.Modify("0.25*(1+sin(2*pi*x))");
-rx.Modify("rnd"); ry.Modify("(1-v)*rnd",rx);
-gr.Text(mglPoint(-0.8,1.3), "Ternary plot (x+y+t=1)");
-gr.Ternary(1);
-gr.Plot(x,y,"r2");
-gr.Plot(rx,ry,"q^ ");
-gr.Cont(a);
-gr.Line(mglPoint(0.5,0), mglPoint(0,0.75), "g2");
-gr.Axis(); gr.Grid("xyz","B;");
-gr.Label('x',"x comp.");
-gr.Label('y',"y comp.");
-gr.Label('t',"t comp.");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new rx 10
-new ry 10
-new x 50
-new y 50
-new a 20 30
-modify a '4*x*y'
-modify x '0.25*(1+cos(2*pi*x))'
-modify y '0.25*(1+sin(2*pi*x))'
-modify rx 'rnd'
-modify ry 'rnd*(1-v)' rx
-text -0.8 1.3 'Ternary plot (x+y+t=1)'
-ternary 1
-plot x y 'r2'
-plot rx ry 'q^ '
-cont a
-line 0.5 0 0 0.75 'g2'
-axis
-grid 'xyz' 'B;'
-xlabel 'x comp.'
-ylabel 'y comp.'
-tlabel 't comp.'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT x,y,rx,ry,a;
-x = mgl_create_data_size(50,1,1);
-y = mgl_create_data_size(50,1,1);
-rx = mgl_create_data_size(50,1,1);
-ry = mgl_create_data_size(50,1,1);
-a = mgl_create_data_size(20,30,1);
-mgl_data_modify(x,"0.25*(1+cos(2*pi*x))",0);
-mgl_data_modify(y,"0.25*(1+sin(2*pi*x))",0);
-mgl_data_modify(rx,"rnd",0);
-mgl_data_modify_vw(ry,"(1-v)*rnd",rx,0);
-mgl_data_modify(a,"4*x*y",0);
-mgl_puts_ext(gr,-0.8,1.3,0.,"Ternary plot (x+y+t=1)","C",-1.4,'t');
-mgl_set_ternary(gr,1);
-mgl_plot_xy(gr,x,y,"r2");
-mgl_plot_xy(gr,rx,ry,"q^ ");
-mgl_cont(gr,a,"",7,0.);
-mgl_line(gr,0.5,0.,0.,0.,0.75,0.,"g2",2);
-mgl_axis(gr,"xyz");
-mgl_axis_grid(gr,"xyz","B:");
-mgl_label(gr,'x',"x comp");
-mgl_label(gr,'y',"y comp");
-mgl_label(gr,'t',"t comp");
-mgl_delete_data(a);
-mgl_delete_data(x); mgl_delete_data(y);
-mgl_delete_data(rx); mgl_delete_data(ry);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-
-
-@node Quaternary plot sample, Drops sample, Ternary plot sample, Additional features
-@subsection Quaternary plot sample
-@cindex Ternary
-@float
-@image{../png/quaternary, 7cm}
-@c @caption{Example of Ternary plot. @tdref{ternary}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData x(50),y(50),z(50),rx(10),ry(10), a(20,30);
-a.Modify("x*y*(1-x-y)^2*30");
-x.Modify("0.25*(1-x)*(1+cos(2*pi*x))");
-y.Modify("0.25*(1-x)*(1+sin(2*pi*x))");
-z.Modify("x");
-
-gr.Text(mglPoint(0,1.3), "Quaternary plot (x+y+z+t=1)");
-gr.Rotate(60,70); gr.Light(true);
-gr.Ternary(2); gr.SetCut(true);
-gr.Plot(x,y,z,"r2"); gr.Surf(a,"#");
-gr.Axis(); gr.Grid(); gr.Box();
-gr.SetRotatedText(false);
-gr.Label('t',"A",1); gr.Label('x',"B",1);
-gr.Label('y',"C",1); gr.Label('z',"D",1);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new x 50:new y 50:new z 50:new a 20 30
-modify a 'x*y*(1-x-y)^2*30'
-modify x '0.25*(1-x)*(1+cos(2*pi*x))'
-modify y '0.25*(1-x)*(1+sin(2*pi*x))'
-
-text 0 1.3 'Quaternary plot (x+y+z+t=1)'
-rotate 60 70:light on
-ternary 2:cut on
-plot x y z 'r2':surf a '#'
-axis:box:grid
-rotatetext off
-tlabel 'A' 1:xlabel 'B' 1
-ylabel 'C' 1:zlabel 'D' 1
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-TO BE DONE
-@end verbatim
-@end ifclear
-
-@c ------------------------------------------------------------------
-@node Drops sample, Molecules drawing sample, Quaternary plot sample, Additional features
-@subsection Drops sample
-@cindex Drop
-@float
-@image{../png/drops, 7cm}
-@c @caption{Example of Drop(s). @tdref{drops}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Light(true);
-gr.Puts(mglPoint(-1,1.2),"sh=0");
-gr.Drop(mglPoint(-1,0),mglPoint(0,1),0.5,"r",0);
-gr.Puts(mglPoint(-0.33,1.2),"sh=0.33");
-gr.Drop(mglPoint(-0.33,0),mglPoint(0,1),0.5,"r",0.33);
-gr.Puts(mglPoint(0.33,1.2),"sh=0.67");
-gr.Drop(mglPoint(0.33,0),mglPoint(0,1),0.5,"r",0.67);
-gr.Puts(mglPoint(1,1.2),"sh=1");
-gr.Drop(mglPoint(1,0),mglPoint(0,1),0.5,"r",1);
-gr.Ball(mglPoint(-1,0,1),'k');
-gr.Ball(mglPoint(-0.33,0,1),'k');
-gr.Ball(mglPoint(0.33,0,1),'k');
-gr.Ball(mglPoint(1,0,1),'k');
-gr.Line(mglPoint(-1,0,1),mglPoint(1,0,1),"b");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-light on
-text -1 1.2 'sh=0'
-drop -1 0 0 1 0.5 'r' 0
-text -0.33 1.2 'sh=0.33'
-drop -0.33 0 0 1 0.5 'r' 0.33
-text 0.33 1.2 'sh=0.67'
-drop 0.33 0 0 1 0.5 'r' 0.67
-text 1 1.2 'sh=1'
-drop 1 0 0 1 0.5 'r' 1
-ball -1 0 1 'k'
-ball -0.33 0 1 'k'
-ball 0.33 0 1 'k'
-ball 1 0 1 'k'
-line -1 0 1 1 0 1 'b'
-new h 100
-modify h '0.25*(1+x)^2'
-plot h 'k|'
-text -1 0.6 'h\sim(1+sh)^2' 'rL'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-mgl_set_light(gr,1);
-mgl_puts(gr,-1.,1.2,0.,"sh=0");
-mgl_drop(gr,-1.,0.,0.,0.,1.,0.,0.5,"r",0.,1.);
-mgl_puts(gr,-0.33,1.2,0.,"sh=0.33");
-mgl_drop(gr,-0.33,0.,0.,0.,1.,0.,0.5,"r",0.33,1.);
-mgl_puts(gr,0.33,1.2,0.,"sh=0.67");
-mgl_drop(gr,0.33,0.,0.,0.,1.,0.,0.5,"r",0.67,1.);
-mgl_puts(gr,1.,1.2,0.,"sh=1");
-mgl_drop(gr,1.,0.,0.,0.,1.,0.,0.5,"r",1.,1.);
-mgl_ball_str(gr,-1.,0.,1.,"k");
-mgl_ball_str(gr,-0.33,0.,1.,"k");
-mgl_ball_str(gr,0.33,0.,1.,"k");
-mgl_ball_str(gr,1.,0.,1.,"k");
-mgl_line(gr,-1.,0.,1.,1.,0.,1.,"b",2);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Molecules drawing sample, , Drops sample, Additional features
-@subsection Molecules drawing sample
-@cindex Drop
-@cindex Sphere
-@float
-@image{../png/molecule, 7cm}
-@c @caption{Example of molecules drawing. @tdref{molecule}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Alpha(true); gr.Light(true);
-gr.SubPlot(2,2,0);
-gr.Text(mglPoint(0,1.2),"Methane, CH_4",0,-3); gr.Rotate(60,120);
-gr.Sphere(mglPoint(0,0,0),0.25,"k");
-gr.Drop(mglPoint(0,0,0),mglPoint(0,0,1),0.35,"h",1,2);
-gr.Sphere(mglPoint(0,0,0.7),0.25,"g");
-gr.Drop(mglPoint(0,0,0),mglPoint(-0.94,0,-0.33),0.35,"h",1,2);
-gr.Sphere(mglPoint(-0.66,0,-0.23),0.25,"g");
-gr.Drop(mglPoint(0,0,0),mglPoint(0.47,0.82,-0.33),0.35,"h",1,2);
-gr.Sphere(mglPoint(0.33,0.57,-0.23),0.25,"g");
-gr.Drop(mglPoint(0,0,0),mglPoint(0.47,-0.82,-0.33),0.35,"h",1,2);
-gr.Sphere(mglPoint(0.33,-0.57,-0.23),0.25,"g");
-gr.SubPlot(2,2,1);
-gr.Text(mglPoint(0,1.2),"Water, H{_2}O",0,-3); gr.Rotate(60,100);
-gr.Sphere(mglPoint(0,0,0),0.25,"r");
-gr.Drop(mglPoint(0,0,0),mglPoint(0.3,0.5,0),0.3,"m",1,2);
-gr.Sphere(mglPoint(0.3,0.5,0),0.25,"g");
-gr.Drop(mglPoint(0,0,0),mglPoint(0.3,-0.5,0),0.3,"m",1,2);
-gr.Sphere(mglPoint(0.3,-0.5,0),0.25,"g");
-gr.SubPlot(2,2,2);
-gr.Text(mglPoint(0,1.2),"Oxygen, O_2",0,-3); gr.Rotate(60,120);
-gr.Drop(mglPoint(0,0.5,0),mglPoint(0,-0.3,0),0.3,"m",1,2);
-gr.Sphere(mglPoint(0,0.5,0),0.25,"r");
-gr.Drop(mglPoint(0,-0.5,0),mglPoint(0,0.3,0),0.3,"m",1,2);
-gr.Sphere(mglPoint(0,-0.5,0),0.25,"r");
-gr.SubPlot(2,2,3);
-gr.Text(mglPoint(0,1.2),"Ammonia, NH_3",0,-3); gr.Rotate(60,120);
-gr.Sphere(mglPoint(0,0,0),0.25,"b");
-gr.Drop(mglPoint(0,0,0),mglPoint(0.33,0.57,0),0.32,"n",1,2);
-gr.Sphere(mglPoint(0.33,0.57,0),0.25,"g");
-gr.Drop(mglPoint(0,0,0),mglPoint(0.33,-0.57,0),0.32,"n",1,2);
-gr.Sphere(mglPoint(0.33,-0.57,0),0.25,"g");
-gr.Drop(mglPoint(0,0,0),mglPoint(-0.65,0,0),0.32,"n",1,2);
-gr.Sphere(mglPoint(-0.65,0,0),0.25,"g");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-alpha on
-light on
-subplot 2 2 0
-text 0 1.2 'Methane, CH_4' '' -3
-rotate 60 120
-sphere 0 0 0 0.25 'k'
-drop 0 0 0 0 0 1 0.35 'h' 1 2
-sphere 0 0 0.7 0.25 'g'
-drop 0 0 0 -0.94 0 -0.33 0.35 'h' 1 2
-sphere -0.66 0 -0.23 0.25 'g'
-drop 0 0 0 0.47 0.82 -0.33 0.35 'h' 1 2
-sphere 0.33 0.57 -0.23 0.25 'g'
-drop 0 0 0 0.47 -0.82 -0.33 0.35 'h' 1 2
-sphere 0.33 -0.57 -0.23 0.25 'g'
-subplot 2 2 1
-text 0 1.2 'Water, H{_2}O' '' -3
-rotate 60 100
-sphere 0 0 0 0.25 'r'
-drop 0 0 0 0.3 0.5 0 0.3 'm' 1 2
-sphere 0.3 0.5 0 0.25 'g'
-drop 0 0 0 0.3 -0.5 0 0.3 'm' 1 2
-sphere 0.3 -0.5 0 0.25 'g'
-subplot 2 2 2
-text 0 1.2 'Oxygen, O_2' '' -3
-rotate 60 120
-drop 0 0.5 0 0 -0.3 0 0.3 'm' 1 2
-sphere 0 0.5 0 0.25 'r'
-drop 0 -0.5 0 0 0.3 0 0.3 'm' 1 2
-sphere 0 -0.5 0 0.25 'r'
-subplot 2 2 3
-text 0 1.2 0 'Ammonia, NH_3' '' -3
-rotate 60 120
-sphere 0 0 0 0.25 'b'
-drop 0 0 0 0.33 0.57 0 0.32 'n' 1 2
-sphere 0.33 0.57 0 0.25 'g'
-drop 0 0 0 0.33 -0.57 0 0.32 'n' 1 2
-sphere 0.33 -0.57 0 0.25 'g'
-drop 0 0 0 -0.65 0 0 0.32 'n' 1 2
-sphere -0.65 0 0 0.25 'g'
-@end verbatim
-@c ------------------------------------------------------------------
-@node Advanced features, , Additional features, Samples
-@section Advanced features
-@menu
-* Curvelinear coorinates sample::
-* 2-axes sample::
-* Semi-log sample::
-* Log-log sample::
-* Fitting sample::
-* Envelop sample::
-* Sew sample::
-* STFA sample::
-* PDE sample::
-* Beam tracing sample::
-* Parser sample::
-* Manual ticks sample::
-* ColumnPlot sample::
-* StickPlot sample::
-* Stereo image sample::
-@end menu
-@c ------------------------------------------------------------------
-@node Curvelinear coorinates sample, 2-axes sample, , Advanced features
-@subsection Curvelinear coorinates sample
-@cindex Axis
-@float
-@image{../png/sample3, 7cm}
-@c @caption{Example of curvelinear coorinates usage. @tdref{sample3}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Org = mglPoint(-1,1,-1);
-gr.SubPlot(2,2,0); gr.Rotate(60,40);
-gr.Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100);
-gr.Axis(); gr.Grid();
-gr.Text(mglPoint(0,1.3,1),"Cartesian");
-gr.SubPlot(2,2,1); gr.Rotate(60,40);
-gr.SetFunc("y*sin(pi*x)","y*cos(pi*x)");
-gr.Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100);
-gr.Axis(); gr.Grid();
-gr.Text(mglPoint(0,1.3,1),"Cylindrical");
-gr.SubPlot(2,2,2); gr.Rotate(60,40);
-gr.SetFunc("2*y*x","y*y - x*x");
-gr.Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100);
-gr.Axis(); gr.Grid();
-gr.Text(mglPoint(0,1.3,1),"Parabolic");
-gr.SubPlot(2,2,3); gr.Rotate(60,40);
-gr.SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z");
-gr.Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100);
-gr.Axis(); gr.Grid();
-gr.Text(mglPoint(0,1.3,1),"Spiral");
-gr.Axis(0,0,0); // set to default Cartesian
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-origin -1 1 -1
-subplot 2 2 0
-rotate 60 40
-line -1 0.5 0 1 0.5 0 'r2'
-axis
-grid
-text 0 1.3 1 'Cartesian'
-subplot 2 2 1
-rotate 60 40
-axis 'y*sin(pi*x)' 'y*cos(pi*x)' ''
-line -1 0.5 0 1 0.5 0 'r2'
-axis
-grid
-text 0 1.3 1 'Cylindrical'
-subplot 2 2 2
-rotate 60 40
-axis '2*y*x' 'y*y - x*x' ''
-line -1 0.5 0 1 0.5 0 'r2'
-axis
-grid
-text 0 1.3 1 'Parabolic'
-subplot 2 2 3
-rotate 60 40
-axis 'y*sin(pi*x)' 'y*cos(pi*x)' 'x+z'
-line -1 0.5 0 1 0.5 0 'r2'
-axis
-grid
-text 0 1.3 1 'Spiral'
-axis '' '' '' # set to default Cartesian
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-mgl_set_origin(gr,-1,1,-1);
-mgl_subplot(gr,2,2,0); mgl_rotate(gr,60,40,0);
-mgl_line(gr,-1,0.5,0,1,0.5,0,"r2",100);
-mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz","B");
-mgl_text(gr,0,1.3,1,"Cartesian");
-mgl_subplot(gr,2,2,1); mgl_rotate(gr,60,40,0);
-mgl_set_func(gr,"y*sin(pi*x)","y*cos(pi*x)",0);
-mgl_line(gr,-1,0.5,0,1,0.5,0,"r2",100);
-mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz","B");
-mgl_text(gr,0,1.3,1,"Cylindrical");
-mgl_subplot(gr,2,2,2); mgl_rotate(gr,60,40,0);
-mgl_set_func(gr,"2*y*x","y*y - x*x","");
-mgl_line(gr,-1,0.5,0,1,0.5,0,"r2",100);
-mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz","B");
-mgl_text(gr,0,1.3,1,"Parabolic");
-mgl_subplot(gr,2,2,3); mgl_rotate(gr,60,40,0);
-mgl_set_func(gr,"y*sin(pi*x)","y*cos(pi*x)","x+z");
-mgl_line(gr,-1,0.5,0,1,0.5,0,"r2",100);
-mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz","B");
-mgl_text(gr,0,1.3,1,"Spiral");
-mgl_set_func(gr,0,0,0); /* set to default Cartesian */
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node 2-axes sample, Semi-log sample, Curvelinear coorinates sample, Advanced features
-@subsection 2-axes sample
-@cindex Axis
-@float
-@image{../png/2_axis, 7cm}
-@c @caption{Example of 2 axes on the plot. @tdref{2_axis}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData y1(50), y2(50);
-y1.Modify("0.3*sin(2*pi*x)"); y2.Modify("0.5+0.3*cos(2*pi*x)");
-gr.Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(-1,-1,-1));
-gr.Axis(); gr.Label('y',"axis 1",0);
-gr.Plot(y1,"b");
-gr.Axis(mglPoint(0,0,0),mglPoint(1,1,1),mglPoint(1,1,1));
-gr.Axis(); gr.Label('y',"axis 2",0);
-gr.Stem(y2,"r");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new y1 50
-new y2 50
-modify y1 '0.3*sin(2*pi*x)'
-modify y2 '0.5+0.3*cos(2*pi*x)'
-axis -1 -1 -1 1 1 1
-origin -1 -1 -1
-axis
-ylabel 'axis 1' 0
-plot y1 'b'
-axis 0 0 0 1 1 1
-origin 1 1 1
-axis
-ylabel 'axis 2' 0
-stem y2 'r'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT y1 = mgl_create_data_size(50,1,1);
-HMDT y2 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y1,"0.3*sin(2*pi*x)",0);
-mgl_data_modify(y2,"0.5+0.3*cos(2*pi*x)",0);
-mgl_set_axis_2d(gr,-1.,1.,-1.,1.);
-mgl_set_origin(gr,-1.,-1.,-1.);
-mgl_axis(gr,"xyz");
-mgl_label_ext(gr,'y',"axis 1",0,-1.4,0.);
-mgl_plot(gr,y1,"b");
-mgl_set_axis_2d(gr,0.,0.,1.,1.);
-mgl_set_origin(gr,1.,1.,1.);
-mgl_axis(gr,"xyz");
-mgl_label_ext(gr,'y',"axis 2",0,-1.4,0.);
-mgl_stem(gr,y2,"r");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Semi-log sample, Log-log sample, 2-axes sample, Advanced features
-@subsection Semi-log sample
-@cindex Axis
-@cindex SetTicks
-@cindex Plot
-@float
-@image{../png/semilog, 7cm}
-@c @caption{Example of semi-log plot. @tdref{semilog}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData x(2000), y(2000);
-x.Modify("0.01/(x+10^(-5))"); y.Modify("sin(1/v)",x);
-gr.Axis(mglPoint(0.01,-1),mglPoint(1000,1),mglPoint(0.01,-1));
-gr.SetFunc("lg(x)",0); gr.SetTicks('x',0);
-gr.Box();
-gr.Plot(x,y,"b2");
-gr.Axis(); gr.Grid("xy","g");
-gr.Label('x',"x",0); gr.Label('y', "y = sin 1/x",0);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new x 2000
-new y 2000
-modify x '0.01/(x+10^(-5))'
-modify y 'sin(1/v)' x
-xrange 0.01 1000
-origin 0.01 -1 0
-xtick 0
-axis 'lg(x)' '' ''
-plot x y 'b2'
-axis
-grid 'xy' 'g'
-xlabel 'x' 0
-ylabel 'y = sin 1/x' 0
-box
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT x = mgl_create_data_size(2000,1,1);
-HMDT y = mgl_create_data_size(2000,1,1);
-mgl_data_modify(x,"0.01/(x+10^(-5))",0);
-mgl_data_modify_vw(y,"sin(1/v)",x,0);
-mgl_set_axis(gr,0.01,-1.,0.,1000.,1.,0.,0.01,-1.,0.);
-mgl_set_func(gr,"lg(x)",0,0);
-mgl_set_ticks(gr,0.,-5.,-5.);
-mgl_box(gr,1);
-mgl_plot_xy(gr,x,y,"b2");
-mgl_axis(gr,"xy"); mgl_axis_grid(gr,"xy","g");
-mgl_label_ext(gr,'x',"x",0,-1.4,0);
-mgl_label_ext(gr,'y', "y = sin 1/x",0,-1.4,0);
-mgl_delete_data(x); mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Log-log sample, Fitting sample, Semi-log sample, Advanced features
-@subsection Log-log sample
-@cindex Axis
-@cindex SetTicks
-@cindex Plot
-@float
-@image{../png/loglog, 7cm}
-@c @caption{Example of log-log plot. @tdref{loglog}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData x(100), y(100);
-x.Modify("pow(10,6*x-3)"); y.Modify("sqrt(1+v^2)",x);
-gr.Axis(mglPoint(0.001,0.1),mglPoint(1000,1000),mglPoint(0.001,0.1));
-gr.SetFunc("lg(x)","lg(y)");
-gr.SetTicks('x',0); gr.SetTicks('y',0);
-gr.Box();
-gr.Plot(x,y,"b2");
-gr.Axis(); gr.Grid("xy","g;");
-gr.Label('x',"x",0); gr.Label('y', "y=\\sqrt{1+x^2}",0);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new x 100
-new y 100
-modify x 'pow(10,6*x-3)'
-modify y 'sqrt(1+v^2)' x
-axis 0.001 0.1 1000 1000
-xtick 0
-ytick 0
-axis 'lg(x)' 'lg(y)' ''
-plot x y 'b2'
-axis
-grid 'xy' 'g;'
-xlabel 'x' 0
-ylabel 'y=\sqrt{1+x^2}' 0
-box
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT x = mgl_create_data_size(100,1,1);
-HMDT y = mgl_create_data_size(100,1,1);
-mgl_data_modify(x,"pow(10,6*x-3)",0);
-mgl_data_modify_vw(y,"sqrt(1+v^2)",x,0);
-mgl_set_axis(gr,0.001,0.1,0.,1000.,1000.,0.,0.001,0.1,0.);
-mgl_set_func(gr,"lg(x)","lg(y)",0);
-mgl_set_ticks(gr,0.,0.,-5.);
-mgl_box(gr,1);
-mgl_plot_xy(gr,x,y,"b2");
-mgl_axis(gr,"xy"); mgl_axis_grid(gr,"xy","g;");
-mgl_label_ext(gr,'x',"x",0,-1.4,0);
-mgl_label_ext(gr,'y', "y=\\sqrt{1+x^2}",0,-1.4,0);
-mgl_delete_data(x); mgl_delete_data(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Fitting sample, Envelop sample, Log-log sample, Advanced features
-@subsection Fitting sample
-@cindex Fit
-@cindex PutsFit
-@float
-@image{../png/fit, 7cm}
-@c @caption{Example of nonlinear fitting. @tdref{fit}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData rnd(100), in(100), res;
-rnd.Fill("0.4*rnd+0.1+sin(2*pi*x)", gr.Min, gr.Max);
-in.Fill("0.3+sin(2*pi*x)", gr.Min, gr.Max);
-gr.Axis(mglPoint(-1,-2), mglPoint(1,2));
-gr.Plot(rnd, ". ");
-gr.Box();
-float ini[3] = {1,1,3};
-gr.Fit(res, rnd, "a+b*sin(c*x)", "abc", ini);
-gr.Plot(res, "r");
-gr.Plot(in, "b");
-gr.Text(mglPoint(-1, -1.3), "fitted:", "L:r", -1);
-gr.PutsFit(mglPoint(0, -1.8), "y = ", "C:r", -1);
-gr.Text(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "C:b", -1);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new rnd 100
-fill rnd '0.4*rnd+0.1+sin(2*pi*x)'
-new in 100
-fill in '0.3+sin(2*pi*x)'
-yrange -2 2
-plot rnd '. '
-box
-list ini 1 1 3
-fit res rnd 'a+b*sin(c*x)' 'abc' ini
-plot res 'r'
-plot in 'b'
-text -1 -1.3 'fitted:' 'L:r' -1
-putsfit 0 -1.8 'y = ' 'C:r'
-text 0 2.2 'initial: y = 0.3+sin(2\pi x)' 'C:b' -1
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT rnd,in,res;
-float ini[3] = {1,1,3};
-rnd = mgl_create_data_size(100,1,1);
-in = mgl_create_data_size(100,1,1);
-res = mgl_create_data();
-mgl_data_modify(rnd,"0.4*rnd+0.1+sin(4*pi*x)",0);
-mgl_data_modify(in,"0.3+sin(4*pi*x)",0);
-mgl_set_axis_2d(gr,-1.,-2.,1.,2.);
-mgl_plot(gr,rnd,". ");
-mgl_box(gr,1);
-mgl_fit_1(gr,res,rnd,"a+b*sin(c*x)","abc",ini);
-mgl_plot(gr,res,"r"); mgl_plot(gr,in,"b");
-mgl_puts_ext(gr,-1.,-1.3,0.,"fitted:","L:r",-1.,'t');
-mgl_puts_fit(gr,0.,-1.8,0.,"y = ","C:r",-1.);
-mgl_puts_ext(gr,0.,2.2,0.,"initial: y = 0.3+sin(2\\pi x)","C:b", -1., 't');
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Envelop sample, Sew sample, Fitting sample, Advanced features
-@subsection Envelop sample
-@cindex Envelop
-@float
-@image{../png/envelop, 7cm}
-@c @caption{Example of envelop reconstruction.}@c @tdref{envelop}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(1000);
-a.Fill("exp(-8*x^2)*sin(10*pi*x)", gr.Min, gr.Max);
-gr.Plot(a, "b");
-a.Envelop('x');
-gr.Plot(a, "r");
-gr.Axis();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 1000
-fill a 'exp(-8*x^2)*sin(10*pi*x)'
-plot a 'b'
-envelop a
-plot a 'r'
-axis
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(1000,1,1);
-mgl_data_fill_eq(gr,a, "exp(-8*x^2)*sin(10*pi*x)", 0,0);
-mgl_plot(gr,a,"b");
-mgl_data_envelop(a,'x');
-mgl_plot(gr,a,"r");
-mgl_axis(gr,"xyz");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Sew sample, STFA sample, Envelop sample, Advanced features
-@subsection Sew sample
-@cindex Sew
-@float
-@image{../png/sew, 7cm}
-@c @caption{Example of phase ``sewing''.}@c @tdref{sew}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(100, 100);
-a.Modify("mod((y^2-(1-x)^2)/2,0.1)");
-gr.Rotate(40, 60);
-gr.Light(true);
-gr.Alpha(true);
-gr.Surf(a, "b");
-a.Sew("xy", 0.1);
-gr.Surf(a, "r");
-gr.Box();
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 100 100
-modify a 'mod((y^2-(1-x)^2)/2,0.1)'
-rotate 40 60
-light on
-alpha on
-surf a 'b'
-sew a 'xy' 0.1
-surf a 'r'
-box
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(100,100,1);
-mgl_data_modify(a, "mod((y^2-(1-x)^2)/2, 0.1)", 0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_surf(gr,a,"b");
-mgl_data_sew(a,"xy",0.1);
-mgl_surf(gr,a,"r");
-mgl_box(gr,1);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node STFA sample, PDE sample, Sew sample, Advanced features
-@subsection STFA sample
-@cindex STFA
-@float
-@image{../png/stfa, 7cm}
-@c @caption{Example of Short Time Fourier Analysis.}@c @tdref{stfa}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(2000), b(2000);
-a.Fill("cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+ \
- cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)",
- gr.Min, gr.Max);
-gr.SubPlot(1, 2, 0);
-gr.Plot(a);
-gr.Axis();
-gr.Label('x', "\\i t");
-gr.SubPlot(1, 2, 1);
-gr.STFA(a, b, 64);
-gr.Axis();
-gr.Label('x', "\\i t");
-gr.Label('y', "\\omega", 0);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 2000
-new b 2000
-fill a 'cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+
- cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)'
-subplot 1 2 0
-plot a
-axis
-xlabel '\i t'
-subplot 1 2 1
-stfa a b 64 ''
-axis
-ylabel '\omega' 0
-xlabel '\i t'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(2000,1,1);
-HMDT b = mgl_create_data_size(2000,1,1);
-mgl_data_fill_eq(gr, a, "cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+ \
- cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)",0,0);
-mgl_subplot(gr,1,2,0);
-mgl_plot(gr,a,"");
-mgl_axis(gr,"xy");
-mgl_label(gr,'x', "\\i t");
-mgl_subplot(gr,1,2,1);
-mgl_stfa(gr,a,b,64,"",0.);
-mgl_axis(gr,"xy");
-mgl_label(gr,'x', "\\i t");
-mgl_label(gr,'y', "\\omega");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node PDE sample, Beam tracing sample, STFA sample, Advanced features
-@subsection PDE sample
-@cindex mglPDE
-@cindex mglRay
-@float
-@image{../png/pde, 7cm}
-@c @caption{Example of Partial Differential Eduation solving.}@c @tdref{pde}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a,re(128),im(128);
-gr.Axis();
-gr.Label('x', "\\i x");
-gr.Label('y', "\\i z");
-
-re.Fill("exp(-48*(x+0.7)^2)", gr.Min, gr.Max);
-a = mglPDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, gr.Min, gr.Max, 0.01, 30);
-a.Transpose("yxz");
-gr.CAxis(0, 1);
-gr.Dens(a,"wyrRk");
-gr.Plot("-x", "k|");
-gr.Puts(mglPoint(0, 0.85), "absorption: (x+z)/2 for x+z>0");
-gr.Title("\\r{Equation:} ik_0\\partial_zu + \\Delta u + x\\cdot u + \
-i \\frac{x+z}{2}\\cdot u = 0", "iC", -1.5);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-axis
-xlabel '\i x'
-ylabel '\i z'
-new re 128
-new im 128
-fill re 'exp(-48*(x+0.7)^2)'
-pde a 'p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)' re im 0.01 30
-transpose a
-crange 0 1
-dens a 'wyrRk'
-fplot '-x' 'k|'
-text 0 0.85 'absorption: (x+z)/2 for x+z>0' '' -1
-title 'Equation: ik_0\partial_zu + \Delta u + x\cdot u + i \frac{x+z}{2}\cdot u = 0' 'iC' -1.5
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data();
-HMDT re = mgl_create_data_size(128,1,1);
-HMDT im = mgl_create_data_size(128,1,1);
-mgl_axis(gr,"xyz");
-mgl_label(gr,'x', "\\i x");
-mgl_label(gr,'y', "\\i z");
-mgl_data_fill_eq(gr,re,"exp(-48*(x+0.7)^2)", 0, 0);
-a = mgl_pde_solve(gr, "p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, 0.01, 30.);
-mgl_data_transpose(a, "yxz");
-mgl_set_caxis(gr, 0, 1);
-mgl_dens(gr, a,"wyrRk", -1.);
-mgl_fplot(gr, "-x", "k|", 100);
-mgl_puts(gr, 0., 0.85, 0., "absorption: (x+z)/2 for x+z>0");
-mgl_title(gr, "\\r{Equation:} ik_0\\partial_zu + \\Delta u + x\\cdot u + \
-i \\frac{x+z}{2}\\cdot u = 0", "iC", -1.5);
-mgl_delete_data(a);
-mgl_delete_data(im);
-mgl_delete_data(re);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Beam tracing sample, Parser sample, PDE sample, Advanced features
-@subsection Beam tracing sample
-@cindex mglQO2d
-@cindex mglRay
-@float
-@image{../png/qo2d, 7cm}
-@c @caption{Example of ray and beam tracing. Compare with @ref{PDE sample}.}@c @tdref{qo2d}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData r, xx, yy, a, im(128), re(128);
-const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)";
-r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2);
-gr.Plot(r.SubData(0), r.SubData(1), "k");
-gr.Axis(); gr.Label('x', "\\i x"); gr.Label('y', "\\i z");
-// now start beam tracing
-re.Fill("exp(-48*x^2)", gr.Min, gr.Max);
-a = mglQO2d(ham, re, im, r, 1, 30, &xx, &yy);
-gr.CAxis(0, 1);
-gr.Dens(xx, yy, a, "wyrRk");
-gr.Plot("-x", "k|");
-gr.Puts(mglPoint(0, 0.85), "absorption: (x+y)/2 for x+y>0");
-gr.Puts(mglPoint(0.7, -0.05), "central ray");
-gr.Title("Beam and ray tracing", "C", -1.5);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-define $1 'p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)'
-ray r $1 -0.7 -1 0 0 0.5 0 0.02 2
-plot r(0) r(1) 'k'
-axis
-xlabel '\i x'
-ylabel '\i z'
-new re 128
-new im 128
-new xx
-new yy
-fill re 'exp(-48*x^2)'
-qo2d a $1 re im r 1 30 xx yy
-crange 0 1
-dens xx yy a 'wyrRk'
-fplot '-x' 'k|'
-text -0.8 0.85 'absorption: (x+y)/2 for x+y>0' 'L' -1
-text 0.5 -0.05 'central ray' 'L' -1
-title 'Beam and ray tracing' 'C' -1.5
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)";
-HMDT r, xx, yy, a, im, re;
-im = mgl_create_data_size(128,1,1);
-re = mgl_create_data_size(128,1,1);
-r = mgl_ray_trace(ham, -0.7, -1., 0., 0., 0.5, 0., 0.02, 2.);
-xx = mgl_data_subdata(r,0,-1,-1);
-yy = mgl_data_subdata(r,1,-1,-1);
-mgl_plot_xy(gr, xx, yy, "k");
-mgl_axis(gr,"xyz");
-mgl_label(gr,'x',"\\i x");
-mgl_label(gr,'y',"\\i z");
-mgl_data_fill_eq(gr,re,"exp(-48*x^2)", 0, 0);
-a = mgl_qo2d_solve(ham, re, im, r, 1, 30, xx, yy);
-mgl_set_caxis(gr,0.,1.);
-mgl_dens_xy(gr,xx, yy, a, "wyrRk", -1.);
-mgl_fplot(gr,"-x", "k|",100);
-mgl_puts(gr, 0., 0.85, 0., "absorption: (x+y)/2 for x+y>0");
-mgl_puts(gr, 0.7, -0.05, 0., "central ray");
-mgl_title(gr, "Beam and ray tracing", "C", -1.5);
-mgl_delete_data(a); mgl_delete_data(r);
-mgl_delete_data(xx); mgl_delete_data(yy);
-mgl_delete_data(im); mgl_delete_data(re);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Parser sample, Manual ticks sample, Beam tracing sample, Advanced features
-@subsection Parser sample
-@cindex mglParse
-@ifclear UDAV
-@float
-@image{../png/parser, 7cm}
-@c @caption{Example of MGL parsing.}@c @tdref{parser}}
-@end float
-@strong{C++/Python code}
-@verbatim
-float a[100]; // let a_i = sin(4*pi*x), x=0...1
-for(int i=0;i<100;i++) a[i]=sin(4*M_PI*i/99);
-mglParse *parser = new mglParse;
-mglData &d = (parser->AddVar("dat"))->d;
-d.Set(a,100); // set data to variable
-parser->Execute(gr, "plot dat; xrange 0 1\nbox\naxis");
-// you may break script at any line do something
-// and continue after that
-parser->Execute(gr, "xlabel 'x'\nylabel 'y'\nbox");
-// also you may use cycles or conditions in script
-parser->Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext");
-@end verbatim
-@strong{MGL code}
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@strong{C/Fortran code}
-@verbatim
-float a[100]; /* let a_i = sin(4*pi*x), x=0...1 */
-int i;
-for(i=0;i<100;i++) a[i]=sin(4*M_PI*i/99);
-HMPR parser = mgl_create_parser();
-HMDT d = mgl_add_var(parser, "dat");
-mgl_data_set_float(d,a,100,1,1); /* set data to variable */
-mgl_parse_text(gr, parser, "plot dat; xrange 0 1\nbox\naxis");
-/* you may break script at any line do something
- and continue after that */
-mgl_parse_text(gr, parser, "xlabel 'x'\nylabel 'y'");
-/* also you may use cycles or conditions in script */
-mgl_parse_text(gr, parser, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Manual ticks sample, ColumnPlot sample, Parser sample, Advanced features
-@subsection Tick values sample
-@cindex SetTicksVal
-@float
-@image{../png/tval, 7cm}
-@c @caption{Example of manual tick values.}@c @tdref{tval}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.Axis(mglPoint(-M_PI, 0), mglPoint(M_PI, 2));
-gr.SetTicksVal('x', 6, -M_PI, "-\\pi", -M_PI/2, "-\\pi/2", 0., "0",
- 0.886, "x^*", M_PI/2, "\\pi/2", M_PI, "\\pi");
-gr.Axis(); gr.Grid();
-gr.Plot("2*cos(x^2)^2", "r2", NAN, 300);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-axis -pi 0 pi 2
-xtick -pi '-\pi' -1.571 '-\pi/2' 0 '0' 0.886 'x^*' 1.571 '\pi/2' pi '\pi'
-axis
-grid
-fplot '2*cos(x^2)^2' 'r2' nan 300
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-mgl_set_axis_2d(gr, -M_PI, 0, M_PI, 2);
-mgl_set_ticks_val(gr, 'x', 6, -M_PI, "-\\pi", -M_PI/2, "-\\pi/2",
- 0., "0", 0.886, "x^*", M_PI/2, "\\pi/2", M_PI, "\\pi");
-mgl_axis(gr,"xyz");
-mgl_axis_grid(gr,"xyz", "B-");
-mgl_fplot(gr, "2*cos(x^2)^2", "r2", 300);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node ColumnPlot sample, StickPlot sample, Manual ticks sample, Advanced features
-@subsection ColumnPlot sample
-@cindex ColumnPlot
-@float
-@image{../png/column, 7cm}
-@c @caption{Example of ColumnPlot.}@c @tdref{column}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-char str[32];
-for(int i=0;i<4;i++)
-{
- gr.ColumnPlot(4,i);
- gr.Box();
- sprintf(str,"Plot %d of 4",i);
- gr.Text(mglPoint(-0.5,0.5),str);
- sprintf(str,"sin(pi*x+pi*%d/2)",i);
- gr.Plot(str);
-}
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-for $1 0 3
-columnplot 4 $1
-box
-text -0.5 0.5 'Plot $1 of 4'
-fplot 'sin(pi*x+pi*$1/2)'
-next
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-int i;
-char str[32];
-for(i=0;i<4;i++)
-{
- mgl_columnplot(gr,4,i);
- mgl_box(gr,1);
- sprintf(str,"Plot %d of 4",i);
- mgl_text(gr,-0.5,0.5,0.,str);
- sprintf(str,"sin(pi*x+pi*%d/2)",i);
- mgl_fplot(gr,str,"",100);
-}
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node StickPlot sample, Stereo image sample, ColumnPlot sample, Advanced features
-@subsection StickPlot sample
-@cindex StickPlot
-@float
-@image{../png/stick, 7cm}
-@c @caption{Example of StickPlot.}@c @tdref{stick}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-gr.SetRanges(-1, 1, -1, 1, 0, 1); gr.Light(true);
-gr.StickPlot(3, 0, 40, 30); gr.Axis("xyz_");
-gr.Surf("exp(-10*y^2-6*x^2)");
-gr.Text(mglPoint(0.2, 0, 1.2), "z=0", "", -2);
-gr.StickPlot(3, 1, 40, 30); gr.Axis("xyz_");
-gr.Surf("exp(-10*y^2/2-6*x^2)/sqrt(2)");
-gr.Text(mglPoint(0.2, 0, 1.2), "z=1", "", -2);
-gr.StickPlot(3, 2, 40, 30); gr.Axis("xyz_");
-gr.Surf("exp(-10*y^2/5-6*x^2)/sqrt(5)");
-gr.Text(mglPoint(0.2, 0, 1.2), "z=2", "", -2);
-gr.Label('x',"\\tau", 0); gr.Label('y', "\\rho");
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-ranges -1 1 -1 1 0 1:light on
-stickplot 3 0 40 30 : axis 'xyz_'
-fsurf 'exp(-10*y^2-6*x^2)'
-text 0.2 0 1.2 'z=0' '' -2
-stickplot 3 1 40 30 : axis 'xy_'
-fsurf 'exp(-10*y^2/2-6*x^2)/sqrt(2)'
-text 0.2 0 1.2 'z=1' '' -2
-stickplot 3 2 40 30 : axis 'xy_'
-fsurf 'exp(-10*y^2/5-6*x^2)/sqrt(5)'
-text 0.2 0 1.2 'z=2' '' -2
-xlabel '\tau' 0 : ylabel '\rho'
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-mgl_set_axis_3d(gr, -1, -1, 0, 1, 1, 1);
-mgl_set_light(gr, 1);
-mgl_stickplot(gr, 3, 0, 40, 30);
-mgl_axis(gr, "xyz_");
-mgl_fsurf(gr,"exp(-10*y^2-6*x^2)","",100);
-mgl_text(gr, 0.2, 0, 1.2, "z=0");
-mgl_stickplot(gr, 3, 1, 40, 30);
-mgl_axis(gr, "xyz_");
-mgl_fsurf(gr,"exp(-10*y^2/2-6*x^2)/sqrt(2)","",100);
-mgl_text(gr, 0.2, 0, 1.2, "z=1");
-mgl_stickplot(gr, 3, 2, 40, 30);
-mgl_axis(gr, "xyz_");
-mgl_fsurf(gr,"exp(-10*y^2/5-6*x^2)/sqrt(5)","",100);
-mgl_text(gr, 0.2, 0, 1.2, "z=2");
-mgl_label(gr,'x',"\\tau");
-mgl_label(gr,'y', "\\rho");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Stereo image sample, , StickPlot sample, Advanced features
-@subsection Stereo image sample
-@float
-@image{../png/stereo, 7cm}
-@c @caption{Example of stereo image.}@c @tdref{stereo}}
-@end float
-@ifclear UDAV
-@strong{C++/Python code}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr.Light(true);
-gr.SubPlot(2,1,0);
-gr.Rotate(40,60+3);
-gr.Box(); gr.Surf(a);
-gr.SubPlot(2,1,1);
-gr.Rotate(40,60-3);
-gr.Box(); gr.Surf(a);
-@end verbatim
-@strong{MGL code}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-light on
-subplot 2 1 0
-rotate 40 60+3
-box:surf a
-subplot 2 1 1
-rotate 40 60-3
-box:surf a
-@end verbatim
-@ifclear UDAV
-@strong{C/Fortran code}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_set_light(gr,1);
-mgl_subplot(gr,2,1,0);
-mgl_rotate(gr,40.,60.+3.,0.);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_subplot(gr,2,1,1);
-mgl_rotate(gr,40.,60.-3.,0.);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@end ifclear
-
+++ /dev/null
-@c ------------------------------------------------------------------
-@chapter Примеры использования MathGL
-Эта глава содержит множество примеров кода для всех типов графиков, наиболее важных возможностей библиотеки и советов. Аналогичные примеры (с картинками) можно найти на @uref{http://mathgl.sf.net/pictures.html}.
-@ifclear UDAV
-MБольшинство примеров содержат код на 5 языках: C++, MGL, C, Fortran и Python. Однако, в некоторых я помещал только C++ код, поскольку соответствующий код слишком большой и ясно как его можно переписать на другие языки.
-Минимальный код для запуска и просмотра примеров на различных языках следующий.
-@strong{C++ код}
-Для компиляции используйте: @code{g++ -o sample sample.cpp -lmgl}.
-@verbatim
-#include <mgl/mgl_zb.h>
-int main()
-{
- mglGraph *gr = new mglGraphZB;
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // put sample code here
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- gr->ShowImage(); delete gr;
- return 0;
-}
-@end verbatim
-@strong{MGL скрипт}
-Для просмотра используйте: @code{mglview sample.mgl}.
-@verbatim
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# put sample code here
-# --> you may sample as is :)
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@end verbatim
-@strong{C-ый код}
-Для компиляции используйте: @code{gcc -o sample sample.c -lmgl}.
-@verbatim
-#include <mgl/mgl_c.h>
-int main()
-{
- HMGL gr = mgl_create_graph_zb(600,400);
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- /* put sample code here */
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- mgl_show_image(gr,"",0);
- mgl_delete_graph(gr);
- return 0;
-}
-@end verbatim
-@strong{Fortran}
-Для компиляции используйте: @code{gfortran -o sample sample.f90 -lmgl}. Замечу, что фортран не имеет проверки аргументов. Поэтому обратите особое внимание на передаваемые аргументы -- не путайте целые и действительные (с плавающей точкой) числа/аргументы. Никакого контроля в компиляторе для этого не предусмотрено!!!
-@verbatim
-integer gr, mgl_create_graph_zb
-gr = mgl_create_graph_zb(600,400)
-!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-! put sample code here
-!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-call mgl_show_image(gr,'',0)
-call mgl_delete_graph(gr)
-end
-@end verbatim
-@strong{Python}
-Для просмотра используйте: @code{python sample.py}.
-@verbatim
-from mathgl import *
-gr = mglGraph();
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# put sample code here
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-gr.ShowImage();
-@end verbatim
-@end ifclear
-@menu
-* 1D plotting samples::
-* 2D plotting samples::
-* 3D plotting samples::
-* Dual plotting samples::
-* Basic features::
-* Additional features::
-* Advanced features::
-@end menu
-@c ------------------------------------------------------------------
-@node 1D plotting samples, 2D plotting samples,, Samples
-@section Примеры 1D графиков
-@menu
-* Plot sample::
-* Radar sample::
-* Tens sample::
-* Area sample::
-* Area gradient sample::
-* Bars sample::
-* Bars 2 colors sample::
-* Bars above sample::
-* Bars fall sample::
-* Barh sample::
-* Step sample::
-* Stem sample::
-* Region sample::
-* Region gradient sample::
-* Error sample::
-* BoxPlot sample::
-* Mark sample::
-* TextMark sample::
-* Tube sample::
-* Text sample::
-* Torus sample::
-* Chart sample::
-* Pie chart sample::
-* Ring chart sample::
-@end menu
-@c ------------------------------------------------------------------
-@node Plot sample, Radar sample,, 1D plotting samples
-@subsection Plot -- пример использования
-@cindex Plot
-@float
-@image{../png/plot, 7cm}
-@c @caption{Example of Plot. @tdref{plot}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr->Box();
-gr->Plot(y);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-box
-plot y
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_box(gr,1);
-mgl_plot(gr,y,NULL);
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(y,'sin(2*pi*x)',1)
-call mgl_data_modify(y,'cos(2*pi*x)',2)
-call mgl_box(gr,1)
-call mgl_plot(gr,y,'')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(50,3);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.Box();
-gr.Plot(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Radar sample, Tens sample, Plot sample, 1D plotting samples
-@subsection Radar -- пример использования
-@cindex Radar
-@float
-@image{../png/radar, 7cm}
-@c @caption{Example of Plot. @tdref{radar}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(10,3);
-y.Modify("0.4*sin(pi*(2*x+y/2))+0.1*rnd");
-gr->Radar(y,"#");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 10 3
-modify y '0.4*sin(pi*(2*x+y/2))+0.1*rnd'
-radar y '#'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(10,3,1);
-mgl_data_modify(y,"0.4*sin(pi*(2*x+y/2))+0.1*rnd",0);
-mgl_radar(gr,y,"#",-1);
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(10,3,1)
-call mgl_data_modify(y,'0.4*sin(pi*(2*x+y/2))+0.1*rnd',0)
-call mgl_radar(gr,y,'#',-1.)
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(10,3);
-y.Modify("0.4*sin(pi*(2*x+y/2))+0.1*rnd");
-gr.Radar(y,"#");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Tens sample, Area sample, Radar sample, 1D plotting samples
-@subsection Tens -- пример использования
-@cindex Tens
-@float
-@image{../png/tens, 7cm}
-@c @caption{Example of Tens. @tdref{tens}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50), c(50);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)");
-c.Modify("sin(2*pi*x)");
-gr->Box();
-gr->Tens(y,c);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50
-new c 50
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify c 'sin(2*pi*x)'
-box
-tens y c
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,1,1);
-HMDT c = mgl_create_data_size(50,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(c,"sin(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_tens(gr,y,c,NULL);
-mgl_delete_data(y);
-mgl_delete_data(c);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, c, mgl_create_data_size
-y = mgl_create_data_size(50,1,1)
-c = mgl_create_data_size(50,1,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(c,'sin(2*pi*x)',0)
-call mgl_box(gr,1)
-call mgl_tens(gr,y,'')
-call mgl_delete_data(y)
-call mgl_delete_data(c)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(50);
-c = mglData(50);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)");
-c.Modify("sin(2*pi*x)");
-gr.Box();
-gr.Tens(y,c);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Area sample, Area gradient sample, Tens sample, 1D plotting samples
-@subsection Area -- пример использования
-@cindex Area
-@float
-@image{../png/area, 7cm}
-@c @caption{Example of Area. @tdref{area}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr->Org=mglPoint(0,0);
-gr->Box();
-gr->Area(y);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-origin 0 0
-box
-area y
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_area(gr,y,NULL);
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(y,'sin(2*pi*x)',1)
-call mgl_data_modify(y,'cos(2*pi*x)',2)
-call mgl_set_origin(gr,0.,0.,0.)
-call mgl_box(gr,1)
-call mgl_area(gr,y,'')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(50,3);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.SetOrigin(0.,0.);
-gr.Box();
-gr.Area(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Area gradient sample, Bars sample, Tens sample, 1D plotting samples
-@subsection Area с градиентной заливкой -- пример использования
-@cindex Area
-@float
-@image{../png/area_2, 7cm}
-@c @caption{Example of Area. @tdref{area}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr->Org=mglPoint(0,0);
-gr->Box();
-gr->Area(y,"cbgGyr");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-origin 0 0
-box
-area y 'cbgGyr'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_area(gr,y,"cbgGyr");
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(y,'sin(2*pi*x)',1)
-call mgl_data_modify(y,'cos(2*pi*x)',2)
-call mgl_set_origin(gr,0.,0.,0.)
-call mgl_box(gr,1)
-call mgl_area(gr,y,'cbgGyr')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(50,3);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.SetOrigin(0.,0.);
-gr.Box();
-gr.Area(y,"cbgGyr");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Bars sample, Bars 2 colors sample, Area gradient sample, 1D plotting samples
-@subsection Bars -- пример использования
-@cindex Bars
-@float
-@image{../png/bars, 7cm}
-@c @caption{Example of Bars. @tdref{bars}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr->Org=mglPoint(0,0);
-gr->Box();
-gr->Bars(y);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 10 3
-modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd'
-origin 0 0
-box
-bars y
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(10,3,1);
-mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_bars(gr,y,NULL);
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(10,3,1)
-call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd')
-call mgl_set_origin(gr,0.,0.,0.)
-call mgl_box(gr,1)
-call mgl_bars(gr,y,'')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr.SetOrigin(0.,0.);
-gr.Box();
-gr.Bars(y);
-@end verbatim
-@end ifclear
-
-@c ------------------------------------------------------------------
-@node Bars 2 colors sample, Bars above sample, Bars sample, 1D plotting samples
-@subsection Bars (2 цвета) -- пример использования
-@cindex Bars
-@float
-@image{../png/bars_2, 7cm}
-@c @caption{Example of Bars. @tdref{bars}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr->Org=mglPoint(0,0);
-gr->Box();
-gr->Bars(y,"cbgGyr");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 10 3
-modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd'
-origin 0 0
-box
-bars y 'cbgGyr'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(10,3,1);
-mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_bars(gr,y,"cbgGyr");
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(10,3,1)
-call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd')
-call mgl_set_origin(gr,0.,0.,0.)
-call mgl_box(gr,1)
-call mgl_bars(gr,y,'cbgGyr')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr.SetOrigin(0.,0.);
-gr.Box();
-gr.Bars(y,"cbgGyr");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Bars above sample, Bars fall sample, Bars 2 colors sample, 1D plotting samples
-@subsection Bars (один над другим) -- пример использования
-@cindex Bars
-@float
-@image{../png/bars_a, 7cm}
-@c @caption{Example of Bars. @tdref{bars}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr->Org=mglPoint(0,0);
-gr->Box();
-gr->Bars(y,"a");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 10 3
-modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd'
-origin 0 0
-box
-bars y 'a'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(10,3,1);
-mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_bars(gr,y,"a");
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(10,3,1)
-call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd')
-call mgl_set_origin(gr,0.,0.,0.)
-call mgl_box(gr,1)
-call mgl_bars(gr,y,'a')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr.SetOrigin(0.,0.);
-gr.Box();
-gr.Bars(y,"a");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Bars fall sample, Bars above sample, Bars above sample, 1D plotting samples
-@subsection Bars "водопад" -- пример использования
-@cindex Bars
-@float
-@image{../png/bars_f, 7cm}
-@c @caption{Example of Bars. @tdref{bars}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr->Org=mglPoint(0,0);
-gr->Box();
-gr->Bars(y,"f");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 10 3
-modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd'
-origin 0 0
-box
-bars y 'f'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(10,3,1);
-mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_bars(gr,y,"f");
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(10,3,1)
-call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd')
-call mgl_set_origin(gr,0.,0.,0.)
-call mgl_box(gr,1)
-call mgl_bars(gr,y,'f')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr.SetOrigin(0.,0.);
-gr.Box();
-gr.Bars(y,"f");
-@end verbatim
-@end ifclear
-
-
-@c ------------------------------------------------------------------
-@node Barh sample, Step sample, Bars fall sample, 1D plotting samples
-@subsection Barh -- пример использования
-@cindex Barh
-@float
-@image{../png/barh, 7cm}
-@c @caption{Example of Barh. @tdref{barh}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr->Org=mglPoint(0,0);
-gr->Box();
-gr->Barh(y);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 10 3
-modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd'
-origin 0 0
-box
-barh y
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(10,3,1);
-mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_barh(gr,y,NULL);
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(10,3,1)
-call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd')
-call mgl_set_origin(gr,0.,0.,0.)
-call mgl_box(gr,1)
-call mgl_barh(gr,y,'')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(10,3);
-y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
-gr.SetOrigin(0.,0.);
-gr.Box();
-gr.Barh(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Step sample, Stem sample, Barh sample, 1D plotting samples
-@subsection Step -- пример использования
-@cindex Step
-@float
-@image{../png/step, 7cm}
-@c @caption{Example of Step. @tdref{step}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr->Box();
-gr->Step(y);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-box
-step y
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_box(gr,1);
-mgl_step(gr,y,NULL);
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(y,'sin(2*pi*x)',1)
-call mgl_data_modify(y,'cos(2*pi*x)',2)
-call mgl_box(gr,1)
-call mgl_step(gr,y,'')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(50,3);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.Box();
-gr.Step(y);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Stem sample, Region sample, Step sample, 1D plotting samples
-@subsection Stem -- пример использования
-@cindex Stem
-@float
-@image{../png/stem, 7cm}
-@c @caption{Example of Stem. @tdref{stem}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr->Org=mglPoint(0,0);
-gr->Box();
-gr->Stem(y,"o");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-origin 0 0
-box
-stem y 'o'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_stem(gr,y,"o");
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(y,'sin(2*pi*x)',1)
-call mgl_data_modify(y,'cos(2*pi*x)',2)
-call mgl_set_origin(gr,0.,0.,0.)
-call mgl_box(gr,1)
-call mgl_stem(gr,y,'o')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(50,3);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr.SetOrigin(0.,0.);
-gr.Box();
-gr.Stem(y,"o");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Region sample, Region gradient sample, Stem sample, 1D plotting samples
-@subsection Region -- пример использования
-@cindex Region
-@float
-@image{../png/region, 7cm}
-@c @caption{Example of Region. @tdref{region}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y1(50), y2(50);
-y1.Modify("0.3*sin(2*pi*x)");
-y2.Modify("0.5+0.3*cos(2*pi*x)");
-gr->Box();
-gr->Region(y1,y2,"r");
-gr->Plot(y1,"k2");
-gr->Plot(y2,"k2");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y1 50
-new y2 50
-modify y1 '0.3*sin(2*pi*x)'
-modify y2 '0.5+0.3*cos(2*pi*x)'
-box
-region y1 y2 'r'
-plot y1 'k2'
-plot y2 'k2'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y1 = mgl_create_data_size(50,1,1);
-HMDT y2 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y1,"0.3*sin(2*pi*x)",0);
-mgl_data_modify(y2,"0.5+0.3*cos(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_region(gr,y1,y2,"r",1);
-mgl_plot(gr,y1,"k2");
-mgl_plot(gr,y2,"k2");
-mgl_delete_data(y1);
-mgl_delete_data(y2);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y1, y2, mgl_create_data_size
-y1 = mgl_create_data_size(50,1,1);
-y2 = mgl_create_data_size(50,1,1);
-call mgl_data_modify(y1,'0.3*sin(2*pi*x)',0);
-call mgl_data_modify(y2,'0.5+0.3*cos(2*pi*x)',0);
-call mgl_box(gr,1);
-call mgl_region(gr,y1,y2,'r',1);
-call mgl_plot(gr,y1,'k2');
-call mgl_plot(gr,y2,'k2');
-call mgl_delete_data(y1);
-call mgl_delete_data(y2);
-@end verbatim
-@strong{Python}
-@verbatim
-y1, y2, x = mglData(50), mglData(50), mglData(50);
-y1.Modify("0.3*sin(2*pi*x)");
-y2.Modify("0.5+0.3*cos(2*pi*x)");
-gr.Box();
-gr.Region(y1,y2,"r");
-gr.Plot(y1,"k2");
-gr.Plot(y2,"k2");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Region gradient sample, Error sample, Region sample, 1D plotting samples
-@subsection Region с градиентной заливкой -- пример использования
-@cindex Region
-@float
-@image{../png/region_2, 7cm}
-@c @caption{Example of Region. @tdref{region}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y1(50), y2(50);
-y1.Modify("0.3*sin(2*pi*x)");
-y2.Modify("0.5+0.3*cos(2*pi*x)");
-gr->Box();
-gr->Region(y1,y2,"yr");
-gr->Plot(y1,"k2");
-gr->Plot(y2,"k2");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y1 50
-new y2 50
-modify y1 '0.3*sin(2*pi*x)'
-modify y2 '0.5+0.3*cos(2*pi*x)'
-box
-region y1 y2 'yr'
-plot y1 'k2'
-plot y2 'k2'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y1 = mgl_create_data_size(50,1,1);
-HMDT y2 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y1,"0.3*sin(2*pi*x)",0);
-mgl_data_modify(y2,"0.5+0.3*cos(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_region(gr,y1,y2,"yr",1);
-mgl_plot(gr,y1,"k2");
-mgl_plot(gr,y2,"k2");
-mgl_delete_data(y1);
-mgl_delete_data(y2);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y1, y2, mgl_create_data_size
-y1 = mgl_create_data_size(50,1,1);
-y2 = mgl_create_data_size(50,1,1);
-call mgl_data_modify(y1,'0.3*sin(2*pi*x)',0);
-call mgl_data_modify(y2,'0.5+0.3*cos(2*pi*x)',0);
-call mgl_box(gr,1);
-call mgl_region(gr,y1,y2,'yr',1);
-call mgl_plot(gr,y1,'k2');
-call mgl_plot(gr,y2,'k2');
-call mgl_delete_data(y1);
-call mgl_delete_data(y2);
-@end verbatim
-@strong{Python}
-@verbatim
-y1, y2, x = mglData(50), mglData(50), mglData(50);
-y1.Modify("0.3*sin(2*pi*x)");
-y2.Modify("0.5+0.3*cos(2*pi*x)");
-gr.Box();
-gr.Region(y1,y2,"yr");
-gr.Plot(y1,"k2");
-gr.Plot(y2,"k2");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Error sample, BoxPlot sample, Region gradient sample, 1D plotting samples
-@subsection Error -- пример использования
-@cindex Error
-@float
-@image{../png/error, 7cm}
-@c @caption{Example of Error. @tdref{error}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,1), x0(10), y0(10), ex(10), ey(10);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-x0.Modify("2*x-1 + 0.1*rnd-0.05");
-y0.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x) + 0.2*rnd-0.1");
-ey.Modify("0.2"); ex.Modify("0.1");
-gr->Box();
-gr->Plot(y);
-gr->Error(x0,y0,ex,ey,"ko");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50
-new x0 10
-new y0 10
-new ex 10
-new ey 10
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify x0 '2*x-1 + 0.1*rnd-0.05'
-modify y0 '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x) + 0.2*rnd-0.1'
-modify ey '0.2'
-modify ex '0.1'
-box
-plot y
-error x0 y0 ex ey 'ko'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,1,1);
-HMDT x0 = mgl_create_data_size(10,1,1);
-HMDT y0 = mgl_create_data_size(10,1,1);
-HMDT ex = mgl_create_data_size(10,1,1);
-HMDT ey = mgl_create_data_size(10,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(x0,"2*x-1 + 0.1*rnd-0.05",0);
-mgl_data_modify(y0,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x) + 0.2*rnd-0.1",0);
-mgl_data_modify(ey,"0.2",0); mgl_data_modify(ex,"0.1",0);
-mgl_box(gr,1);
-mgl_plot(gr,y,NULL);
-mgl_error_exy(gr,x0,y0,ex,ey,"ko");
-mgl_delete_data(x0); mgl_delete_data(y0);
-mgl_delete_data(ex); mgl_delete_data(ey);
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, x0, y0, ex, ey, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-x0 = mgl_create_data_size(10,1,1)
-y0 = mgl_create_data_size(10,1,1)
-ex = mgl_create_data_size(10,1,1)
-ey = mgl_create_data_size(10,1,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(x0,'2*x-1 + 0.1*rnd-0.05',0);
-call mgl_data_modify(y0,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + &
- 0.2*sin(pi*x) + 0.2*rnd-0.1',0);
-call mgl_data_modify(ey,'0.2',0)
-call mgl_data_modify(ex,'0.1',0);
-call mgl_box(gr,1)
-call mgl_plot(gr,y,'')
-call mgl_error_exy(gr,x0,y0,ex,ey,'ko')
-call mgl_delete_data(x0)
-call mgl_delete_data(y0)
-call mgl_delete_data(ex)
-call mgl_delete_data(ey)
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y, x0, y0, ex, ey = mglData(50,1), mglData(10), mglData(10), mglData(10), mglData(10);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-x0.Modify("2*x-1+0.1*rnd-0.05");
-y0.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)+0.2*rnd-0.1");
-ey.Modify("0.2"); ex.Modify("0.1");
-gr.Box(); gr.Plot(y);
-gr.Error(x0,y0,ex,ey,"ko");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node BoxPlot sample, Mark sample, Error sample, 1D plotting samples
-@subsection BoxPlot -- пример использования
-@cindex BoxPlot
-@float
-@image{../png/boxplot, 7cm}
-@c @caption{Example of BoxPlot. @tdref{boxplot}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(10,7);
-a.Modify("(2*rnd-1)^3/2");
-gr->Box();
-gr->BoxPlot(a);
-gr->Plot(a," ko");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 10 7
-modify a '(2*rnd-1)^3/2'
-box
-boxplot a
-plot a ' ko'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(10,7,1);
-mgl_data_modify(a,"(2*rnd-1)^3/2",0);
-mgl_box(gr,1);
-mgl_plot(gr,a," ko");
-mgl_boxplot(gr,a,NULL);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-y = mgl_create_data_size(10,7,1)
-call mgl_data_modify(a,'(2*rnd-1)^3/2',0);
-call mgl_box(gr,1)
-call mgl_plot(gr,a,' ko')
-call mgl_boxplot(gr,a,'')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(10,7);
-a.Modify("(2*rnd-1)^3/2");
-gr.Box();
-gr.Plot(a," ko");
-gr.BoxPlot(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Mark sample, TextMark sample, BoxPlot sample, 1D plotting samples
-@subsection Mark -- пример использования
-@cindex Mark
-@float
-@image{../png/mark, 7cm}
-@c @caption{Example of Mark. @tdref{mark}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3), y1(50);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-gr->Box();
-gr->Mark(y,y1,"bs");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-new y1 50
-modify y1 '0.5+0.3*cos(2*pi*x)'
-box
-mark y y1 'bs'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-HMDT y1 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_mark_y(gr,y,y1,"bs");
-mgl_delete_data(y);
-mgl_delete_data(y1);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, y1, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-y1 = mgl_create_data_size(50,1,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(y,'sin(2*pi*x)',1)
-call mgl_data_modify(y,'cos(2*pi*x)',2)
-call mgl_data_modify(y1,'0.5+0.3*cos(2*pi*x)',0)
-call mgl_box(gr,1)
-call mgl_mark_y(gr,y,y1,'bs')
-call mgl_delete_data(y)
-call mgl_delete_data(y1)
-@end verbatim
-@strong{Python}
-@verbatim
-y, y1 = mglData(50,3), mglData(50);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-gr.Box();
-gr.Mark(y,y1,"bs");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node TextMark sample, Tube sample, Mark sample, 1D plotting samples
-@subsection TextMark -- пример использования
-@cindex TextMark
-@float
-@image{../png/textmark, 7cm}
-@c @caption{Example of TextMark. @tdref{textmark}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3), y1(50);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-gr->Box();
-gr->TextMark(y,y1,"\\gamma");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-new y1 50
-modify y1 '0.5+0.3*cos(2*pi*x)'
-box
-textmark y y1 '\gamma'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y, y1;
-y = mgl_create_data_size(50,3,1);
-y1 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_textmark_yr(gr,y,y1,"\\gamma","");
-mgl_delete_data(y);
-mgl_delete_data(y1);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, y1, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-y1 = mgl_create_data_size(50,1,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(y,'sin(2*pi*x)',1)
-call mgl_data_modify(y,'cos(2*pi*x)',2)
-call mgl_data_modify(y1,'0.5+0.3*cos(2*pi*x)',0)
-call mgl_box(gr,1)
-call mgl_textmark_yr(gr,y,y1,'\gamma','')
-call mgl_delete_data(y)
-call mgl_delete_data(y1)
-@end verbatim
-@strong{Python}
-@verbatim
-y, y1 = mglData(50,3), mglData(50);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-gr.Box();
-gr.TextMark(y,y1,"\\gamma");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Tube sample, Text sample, TextMark sample, 1D plotting samples
-@subsection Tube -- пример использования
-@cindex Tube
-@float
-@image{../png/tube, 7cm}
-@c @caption{Example of Tube. @tdref{tube}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Tube(y,0.05);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-rotate 40 60
-light on
-box
-tube y 0.05
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_tube(gr,y,0.05,NULL);
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(y,'sin(2*pi*x)',1)
-call mgl_data_modify(y,'cos(2*pi*x)',2)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_tube(gr,y,0.05,'')
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(50,3);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2);
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Tube(y,0.05);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Text sample, Torus sample, Tube sample, 1D plotting samples
-@subsection Text -- пример использования
-@cindex Text
-@float
-@image{../png/text, 7cm}
-@c @caption{Example of Text. @tdref{text}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-gr->Box();
-gr->Plot(y.SubData(-1,0));
-gr->Text(y,"This is very long string drawn along a curve",":k");
-gr->Text(y,"Another string drawn above a curve","T:r");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-box
-plot y(:,0)
-text y 'This is very long string drawn along a curve' ':k'
-text y 'Another string drawn above a curve' 'T:r'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_box(gr,1);
-mgl_plot(gr,y,NULL);
-mgl_text_y(gr,y,"This is very long string drawn along a curve",":k",-1.);
-mgl_text_y(gr,y,"Another string drawn above a curve","T:r",-1.);
-mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y, mgl_create_data_size
-y = mgl_create_data_size(50,1,1)
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_box(gr,1)
-call mgl_plot(gr,y,'')
-call mgl_text_y(gr,y,'This is very long string drawn along a curve',':k',-1.)
-call mgl_text_y(gr,y,'Another string drawn above a curve','T:r',-1.)
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-y = mglData(50,3);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2);
-gr.Box();
-gr.Plot(y.SubData(-1,0));
-gr.Text(y,"This is very long string drawn along a curve",":k");
-gr.Text(y,"Another string drawn above a curve","T:r");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Torus sample, Chart sample, Text sample, 1D plotting samples
-@subsection Torus -- пример использования
-@cindex Torus
-@float
-@image{../png/torus, 7cm}
-@c @caption{Example of Torus. @tdref{torus}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y1(50), y2(50);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-y2.Modify("0.3*sin(2*pi*x)");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Torus(y1,y2,"pz");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y1 50
-new y2 50
-modify y1 '0.5+0.3*cos(2*pi*x)'
-modify y2 '0.3*sin(2*pi*x)'
-rotate 40 60
-light on
-box
-torus y1 y2 'pz'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y1 = mgl_create_data_size(50,1,1);
-HMDT y2 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0);
-mgl_data_modify(y2,"0.3*sin(2*pi*x)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_torus(gr,y1,y2,"pz");
-mgl_delete_data(y1);
-mgl_delete_data(y2);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y1, y2, mgl_create_data_size
-y1 = mgl_create_data_size(50,1,1);
-y2 = mgl_create_data_size(50,1,1);
-call mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0);
-call mgl_data_modify(y2,"0.3*sin(2*pi*x)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_torus(gr,y1,y2,'pz')
-call mgl_delete_data(y1)
-call mgl_delete_data(y2)
-@end verbatim
-@strong{Python}
-@verbatim
-y1, y2 = mglData(50), mglData(50);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-y2.Modify("0.3*sin(2*pi*x)");
-gr.Rotate(40,60); gr.Light(True);
-gr.Box();
-gr.Torus(y1,y2,"pz");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Chart sample, Pie chart sample, Torus sample, 1D plotting samples
-@subsection Chart -- пример использования
-@cindex Chart
-@float
-@image{../png/chart, 7cm}
-@c @caption{Example of Chart. @tdref{chart}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData ch(7,2);
-ch.Modify("rnd+0.1");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Chart(ch,"#");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new ch 7 2
-modify ch 'rnd+0.1'
-rotate 40 60
-light on
-box
-chart ch
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT ch = mgl_create_data_size(7,2,1);
-mgl_data_modify(ch,"rnd+0.1",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_chart(gr,ch,"#");
-mgl_delete_data(ch);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer ch, mgl_create_data_size
-ch = mgl_create_data_size(7,2,1)
-call mgl_data_modify(ch,'rnd+0.1',0)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_chart(gr,ch,'#')
-call mgl_delete_data(ch)
-@end verbatim
-@strong{Python}
-@verbatim
-ch = mglData(7,2); ch.Modify("rnd+0.1");
-gr.Rotate(40,60); gr.Light(True);
-gr.Box();
-gr.Chart(ch,"#");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Pie chart sample, Ring chart sample, Chart sample, 1D plotting samples
-@subsection Pie chart -- пример использования
-@cindex Chart
-@cindex Axis
-@float
-@image{../png/pie_chart, 7cm}
-@c @caption{Example of Chart in cylindrical coordinates. @tdref{pie_chart}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData ch(7,2);
-ch.Modify("rnd+0.1");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->SetFunc("(y+1)/2*cos(pi*x)","(y+1)/2*sin(pi*x)");
-gr->Box();
-gr->Chart(ch,"bgr cmy#");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new ch 7 2
-modify ch 'rnd+0.1'
-rotate 40 60
-light on
-axis '(y+1)/2*cos(pi*x)' '(y+1)/2*sin(pi*x)' ''
-box
-chart ch 'bgr cmy#'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT ch = mgl_create_data_size(7,2,1);
-mgl_data_modify(ch,"rnd+0.1",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_func(gr,"(y+1)/2*cos(pi*x)","(y+1)/2*sin(pi*x)",0);
-mgl_box(gr,1);
-mgl_chart(gr,ch,"bgr cmy#");
-mgl_delete_data(ch);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer ch, mgl_create_data_size
-ch = mgl_create_data_size(7,2,1)
-call mgl_data_modify(ch,'rnd+0.1',0)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_func(gr,'(y+1)/2*cos(pi*x)','(y+1)/2*sin(pi*x)','');
-call mgl_box(gr,1)
-call mgl_chart(gr,ch,'bgr cmy#')
-call mgl_delete_data(ch)
-@end verbatim
-@strong{Python}
-@verbatim
-ch = mglData(7,2); ch.Modify("rnd+0.1");
-gr.Rotate(40,60); gr.Light(True);
-gr.SetFunc("(y+1)/2*cos(pi*x)","(y+1)/2*sin(pi*x)");
-gr.Box();
-gr.Chart(ch,"bgr cmy#");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Ring chart sample, , Pie chart sample, 1D plotting samples
-@subsection Ring chart -- пример использования
-@cindex Chart
-@cindex Axis
-@float
-@image{../png/ring_chart, 7cm}
-@c @caption{Example of Chart in cylindrical coordinates. @tdref{pie_chart}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData ch(7,2);
-ch.Modify("rnd+0.1");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)");
-gr->Box();
-gr->Chart(ch,"bgr cmy#");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new ch 7 2
-modify ch 'rnd+0.1'
-rotate 40 60
-light on
-axis '(y+2)/3*cos(pi*x)' '(y+2)/3*sin(pi*x)' ''
-box
-chart ch 'bgr cmy#'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT ch = mgl_create_data_size(7,2,1);
-mgl_data_modify(ch,"rnd+0.1",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_func(gr,"(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)",0);
-mgl_box(gr,1);
-mgl_chart(gr,ch,"bgr cmy#");
-mgl_delete_data(ch);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer ch, mgl_create_data_size
-ch = mgl_create_data_size(7,2,1)
-call mgl_data_modify(ch,'rnd+0.1',0)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_func(gr,'(y+2)/3*cos(pi*x)','(y+2)/3*sin(pi*x)','');
-call mgl_box(gr,1)
-call mgl_chart(gr,ch,'bgr cmy#')
-call mgl_delete_data(ch)
-@end verbatim
-@strong{Python}
-@verbatim
-ch = mglData(7,2); ch.Modify("rnd+0.1");
-gr.Rotate(40,60); gr.Light(True);
-gr.SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)");
-gr.Box();
-gr.Chart(ch,"bgr cmy#");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node 2D plotting samples, 3D plotting samples, 1D plotting samples, Samples
-@section Примеры 2D графиков
-@menu
-* Surf sample::
-* Transparent surface sample::
-* Surface in fog sample::
-* Sharp colors sample::
-* Mesh sample::
-* Fall sample::
-* Belt sample::
-* Tile sample::
-* Boxs sample::
-* Dens sample::
-* Cont sample::
-* ContF sample::
-* ContD sample::
-* Axial sample::
-* Grad sample::
-@end menu
-@c ------------------------------------------------------------------
-@node Surf sample, Transparent surface sample,, 2D plotting samples
-@subsection Surf -- пример использования
-@cindex Surf
-@float
-@image{../png/surf, 7cm}
-@c @caption{Example of Surf. @tdref{surf}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Surf(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-surf a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_surf(gr,a,'')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Surf(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Transparent surface sample, Surface in fog sample, Surf sample, 2D plotting samples
-@subsection Transparent surface -- пример использования
-@cindex Surf
-@cindex Alpha
-@float
-@image{../png/surf_alpha, 7cm}
-@c @caption{Example of Surf & Alpha. @tdref{surf_alpha}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Alpha(true);
-gr->Box();
-gr->Surf(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-alpha on
-box
-surf a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_alpha(gr,1)
-call mgl_box(gr,1)
-call mgl_surf(gr,a,'')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Alpha(True);
-gr.Surf(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Surface in fog sample, Sharp colors sample, Transparent surface sample, 2D plotting samples
-@subsection Surface in fog -- пример использования
-@cindex Surf
-@cindex Fog
-@float
-@image{../png/surf_fog, 7cm}
-@c @caption{Example of Surf & Fog. @tdref{surf_fog}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Fog(1);
-gr->Box();
-gr->Surf(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-fog 1
-box
-surf a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_fog(gr,1.,0.25);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_fog(gr,1.,0.25)
-call mgl_box(gr,1)
-call mgl_surf(gr,a,'')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Fog(1);
-gr.Surf(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Sharp colors sample, Mesh sample, Surface in fog sample, 2D plotting samples
-@subsection Sharp colors -- пример использования
-@cindex Surf
-@float
-@image{../png/surf_sl, 7cm}
-@c @caption{Example of sharp color scheme. @tdref{surf_sl}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Surf(a,"BbcyrR|");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-surf a 'BbcyrR|'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_surf(gr,a,"BbcyrR|");
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_surf(gr,a,'BbcyrR|')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Surf(a,"BbcyrR|");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Mesh sample, Fall sample, Sharp colors sample, 2D plotting samples
-@subsection Mesh -- пример использования
-@cindex Mesh
-@float
-@image{../png/mesh, 7cm}
-@c @caption{Example of Mesh. @tdref{mesh}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Box();
-gr->Mesh(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-box
-mesh a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_mesh(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1)
-call mgl_mesh(gr,a,'')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Mesh(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Fall sample, Belt sample, Mesh sample, 2D plotting samples
-@subsection Fall -- пример использования
-@cindex Fall
-@float
-@image{../png/fall, 7cm}
-@c @caption{Example of Fall. @tdref{fall}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Box();
-gr->Fall(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-box
-fall a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_fall(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1)
-call mgl_fall(gr,a,'')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Fall(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Belt sample, Tile sample, Fall sample, 2D plotting samples
-@subsection Belt -- пример использования
-@cindex Belt
-@float
-@image{../png/belt, 7cm}
-@c @caption{Example of Belt. @tdref{belt}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Belt(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-belt a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_belt(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_belt(gr,a,'')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Belt(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Tile sample, Boxs sample, Belt sample, 2D plotting samples
-@subsection Tile -- пример использования
-@cindex Tile
-@float
-@image{../png/tile, 7cm}
-@c @caption{Example of Tile. @tdref{tile}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Tile(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-tile a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_tile(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_tile(gr,a,'')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Tile(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Boxs sample, Dens sample, Tile sample, 2D plotting samples
-@subsection Boxs -- пример использования
-@cindex Boxs
-@float
-@image{../png/boxs, 7cm}
-@c @caption{Example of Boxs. @tdref{boxs}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60); gr->Light(true);
-gr->Org = mglPoint(0,0,0);
-gr->Box();
-gr->Boxs(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-origin 0 0 0
-box
-boxs a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_boxs(gr,a,0,0.);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_origin(gr,0.,0.,0.);
-call mgl_box(gr,1)
-call mgl_boxs(gr,a,'',0.)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True);
-gr.SetOrigin(0.,0.,0.); gr.Box();
-gr.Boxs(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dens sample, Cont sample, Boxs sample, 2D plotting samples
-@subsection Dens -- пример использования
-@cindex Dens
-@cindex Colorbar
-@float
-@image{../png/dens, 7cm}
-@c @caption{Example of Dens & Colorbar. @tdref{dens}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Box();
-gr->Dens(a);
-gr->Colorbar();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-dens a
-colorbar
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_dens(gr,a,0,0);
-mgl_colorbar(gr,"",0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_box(gr,1)
-call mgl_dens(gr,a,'',0)
-call mgl_colorbar(gr,'',0)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.Dens(a);
-gr.Colorbar();
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cont sample, ContF sample, Dens sample, 2D plotting samples
-@subsection Cont -- пример использования
-@cindex Cont
-@float
-@image{../png/cont, 7cm}
-@c @caption{Example of Cont. @tdref{cont}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Box();
-gr->Cont(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-box
-cont a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_cont(gr,a,0,7,NAN);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-real zero, nan
-! I don't know the NaN symbol in Fortran. So I produce it as zero/zero
-zero = 0; nan = zero/zero
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1)
-call mgl_cont(gr,a,'',7,nan)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60);
-gr.Box();
-gr.Cont(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node ContF sample, ContD sample, Cont sample, 2D plotting samples
-@subsection ContF -- пример использования
-@cindex ContF
-@float
-@image{../png/contf, 7cm}
-@c @caption{Example of ContF. @tdref{contf}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60); gr->Light(true);
-gr->Box();
-gr->ContF(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-contf a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_contf(gr,a,0,7,NAN);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-real zero, nan
-! I don't know the NaN symbol in Fortran. So I produce it as zero/zero
-zero = 0; nan = zero/zero
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_contf(gr,a,'',7,nan)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True);
-gr.Box();
-gr.ContF(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node ContD sample, Axial sample, ContF sample, 2D plotting samples
-@subsection ContD -- пример использования
-@cindex ContD
-@float
-@image{../png/contd, 7cm}
-@c @caption{Example of ContD. @tdref{contd}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40), v(9);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-v.Fill(-1,1);
-gr->Box();
-gr->ContD(v,a);
-gr->Colorbar(v);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-var v 9 -1 1
-box
-contd v a
-colorbar v
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-HMDT v = mgl_create_data_size(9,1,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_fill(v,-1.,1.,'x');
-mgl_box(gr,1);
-mgl_contd_val(gr,v,a,0,0);
-mgl_colorbar_val(gr,v,NULL,0);
-mgl_delete_data(a);
-mgl_delete_data(v);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, v, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-v = mgl_create_data_size(9,1,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_fill(v,-1.,1.,'x');
-call mgl_box(gr,1)
-call mgl_contd_val(gr,v,a,'',0);
-call mgl_colorbar_val(gr,v,NULL,0);
-call mgl_delete_data(a)
-call mgl_delete_data(v)
-@end verbatim
-@strong{Python}
-@verbatim
-a, v = mglData(50,40), mglData(9);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-v.Fill(-1,1);
-gr.Box();
-gr.ContD(v,a);
-gr.Colorbar(v);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Axial sample, Grad sample, ContD sample, 2D plotting samples
-@subsection Axial -- пример использования
-@cindex Axial
-@float
-@image{../png/axial, 7cm}
-@c @caption{Example of Axial. @tdref{axial}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Alpha(true);
-gr->Box();
-gr->Axial(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-alpha on
-box
-axial a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_axial(gr,a,"",3);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_alpha(gr,1)
-call mgl_box(gr,1)
-call mgl_axial(gr,a,'',3)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Alpha(True);
-gr.Box();
-gr.Axial(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Grad sample, , Axial sample, 2D plotting samples
-@subsection Grad -- пример использования
-@cindex Grad
-@float
-@image{../png/grad, 7cm}
-@c @caption{Example of Grad. @tdref{grad}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Box(); gr->Alpha(true); gr->Dens(a);
-gr->Grad(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box:alpha on:dens a
-grad a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_set_alpha(gr,1);
-mgl_dens(gr,a,0,0);
-mgl_grad(gr,a,0,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_box(gr,1)
-call mgl_set_alpha(gr,1)
-call mgl_dens(gr,a,'',0)
-call mgl_grad(gr,a,'',0)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Box(); gr.Alpha(1); gr.Dens(a);
-gr.Colorbar();
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node 3D plotting samples, Dual plotting samples, 2D plotting samples, Samples
-@section Примеры 3D графиков
-@menu
-* Surf3 sample::
-* Cloud sample::
-* Dens3 sample::
-* Cont3 sample::
-* ContF3 sample::
-* Cont projection sample::
-* Dens projection sample::
-* CutMinMax sample::
-* Isocaps sample::
-* CutOff sample::
-@end menu
-@c ------------------------------------------------------------------
-@node Surf3 sample, Cloud sample,, 3D plotting samples
-@subsection Surf3 -- пример использования
-@cindex Surf3
-@float
-@image{../png/surf3, 7cm}
-@c @caption{Example of Surf3. @tdref{surf3}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Alpha(true);
-gr->Box();
-gr->Surf3(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-light on
-alpha on
-box
-surf3 a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_surf3(gr,a,0,3);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_alpha(gr,1)
-call mgl_box(gr,1)
-call mgl_surf3(gr,a,'',3)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Light(True); gr.Alpha(True);
-gr.Box();
-gr.Surf3(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cloud sample, Dens3 sample, Surf3 sample, 3D plotting samples
-@subsection Cloud -- пример использования
-@cindex Cloud
-@float
-@image{../png/cloud, 7cm}
-@c @caption{Example of Cloud. @tdref{cloud}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60);
-gr->Alpha(true);
-gr->Box();
-gr->Cloud(a,"wyrRk");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-alpha on
-box
-cloud a 'wyrRk'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_cloud(gr,a,"wyrRk",1.);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_alpha(gr,1)
-call mgl_box(gr,1)
-call mgl_cloud(gr,a,'wyrRk',1.)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Alpha(True);
-gr.Box();
-gr.Cloud(a,"wyrRk");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dens3 sample, Cont3 sample, Cloud sample, 3D plotting samples
-@subsection Dens3 -- пример использования
-@cindex Dens3
-@cindex Axis
-@float
-@image{../png/densa, 7cm}
-@c @caption{Example of Dens3. @tdref{densa}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60); gr->Alpha(true); gr->Org = mglPoint(0,0,0);
-gr->Box();
-gr->DensA(a);
-gr->Axis();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-alpha on
-origin 0 0 0
-box
-densa a
-axis
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_alpha(gr,1);
-mgl_set_origin(gr,0.,0.,0.);
-mgl_box(gr,1);
-mgl_dens3_all(gr,a,0);
-mgl_axis(gr,"xyz");
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_alpha(gr,1)
-call mgl_set_origin(gr,0.,0.,0.);
-call mgl_box(gr,1)
-call mgl_dens3_all(gr,a,'')
-call mgl_axis(gr,"xyz")
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Alpha(True);
-gr.SetOrigin(0,0,0); gr.Box();
-gr.Axis();
-gr.DensA(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cont3 sample, ContF3 sample, Dens3 sample, 3D plotting samples
-@subsection Cont3 -- пример использования
-@cindex Cont3
-@float
-@image{../png/conta, 7cm}
-@c @caption{Example of Cont3. @tdref{conta}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60);
-gr->Box();
-gr->ContA(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-box
-conta a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_cont_all(gr,a,0,7);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1)
-call mgl_cont_all(gr,a,'',7)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60);
-gr.Box();
-gr.ContA(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node ContF3 sample, Cont projection sample, Cont3 sample, 3D plotting samples
-@subsection ContF3 -- пример использования
-@cindex ContF3
-@float
-@image{../png/contfa, 7cm}
-@c @caption{Example of ContF3. @tdref{contfa}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60); gr->Light(true);
-gr->Box();
-gr->ContFA(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-light on
-box
-contfa a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_contf_all(gr,a,0,7);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_contf_all(gr,a,'',7)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Light(True);
-gr.Box();
-gr.ContFA(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cont projection sample, Dens projection sample, ContF3 sample, 3D plotting samples
-@subsection Cont projection -- пример использования
-@cindex ContX
-@cindex ContY
-@cindex ContZ
-@float
-@image{../png/cont_xyz, 7cm}
-@c @caption{Example of projection by Cont[XYZ]. @tdref{cont_xyz}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60);
-gr->Box();
-gr->ContX(a.Sum("x"),"",-1);
-gr->ContY(a.Sum("y"),"",1);
-gr->ContZ(a.Sum("z"),"",-1);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-box
-sum s a 'x'
-contx s '' -1
-sum s a 'y'
-conty s '' 1
-sum s a 'z'
-contz s '' -1
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40), s;
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-s=mgl_data_sum(a,"x"); mgl_cont_x(gr,s,0,-1.,7); mgl_delete_data(s);
-s=mgl_data_sum(a,"y"); mgl_cont_y(gr,s,0,1.,7); mgl_delete_data(s);
-s=mgl_data_sum(a,"z"); mgl_cont_z(gr,s,0,-1.,7); mgl_delete_data(s);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,s, mgl_create_data_size, mgl_data_sum
-a = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1)
-s=mgl_data_sum(a,'x')
-call mgl_cont_x(gr,s,'',-1.,7)
-call mgl_delete_data(s)
-s=mgl_data_sum(a,'y')
-call mgl_cont_y(gr,s,'',1.,7)
-call mgl_delete_data(s)
-s=mgl_data_sum(a,'z')
-call mgl_cont_z(gr,s,'',-1.,7)
-call mgl_delete_data(s)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Box();
-gr.ContX(a.Sum("x"),"",-1);
-gr.ContY(a.Sum("y"),"",1);
-gr.ContZ(a.Sum("z"),"",-1);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dens projection sample, CutMinMax sample, Cont projection sample, 3D plotting samples
-@subsection Dens projection -- пример использования
-@cindex DensX
-@cindex DensY
-@cindex DensZ
-@float
-@image{../png/dens_xyz, 7cm}
-@c @caption{Example of projection by Dens[XYZ]. @tdref{dens_xyz}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60);
-gr->Box();
-gr->DensX(a.Sum("x"),"",-1);
-gr->DensY(a.Sum("y"),"",1);
-gr->DensZ(a.Sum("z"),"",-1);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-box
-sum s a 'x'
-densx s '' -1
-sum s a 'y'
-densy s '' 1
-sum s a 'z'
-densz s '' -1
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a, s; a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-s=mgl_data_sum(a,"x"); mgl_dens_x(gr,s,0,-1.); mgl_delete_data(s);
-s=mgl_data_sum(a,"y"); mgl_dens_y(gr,s,0,1.); mgl_delete_data(s);
-s=mgl_data_sum(a,"z"); mgl_dens_z(gr,s,0,-1.); mgl_delete_data(s);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,s, mgl_create_data_size, mgl_data_sum
-a = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1)
-s=mgl_data_sum(a,'x')
-call mgl_dens_x(gr,s,'',-1.)
-call mgl_delete_data(s)
-s=mgl_data_sum(a,'y')
-call mgl_dens_y(gr,s,'',1.)
-call mgl_delete_data(s)
-s=mgl_data_sum(a,'z')
-call mgl_dens_z(gr,s,'',-1.)
-call mgl_delete_data(s)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Box();
-gr.DensX(a.Sum("x"),"",-1);
-gr.DensY(a.Sum("y"),"",1);
-gr.DensZ(a.Sum("z"),"",-1);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node CutMinMax sample, Isocaps sample, Dens projection sample, 3D plotting samples
-@subsection CutMinMax -- пример использования
-@cindex Surf3
-@cindex CutMin
-@cindex CutMax
-@float
-@image{../png/cutminmax, 7cm}
-@c @caption{Example of Surf3 & CutMin, CutMax. @tdref{cutminmax}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Alpha(true);
-gr->CutMin = mglPoint(0,-1,-1); gr->CutMax = mglPoint(1,0,1);
-gr->Box();
-gr->Surf3(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-light on
-alpha on
-cut 0 -1 -1 1 0 1
-box
-surf3 a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_set_cut_box(gr,0.,-1.,-1.,1.,0.,1.);
-mgl_box(gr,1);
-mgl_surf3(gr,a,0,3);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_alpha(gr,1)
-call mgl_set_cut_box(gr,0.,-1.,-1.,1.,0.,1.);
-call mgl_box(gr,1)
-call mgl_surf3(gr,a,'',3)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Light(True); gr.Alpha(True);
-gr.SetCutBox(0,-1,-1,1,0,1); gr.Box();
-gr.Surf3(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Isocaps sample, CutOff sample, CutMinMax sample, 3D plotting samples
-@subsection ``Isocaps'' -- пример использования
-@cindex Surf3
-@cindex ContF3
-@cindex CutMin
-@cindex CutMax
-@float
-@image{../png/cutminmax2, 7cm}
-@c @caption{Example of ``Isocaps''. @tdref{cutminmax2}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(61,51,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->CutMin = mglPoint(0,-1,-1); gr->CutMax = mglPoint(1,0,1.1);
-gr->Box();
-gr->Surf3(-1,a);
-gr->ContF3(a,'x',-1); gr->ContF3(a,'y',-1);
-gr->ContF3(a,'z', 0); gr->ContF3(a,'z',39);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 61 51 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-light on
-cut 0 -1 -1 1 0 1.1
-box
-surf3 a -1
-contf3 a 'x' -1
-contf3 a 'y' -1
-contf3 a 'z' 0
-contf3 a 'z' 39
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(61,51,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_cut_box(gr,0.,-1.,-1.,1.,0.,1.1);
-mgl_box(gr,1);
-mgl_surf3_val(gr,-1.,a,0);
-mgl_contf3(gr,a,'x',-1, "", 7);
-mgl_contf3(gr,a,'y',-1, "", 7);
-mgl_contf3(gr,a,'z', 0, "", 7);
-mgl_contf3(gr,a,'z',39, "", 7);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-a = mgl_create_data_size(61,51,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_cut_box(gr,0.,-1.,-1.,1.,0.,1.1);
-call mgl_box(gr,1)
-call mgl_surf3_val(gr,-1.,a,'')
-call mgl_contf3(gr,a,'x',-1, '', 7);
-call mgl_contf3(gr,a,'y',-1, '', 7);
-call mgl_contf3(gr,a,'z', 0, '', 7);
-call mgl_contf3(gr,a,'z',39, '', 7);
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(61,51,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Light(True);
-gr.SetCutBox(0,-1,-1,1,0,1.1); gr.Box();
-gr.Surf3(-1,a);
-gr.ContF3(a,"x",-1); gr.ContF3(a,"y",-1);
-gr.ContF3(a,"z",0); gr.ContF3(a,"z",39);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node CutOff sample,, Isocaps sample, 3D plotting samples
-@subsection CutOff -- пример использования
-@cindex Surf3
-@cindex CutOff
-@float
-@image{../png/surf3_cutoff, 7cm}
-@c @caption{Example of Surf3 & CutOff. @tdref{surf3_cutoff}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Alpha(true);
-gr->CutOff("(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)");
-gr->Box();
-gr->Surf3(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-rotate 40 60
-light on
-alpha on
-cut '(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)'
-box
-surf3 a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_set_cutoff(gr,"(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)");
-mgl_box(gr,1);
-mgl_surf3(gr,a,0,3);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,'-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)',0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_alpha(gr,1)
-call mgl_set_cutoff(gr,'(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)')
-call mgl_box(gr,1)
-call mgl_surf3(gr,a,'',3)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(61,51,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-gr.Rotate(40,60); gr.Light(True); gr.Alpha(True);
-gr.CutOff("(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)");
-gr.Box();
-gr.Surf3(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dual plotting samples, Basic features, 3D plotting samples, Samples
-@section Примеры парных/векторных графиков
-@menu
-* SurfC sample::
-* SurfA sample::
-* TileS sample::
-* Map sample::
-* Traj sample::
-* Vect sample::
-* VectL sample::
-* VectC sample::
-* Flow sample::
-* Pipe sample::
-* Dew sample::
-* Surf3C sample::
-* Surf3A sample::
-* Vect 3D sample::
-* VectL 3D sample::
-* VectC 3D sample::
-* Flow 3D sample::
-* Pipe 3D sample::
-* Crust sample::
-* Dots sample::
-@end menu
-@c ------------------------------------------------------------------
-@node SurfC sample, SurfA sample,, Dual plotting samples
-@subsection SurfC -- пример использования
-@cindex SurfC
-@float
-@image{../png/surfc, 7cm}
-@c @caption{Example of SurfC. @tdref{surfc}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40), b(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->SurfC(a,b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-surfc a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-HMDT b = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_surfc(gr,a,b,0);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_surfc(gr,a,b,'')
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(50,40), mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True);
-gr.Box();
-gr.SurfC(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node SurfA sample, TileS sample, SurfC sample, Dual plotting samples
-@subsection SurfA -- пример использования
-@cindex SurfA
-@float
-@image{../png/surfa, 7cm}
-@c @caption{Example of SurfA. @tdref{surfa}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40), b(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Alpha(true);
-gr->Box();
-gr->SurfA(a,b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-alpha on
-box
-surfa a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a, b;
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_surfa(gr,a,b,0);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_alpha(gr,1);
-call mgl_box(gr,1)
-call mgl_surfa(gr,a,b,'')
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(50,40), mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True); gr.Alpha(True);
-gr.Box();
-gr.SurfC(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node TileS sample, Map sample, SurfA sample, Dual plotting samples
-@subsection TileS -- пример использования
-@cindex TileS
-@float
-@image{../png/tiles, 7cm}
-@c @caption{Example of TileS. @tdref{tiles}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40), b(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Box();
-gr->TileS(a,b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-tile a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a, b;
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_tiles(gr,a,b,0);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_box(gr,1)
-call mgl_tiles(gr,a,b,'')
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(50,40), mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.TileS(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Map sample, Traj sample, TileS sample, Dual plotting samples
-@subsection Map -- пример использования
-@cindex Map
-@float
-@image{../png/map, 7cm}
-@c @caption{Example of Map. @tdref{map}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50, 40), b(50, 40);
-gr->Puts(mglPoint(0, 0), "\\to", "", -1.4);
-gr->Axis(mglPoint(-1,-1,-2),mglPoint(1,1,2));
-gr->SubPlot(2, 1, 0);
-a.Fill("x", gr->Min, gr->Max); b.Fill("y", gr->Min, gr->Max);
-gr->Puts(mglPoint(0, 1.1), "\\{x, y\\}", "C", -2); gr->Box();
-gr->Map(a, b, "brgk", 0, false);
-gr->SubPlot(2, 1, 1);
-a.Fill("(x^3+y^3)/2", gr->Min, gr->Max);
-b.Fill("(x-y)/2", gr->Min, gr->Max);
-gr->Puts(mglPoint(0, 1.1), "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2);
-gr->Box();
-gr->Map(a, b, "brgk", 0, false);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-text 0 0 '\to'
-zrange -2 2
-subplot 2 1 0
-text 0 1.1 '\{x, y\}' '' -2
-box
-fill a 'x'
-fill b 'y'
-map a b 'brgk' 0 0
-subplot 2 1 1
-text 0 1.1 '\{\frac{x^3+y^3}{2}, \frac{x-y}{2}\}' '' -2
-box
-fill a '(x^3+y^3)/2'
-fill b '(x-y)/2'
-map a b 'brgk' 0 0
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-HMDT b = mgl_create_data_size(50,40,1);
-mgl_puts_ext(gr, 0.,0.,0., "\\to", "", -1.4, 't');
-mgl_set_axis_3d(gr,-1.,-1.,-2.,1.,1.,2.);
-mgl_subplot(gr, 2, 1, 0);
-mgl_data_fill_eq(gr, a, "x", 0, 0);
-mgl_data_fill_eq(gr, b, "y", 0, 0);
-mgl_puts_ext(gr, 0.,1.1,0., "\\{x, y\\}", "C", -2., 't');
-mgl_box(gr,1);
-mgl_map(gr, a, b, "brgk", 0, 0);
-mgl_subplot(gr, 2, 1, 1);
-mgl_data_fill_eq(gr, a, "(x^3+y^3)/2", 0, 0);
-mgl_data_fill_eq(gr, b, "(x-y)/2", 0, 0);
-mgl_puts_ext(gr, 0.,1.1,0., "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2., 't');
-mgl_box(gr,1);
-mgl_map(gr, a, b, "brgk", 0, 0);
-mgl_box(gr,1);
-mgl_map(gr,a,b,0,0,1);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-call mgl_puts_ext(gr, 0.,0.,0., '\to', '', -1.4, 't');
-call mgl_set_axis_3d(gr,-1.,-1.,-2.,1.,1.,2.);
-call mgl_subplot(gr, 2, 1, 0);
-call mgl_data_fill_eq(gr, a, 'x', 0, 0);
-call mgl_data_fill_eq(gr, b, 'y', 0, 0);
-call mgl_puts_ext(gr, 0.,1.1,0., '\{x, y\}', 'C', -2., 't');
-call mgl_box(gr,1);
-call mgl_map(gr, a, b, 'brgk', 0, 0);
-call mgl_subplot(gr, 2, 1, 1);
-call mgl_data_fill_eq(gr, a, '(x^3+y^3)/2', 0, 0);
-call mgl_data_fill_eq(gr, b, '(x-y)/2', 0, 0);
-call mgl_puts_ext(gr, 0.,1.1,0., '\{\frac{x^3+y^3}{2}, \frac{x-y}{2}\}', 'C', -2., 't');
-call mgl_box(gr,1);
-call mgl_map(gr, a, b, 'brgk', 0, 0);
-call mgl_box(gr,1);
-call mgl_map(gr,a,b,0,0,1);
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(50,40), mglData(50,40);
-gr.Puts(0, 0, 0, "\\to", "", -1.4);
-gr.SetRanges(-1,1,-1,1,-2,2);
-gr.SubPlot(2, 1, 0);
-gr.Fill(a, "x"); gr.Fill(b, "y");
-gr.Puts(0, 1.1, 0, "\\{x, y\\}", "C", -2);
-gr.Box();
-gr.Map(a, b, "brgk", 0, 0);
-gr.SubPlot(2, 1, 1);
-gr.Fill(a, "(x^3+y^3)/2"); gr.Fill(b, "(x-y)/2");
-gr.Puts(0, 1.1, 0, "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2);
-gr.Box();
-gr.Map(a, b, "brgk", 0, 0);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Traj sample, Vect sample, Map sample, Dual plotting samples
-@subsection Traj -- пример использования
-@cindex Traj
-@float
-@image{../png/traj, 7cm}
-@c @caption{Example of Plot. @tdref{traj}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y(50,3), x(50), y1(50), y2(50);
-y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-y2.Modify("0.3*sin(2*pi*x)");
-x.Fill(-1,1,'x');
-gr->Box();
-gr->Plot(x,y);
-gr->Traj(x,y,y1,y2);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y 50 3
-new x 50
-new y1 50
-new y2 50
-modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
-modify y 'sin(2*pi*x)' 1
-modify y 'cos(2*pi*x)' 2
-fill x -1 1
-modify y1 '0.5+0.3*cos(2*pi*x)'
-modify y2 '0.3*sin(2*pi*x)'
-box
-plot x y
-traj x y y1 y2
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y = mgl_create_data_size(50,3,1);
-HMDT x= mgl_create_data_size(50,1,1);
-HMDT y1 = mgl_create_data_size(50,1,1);
-HMDT y2 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
-mgl_data_modify(y,"sin(2*pi*x)",1);
-mgl_data_modify(y,"cos(2*pi*x)",2);
-mgl_data_modify(x,"2*x-1",0);
-mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0);
-mgl_data_modify(y2,"0.3*sin(2*pi*x)",0);
-mgl_box(gr,1);
-mgl_plot_xy(gr,x,y,NULL);
-mgl_traj_xy(gr,yx,y,y1,y2,NULL,0,0);
-mgl_delete_data(y); mgl_delete_data(y1);
-mgl_delete_data(x); mgl_delete_data(y2);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer x,y,y1,y2, mgl_create_data_size
-y = mgl_create_data_size(50,3,1)
-x= mgl_create_data_size(50,1,1);
-y1 = mgl_create_data_size(50,1,1);
-y2 = mgl_create_data_size(50,1,1);
-call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
-call mgl_data_modify(y,'sin(2*pi*x)',1)
-call mgl_data_modify(y,'cos(2*pi*x)',2)
-call mgl_data_modify(x,'2*x-1',0);
-call mgl_data_modify(y1,'0.5+0.3*cos(2*pi*x)',0);
-call mgl_data_modify(y2,'0.3*sin(2*pi*x)',0);
-call mgl_box(gr,1)
-call mgl_plot_xy(gr,x,y,NULL);
-call mgl_traj_xy(gr,yx,y,y1,y2,NULL,0,0);
-call mgl_delete_data(y)
-call mgl_delete_data(x)
-call mgl_delete_data(y1)
-call mgl_delete_data(y2)
-@end verbatim
-@strong{Python}
-@verbatim
-x,y,y1,y2 = mglData(50), mglData(50,3), mglData(50), mglData(50);
-y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0);
-y.Modify("sin(2*pi*x)",1);
-y.Modify("cos(2*pi*x)",2);
-y1.Modify("0.5+0.3*cos(2*pi*x)");
-y2.Modify("0.3*sin(2*pi*x)");
-x.Fill(-1,1,'x');
-gr.Box();
-gr.Plot(x,y);
-gr.Traj(x,y,y1,y2);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Vect sample, VectL sample, Traj sample, Dual plotting samples
-@subsection Vect -- пример использования
-@cindex Vect
-@float
-@image{../png/vect, 7cm}
-@c @caption{Example of Vect. @tdref{vect}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Box();
-gr->Vect(a,b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-vect a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(20,30,1);
-HMDT b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_vect_2d(gr,a,b,0,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(20,30,1);
-b = mgl_create_data_size(20,30,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_box(gr,1)
-call mgl_vect_2d(gr,a,b,'',0.)
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(20,30), mglData(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.Vect(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node VectL sample, VectC sample, Vect sample, Dual plotting samples
-@subsection VectL -- пример использования
-@cindex VectL
-@float
-@image{../png/vectl, 7cm}
-@c @caption{Example of VectL. @tdref{vectl}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Box();
-gr->VectL(a,b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-vectl a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a, b;
-a = mgl_create_data_size(20,30,1);
-b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_vectl_2d(gr,a,b,0,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(20,30,1);
-b = mgl_create_data_size(20,30,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_box(gr,1)
-call mgl_vectl_2d(gr,a,b,'',0.)
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(20,30), mglData(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.VectL(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node VectC sample, Flow sample, VectL sample, Dual plotting samples
-@subsection VectC -- пример использования
-@cindex VectC
-@float
-@image{../png/vectc, 7cm}
-@c @caption{Example of VectC. @tdref{vectc}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Box();
-gr->VectC(a,b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-vectc a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a, b;
-a = mgl_create_data_size(20,30,1);
-b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_vectc_2d(gr,a,b,0,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(20,30,1);
-b = mgl_create_data_size(20,30,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_box(gr,1)
-call mgl_vectc_2d(gr,a,b,'',0.)
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(20,30), mglData(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.VectC(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Flow sample, Pipe sample, VectC sample, Dual plotting samples
-@subsection Flow -- пример использования
-@cindex Flow
-@float
-@image{../png/flow, 7cm}
-@c @caption{Example of Flow. @tdref{flow}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Box();
-gr->Flow(a,b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-flow a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(20,30,1);
-HMDT b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_flow_2d(gr,a,b,0,5,1,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(20,30,1);
-b = mgl_create_data_size(20,30,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_box(gr,1)
-call mgl_flow_2d(gr,a,b,'',5,1,0.)
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(20,30), mglData(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.Flow(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Pipe sample, Dew sample, Flow sample, Dual plotting samples
-@subsection Pipe -- пример использования
-@cindex Pipe
-@float
-@image{../png/pipe, 7cm}
-@c @caption{Example of Pipe. @tdref{pipe}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Light(true);
-gr->Box();
-gr->Pipe(a,b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-light on
-box
-pipe a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(20,30,1);
-HMDT b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_pipe_2d(gr,a,b,0,0.05,5,1,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(20,30,1);
-b = mgl_create_data_size(20,30,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_pipe_2d(gr,a,b,'',0.05,5,1,0.)
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(20,30), mglData(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Light(True); gr.Box();
-gr.Pipe(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dew sample, Surf3C sample, Pipe sample, Dual plotting samples
-@subsection Dew -- пример использования
-@cindex Dew
-@float
-@image{../png/dew, 7cm}
-@c @caption{Example of Dew. @tdref{dew}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(20,30), b(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Box();
-gr->Light(true);
-gr->Dew(a,b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 20 30
-new b 20 30
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-light on
-dew a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(20,30,1);
-HMDT b = mgl_create_data_size(20,30,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_set_light(gr,1);
-mgl_dew_2d(gr,a,b,0,0.);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(20,30,1);
-b = mgl_create_data_size(20,30,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_box(gr,1)
-call mgl_set_light(gr,1);
-call mgl_dew_2d(gr,a,b,'',0.)
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(20,30), mglData(20,30);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Light(True); gr.Box();
-gr.Dew(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Surf3C sample, Surf3A sample, Dew sample, Dual plotting samples
-@subsection Surf3C -- пример использования
-@cindex Surf3C
-@float
-@image{../png/surf3c, 7cm}
-@c @caption{Example of Surf3C. @tdref{surf3c}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40), b(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-b.Modify("1-2*tanh(4*(x+y-1)^2)");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Alpha(true);
-gr->Box();
-gr->Surf3C(a, b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-new b 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-modify b '1-2*tanh(4*(x+y-1)^2)'
-rotate 40 60
-light on
-alpha on
-box
-surf3c a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(60,50,40);
-HMDT b = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_data_modify(b,"1-2*tanh(4*(x+y-1)^2)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_surf3c(gr,a,b,0,3);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(60,50,40);
-b = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_data_modify(b,"1-2*tanh(4*(x+y-1)^2)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_alpha(gr,1)
-call mgl_box(gr,1)
-call mgl_surf3c(gr,a,b,'',3)
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(60,50,40), mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2+(2*y-1)^2+(2*z-1)^4-(2*z-1)^2-0.1)");
-b.Modify("1-2*tanh(4*(x+y-1)^2)");
-gr.Rotate(40,60); gr.Light(True); gr.Alpha(True);
-gr.Box();
-gr.Surf3C(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Surf3A sample, Vect 3D sample, Surf3C sample, Dual plotting samples
-@subsection Surf3A -- пример использования
-@cindex Surf3A
-@float
-@image{../png/surf3a, 7cm}
-@c @caption{Example of Surf3A. @tdref{surf3a}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(60,50,40), b(60,50,40);
-a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
-b.Modify("1-2*tanh(4*(x+y-1)^2)");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Alpha(true);
-gr->Box();
-gr->Surf3A(a, b);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 60 50 40
-new b 60 50 40
-modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
-modify b '1-2*tanh(4*(x+y-1)^2)'
-rotate 40 60
-light on
-alpha on
-box
-surf3a a b
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a, b; a = mgl_create_data_size(60,50,40);
-b = mgl_create_data_size(60,50,40);
-mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-mgl_data_modify(b,"1-2*tanh(4*(x+y-1)^2)",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_box(gr,1);
-mgl_surf3a(gr,a,b,0,3);
-mgl_delete_data(a); mgl_delete_data(b);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(60,50,40);
-b = mgl_create_data_size(60,50,40);
-call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
-call mgl_data_modify(b,"1-2*tanh(4*(x+y-1)^2)",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_alpha(gr,1)
-call mgl_box(gr,1)
-call mgl_surf3a(gr,a,b,'',3)
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(60,50,40), mglData(60,50,40);
-a.Modify("-2*((2*x-1)^2+(2*y-1)^2+(2*z-1)^4-(2*z-1)^2-0.1)");
-b.Modify("1-2*tanh(4*(x+y-1)^2)");
-gr.Rotate(40,60); gr.Light(True); gr.Alpha(True);
-gr.Box();
-gr.Surf3A(a,b);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Vect 3D sample, VectL 3D sample, Surf3A sample, Dual plotting samples
-@subsection Vect 3D -- пример использования
-@cindex Vect
-@float
-@image{../png/vect3, 7cm}
-@c @caption{Example of Vect in 3D. @tdref{vect3}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData ex(10,10,10), ey(10,10,10), ez(10,10,10);
-ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-gr->Rotate(40,60);
-gr->Box();
-gr->Vect(ex, ey, ez, "bwr");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new ex 10 10 10
-new ey 10 10 10
-new ez 10 10 10
-fill ex '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ey '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ez '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)'
-rotate 40 60
-box
-vect ex ey ez 'bwr'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT ex, ey, ez;
-ex = mgl_create_data_size(10,10,10);
-ey = mgl_create_data_size(10,10,10);
-ez = mgl_create_data_size(10,10,10);
-mgl_data_fill_eq(gr, ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_vect_3d(gr,ex,ey,ez,"bwr");
-mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer ex,ey,ez, mgl_create_data_size
-ex = mgl_create_data_size(10,10,10)
-ey = mgl_create_data_size(10,10,10)
-ez = mgl_create_data_size(10,10,10)
-call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1);
-call mgl_vect_3d(gr,ex,ey,ez,'bwr')
-call mgl_delete_data(ex)
-call mgl_delete_data(ey)
-call mgl_delete_data(ez)
-@end verbatim
-@strong{Python}
-@verbatim
-ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10);
-gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Rotate(40,60); gr.Box();
-gr.Vect(ex,ey,ez,"bwr");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node VectL 3D sample, VectC 3D sample, Vect 3D sample, Dual plotting samples
-@subsection VectL 3D -- пример использования
-@cindex VectL
-@float
-@image{../png/vectl3, 7cm}
-@c @caption{Example of VectL in 3D. @tdref{vectl3}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData ex(10,10,10), ey(10,10,10), ez(10,10,10);
-ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-gr->Rotate(40,60);
-gr->Box();
-gr->VectL(ex, ey, ez, "bwr");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new ex 10 10 10
-new ey 10 10 10
-new ez 10 10 10
-fill ex '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ey '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ez '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)'
-rotate 40 60
-box
-vectl ex ey ez 'bwr'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT ex, ey, ez;
-ex = mgl_create_data_size(10,10,10);
-ey = mgl_create_data_size(10,10,10);
-ez = mgl_create_data_size(10,10,10);
-mgl_data_fill_eq(gr, ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_vectl_3d(gr,ex,ey,ez,"bwr");
-mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer ex,ey,ez, mgl_create_data_size
-ex = mgl_create_data_size(10,10,10)
-ey = mgl_create_data_size(10,10,10)
-ez = mgl_create_data_size(10,10,10)
-call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1);
-call mgl_vectl_3d(gr,ex,ey,ez,'bwr')
-call mgl_delete_data(ex)
-call mgl_delete_data(ey)
-call mgl_delete_data(ez)
-@end verbatim
-@strong{Python}
-@verbatim
-ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10);
-gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Rotate(40,60); gr.Box();
-gr.VectL(ex,ey,ez,"bwr");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node VectC 3D sample, Flow 3D sample, VectL 3D sample, Dual plotting samples
-@subsection VectC 3D -- пример использования
-@cindex VectC
-@float
-@image{../png/vectc3, 7cm}
-@c @caption{Example of VectC in 3D. @tdref{vectc3}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData ex(10,10,10), ey(10,10,10), ez(10,10,10);
-ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-gr->Rotate(40,60);
-gr->Box();
-gr->VectC(ex, ey, ez, "bwr");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new ex 10 10 10
-new ey 10 10 10
-new ez 10 10 10
-fill ex '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ey '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ez '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)'
-rotate 40 60
-box
-vectc ex ey ez 'bwr'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT ex, ey, ez;
-ex = mgl_create_data_size(10,10,10);
-ey = mgl_create_data_size(10,10,10);
-ez = mgl_create_data_size(10,10,10);
-mgl_data_fill_eq(gr, ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_vectc_3d(gr,ex,ey,ez,"bwr");
-mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer ex,ey,ez, mgl_create_data_size
-ex = mgl_create_data_size(10,10,10)
-ey = mgl_create_data_size(10,10,10)
-ez = mgl_create_data_size(10,10,10)
-call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1);
-call mgl_vectc_3d(gr,ex,ey,ez,'bwr')
-call mgl_delete_data(ex)
-call mgl_delete_data(ey)
-call mgl_delete_data(ez)
-@end verbatim
-@strong{Python}
-@verbatim
-ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10);
-gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Rotate(40,60); gr.Box();
-gr.VectC(ex,ey,ez,"bwr");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Flow 3D sample, Pipe 3D sample, VectC 3D sample, Dual plotting samples
-@subsection Flow 3D -- пример использования
-@cindex Flow
-@float
-@image{../png/flow3, 7cm}
-@c @caption{Example of Flow in 3D. @tdref{flow3}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData ex(30,30,30), ey(30,30,30), ez(30,30,30);
-ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-gr->Rotate(40,60);
-gr->Box();
-gr->Flow(ex, ey, ez, "bwr");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new ex 30 30 30
-new ey 30 30 30
-new ez 30 30 30
-fill ex '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ey '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ez '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)'
-rotate 40 60
-box
-flow ex ey ez 'bwr'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT ex, ey, ez;
-ex = mgl_create_data_size(30,30,30);
-ey = mgl_create_data_size(30,30,30);
-ez = mgl_create_data_size(30,30,30);
-mgl_data_fill_eq(gr, ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_flow_3d(gr,ex,ey,ez,"bwr",3,1);
-mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer ex,ey,ez, mgl_create_data_size
-ex = mgl_create_data_size(30,30,30)
-ey = mgl_create_data_size(30,30,30)
-ez = mgl_create_data_size(30,30,30)
-call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1);
-call mgl_flow_3d(gr,ex,ey,ez,'bwr',3,1)
-call mgl_delete_data(ex)
-call mgl_delete_data(ey)
-call mgl_delete_data(ez)
-@end verbatim
-@strong{Python}
-@verbatim
-ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10);
-gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Rotate(40,60); gr.Box();
-gr.Flow(ex,ey,ez,"bwr");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Pipe 3D sample, Crust sample, Flow 3D sample, Dual plotting samples
-@subsection Pipe 3D -- пример использования
-@cindex Pipe
-@float
-@image{../png/pipe3, 7cm}
-@c @caption{Example of Pipe in 3D. @tdref{pipe3}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData ex(10,10,10), ey(10,10,10), ez(10,10,10);
-ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max);
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Pipe(ex, ey, ez, "bwr");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new ex 10 10 10
-new ey 10 10 10
-new ez 10 10 10
-fill ex '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ey '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)'
-fill ez '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)'
-rotate 40 60
-light on
-box
-pipe ex ey ez 'bwr'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT ex, ey, ez;
-ex = mgl_create_data_size(10,10,10);
-ey = mgl_create_data_size(10,10,10);
-ez = mgl_create_data_size(10,10,10);
-mgl_data_fill_eq(gr, ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_data_fill_eq(gr, ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)",0,0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_pipe_3d(gr,ex,ey,ez,"bwr",0.05,3,1);
-mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer ex,ey,ez, mgl_create_data_size
-ex = mgl_create_data_size(10,10,10)
-ey = mgl_create_data_size(10,10,10)
-ez = mgl_create_data_size(10,10,10)
-call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - &
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1);
-call mgl_box(gr,1);
-call mgl_pipe_3d(gr,ex,ey,ez,'bwr',0.05,3,1)
-call mgl_delete_data(ex)
-call mgl_delete_data(ey)
-call mgl_delete_data(ez)
-@end verbatim
-@strong{Python}
-@verbatim
-ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10);
-gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \
- 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)");
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Pipe(ex,ey,ez,"bwr");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Crust sample, Dots sample, Pipe 3D sample, Dual plotting samples
-@subsection Crust -- пример использования
-@cindex Crust
-@float
-@image{../png/crust, 7cm}
-@c @caption{Example of Crust. @tdref{crust}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a("hotdogs.pts");
-a.Norm(-1,1,true);
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Crust(a,"p");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-read a 'hotdogs.pts'
-norm a -1 1 on
-rotate 40 60
-light on
-box
-crust a 'p'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_file("hotdogs.pts");
-mgl_data_norm(a,-1.,1.,1,0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_crust_tr(gr,a,"p",0.);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_file
-a = mgl_create_data_file("hotdogs.pts")
-call mgl_data_norm(a,-1.,1.,1,0)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_crust_tr(gr,a,"p",0.)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData("hotdogs.pts");
-a.Norm(-1,1,True);
-gr.Rotate(40,60); gr.Light(True);
-gr.Box();
-gr.Crust(a);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Dots sample,, Crust sample, Dual plotting samples
-@subsection Dots -- пример использования
-@cindex Dots
-@float
-@image{../png/dots, 7cm}
-@c @caption{Example of Dots. @tdref{dots}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a("hotdogs.pts");
-a.Norm(-1,1,true);
-gr->Rotate(40,60);
-gr->Box();
-gr->Dots(a,"p");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-read a 'hotdogs.pts'
-norm a -1 1 on
-rotate 40 60
-box
-dots a 'p'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_file("hotdogs.pts");
-mgl_data_norm(a,-1.,1.,1,0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_box(gr,1);
-mgl_dots_tr(gr,a,"p");
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_file
-a = mgl_create_data_file("hotdogs.pts")
-call mgl_data_norm(a,-1.,1.,1,0)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_box(gr,1)
-call mgl_dots_tr(gr,a,"p")
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData("hotdogs.pts");
-a.Norm(-1,1,True);
-gr.Rotate(40,60); gr.Light(True);
-gr.Box();
-gr.Dots(a);
-@end verbatim
-@end ifclear
-
-
-@c ------------------------------------------------------------------
-@node Basic features, Additional features, Dual plotting samples, Samples
-@section Базовые возможности
-@menu
-* 1D plot sample::
-* 2D plot sample::
-* 3D plot sample::
-* Line styles sample::
-* Arrow styles sample::
-* Text styles sample::
-* TeX parsing sample::
-* Font faces sample::
-* Colors sample::
-* Color schemes sample::
-* Normal transparency::
-* Glass-like transparency::
-* Lamp-like transparency::
-@end menu
-@c ------------------------------------------------------------------
-@node 1D plot sample, 2D plot sample, , Basic features
-@subsection Пример графиков 1D данных
-@cindex Plot
-@cindex Bars
-@cindex SubPlot
-@float
-@image{../png/sample8, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y0(50); y0.Modify("sin(pi*(2*x-1))");
-gr->SubPlot(2,2,0);
-gr->Plot(y0); gr->Box();
-
-gr->SubPlot(2,2,1);
-mglData y1(50,2);
-y1.Modify("sin(pi*2*x-pi)"); y1.Modify("cos(pi*2*x-pi)/2",1);
-gr->Plot(y1); gr->Box();
-
-mglData x(50); x.Modify("cos(pi*2*x-pi)");
-gr->Plot(x,y0,"Y+");
-
-gr->Plot(y1.SubData(-1,0),y1.SubData(-1,1),"q|");
-
-gr->SubPlot(2,2,2); gr->Rotate(60,40);
-mglData z(50); z.Modify("2*x-1");
-gr->Plot(x,y0,z); gr->Box();
-
-mglData y2(10,3); y2.Modify("cos(pi*(2*x-1-y))");
-y2.Modify("2*x-1",2);
-gr->Plot(y2.SubData(-1,0),y2.SubData(-1,1),y2.SubData(-1,2),"bo ");
-
-gr->SubPlot(2,2,3); gr->Rotate(60,40);
-gr->Bars(x,y0,z,"ri"); gr->Box();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y0 50: modify y0 'sin(pi*(2*x-1))'
-subplot 2 2 0
-plot y0: box
-
-subplot 2 2 1
-new y1 50 2
-modify y1 'sin(pi*2*x-pi)'
-modify y1 'cos(pi*2*x-pi)/2' 1
-plot y1: box
-
-new x 50: modify x 'cos(pi*2*x-pi)'
-plot x y0 'Y+'
-plot y1(:,0) y(:,1) 'q|'
-
-subplot 2 2 2:rotate 60 40
-new z 50: modify z '2*x-1'
-plot x y0 z 'g':box
-new y2 10 3
-modify y2 'cos(pi*(2*x-1-y))'
-modify y2 '2*x-1' 2
-plot y2(:,0) y2(:,1) y2(:,2) 'bo '
-
-subplot 2 2 3:rotate 60 40
-bars x y0 z 'r':box
-@end verbatim
-@c ------------------------------------------------------------------
-@node 2D plot sample, 3D plot sample, 1D plot sample, Basic features
-@subsection Пример графиков 2D данных
-@cindex Surf
-@cindex Dens
-@cindex Alpha
-@float
-@image{../png/sample9, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Light(true);
-mglData a0(50,40);
-a0.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->SubPlot(2,2,0); gr->Rotate(60,40);
-gr->Surf(a0); gr->Box();
-
-mglData x(50,40),y(50,40),z(50,40);
-x.Modify("0.8*sin(2*pi*x)*sin(pi*y)");
-y.Modify("0.8*cos(2*pi*x)*sin(pi*y)");
-z.Modify("0.8*cos(pi*y)");
-gr->SubPlot(2,2,1); gr->Rotate(60,40);
-gr->Surf(x,y,z,"BbwrR"); gr->Box();
-
-mglData a1(50,40,3);
-a1.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*sin(3*pi*(x*y))",1);
-a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",2);
-gr->SubPlot(2,2,2); gr->Rotate(60,40);
-gr->Alpha(true);
-gr->Surf(a1); gr->Box();
-
-gr->SubPlot(2,2,3); gr->Rotate(60,40);
-gr->Dens(a1); gr->Box();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-light on
-
-new a0 50 40
-modify a0 '0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))'
-subplot 2 2 0:rotate 60 40
-surf a0: box
-
-new x 50 40: new y 50 40: new z 50 40
-modify x '0.8*sin(2*pi*x)*sin(pi*y)'
-modify y '0.8*cos(2*pi*x)*sin(pi*y)'
-modify z '0.8*cos(pi*y)'
-subplot 2 2 1:rotate 60 40
-surf x y z 'bbwrr': box
-
-new a1 50 40 3
-modify a1 '0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))'
-modify a1 '0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*sin(3*pi*(x*y))' 1
-modify a1 '0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))' 2
-subplot 2 2 2:rotate 60 40
-alpha on
-surf a1: box
-
-subplot 2 2 3: rotate 60 40
-dens a1: box
-@end verbatim
-@c ------------------------------------------------------------------
-@node 3D plot sample, Line styles sample, 2D plot sample, Basic features
-@subsection Пример графиков 3D данных
-@cindex Surf
-@cindex Dens
-@cindex Alpha
-@float
-@image{../png/sampleb, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Alpha(true); gr->Light(true); gr->Light(0,mglPoint(0,0,1));
-mglData a(30,30,30), b(30,30,30);
-a.Modify("exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))");
-b.Modify("16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)");
-gr->CAxis(0,1);
-
-gr->SubPlot(2,2,0); gr->Rotate(40,60);
-gr->Surf3(a,"wgk"); gr->Box();
-gr->SubPlot(2,2,1); gr->Rotate(40,60);
-gr->DensA(a); gr->Box(); gr->Axis();
-gr->SubPlot(2,2,2); gr->Rotate(40,60);
-gr->Cloud(a); gr->Box();
-gr->SubPlot(2,2,3); gr->Rotate(40,60);
-gr->Surf3A(b,a,"q"); gr->Box();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-alpha on: light on
-light 0 0 0 1
-new a 30 30 30: new b 30 30 30
-modify a 'exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))'
-modify b '16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)'
-caxis 0 1
-
-subplot 2 2 0: rotate 40 60
-surf3 a 'wgk': box
-subplot 2 2 1: rotate 40 60
-densa a: box: axis
-subplot 2 2 2: rotate 40 60
-cloud a: box
-subplot 2 2 3: rotate 40 60
-surf3a b a 'q': box
-@end verbatim
-@c ------------------------------------------------------------------
-@node Line styles sample, Arrow styles sample, 3D plot sample, Basic features
-@subsection Пример стилей линий и маркеров
-@cindex Mark
-@cindex Line
-@float
-@image{../png/sample5, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-float d,x1,x2,x0,y=0.95;
-d=0.3, x0=0.2, x1=0.5, x2=0.6;
-gr->Line(mglPoint(x0,1-0*d),mglPoint(x1,1-0*d),"k-"); gr->Puts(mglPoint(x2,y-0*d),"Solid '-'","rL");
-gr->Line(mglPoint(x0,1-1*d),mglPoint(x1,1-1*d),"k|"); gr->Puts(mglPoint(x2,y-1*d),"Long Dash '|'","rL");
-gr->Line(mglPoint(x0,1-2*d),mglPoint(x1,1-2*d),"k;"); gr->Puts(mglPoint(x2,y-2*d),"Dash ';'","rL");
-gr->Line(mglPoint(x0,1-3*d),mglPoint(x1,1-3*d),"k="); gr->Puts(mglPoint(x2,y-3*d),"Small dash '='","rL");
-gr->Line(mglPoint(x0,1-4*d),mglPoint(x1,1-4*d),"kj"); gr->Puts(mglPoint(x2,y-4*d),"Dash-dot 'j'","rL");
-gr->Line(mglPoint(x0,1-5*d),mglPoint(x1,1-5*d),"ki"); gr->Puts(mglPoint(x2,y-5*d),"Small dash-dot 'i'","rL");
-gr->Line(mglPoint(x0,1-6*d),mglPoint(x1,1-6*d),"k:"); gr->Puts(mglPoint(x2,y-6*d),"Dots ':'","rL");
-gr->Line(mglPoint(x0,1-7*d),mglPoint(x1,1-7*d),"k "); gr->Puts(mglPoint(x2,y-7*d),"None ' '","rL");
-
-d=0.25; x1=-1; x0=-0.8; y = -0.05;
-gr->Mark(mglPoint(x1,5*d),'.'); gr->Puts(mglPoint(x0,y+5*d),"'.'","rL");
-gr->Mark(mglPoint(x1,4*d),'+'); gr->Puts(mglPoint(x0,y+4*d),"'+'","rL");
-gr->Mark(mglPoint(x1,3*d),'x'); gr->Puts(mglPoint(x0,y+3*d),"'x'","rL");
-gr->Mark(mglPoint(x1,2*d),'*'); gr->Puts(mglPoint(x0,y+2*d),"'*'","rL");
-gr->Mark(mglPoint(x1,d),'s'); gr->Puts(mglPoint(x0,y+d),"'s'","rL");
-gr->Mark(mglPoint(x1,0),'d'); gr->Puts(mglPoint(x0,y),"'d'","rL");
-gr->Mark(mglPoint(x1,-d,0),'o'); gr->Puts(mglPoint(x0,y-d),"'o'","rL");
-gr->Mark(mglPoint(x1,-2*d,0),'^'); gr->Puts(mglPoint(x0,y-2*d),"'\\^'","rL");
-gr->Mark(mglPoint(x1,-3*d,0),'v'); gr->Puts(mglPoint(x0,y-3*d),"'v'","rL");
-gr->Mark(mglPoint(x1,-4*d,0),'<'); gr->Puts(mglPoint(x0,y-4*d),"'<'","rL");
-gr->Mark(mglPoint(x1,-5*d,0),'>'); gr->Puts(mglPoint(x0,y-5*d),"'>'","rL");
-
-d=0.25; x1=-0.5; x0=-0.3; y = -0.05;
-gr->Mark(mglPoint(x1,5*d),'C'); gr->Puts(mglPoint(x0,y+5*d),"'\\#.'","rL");
-gr->Mark(mglPoint(x1,4*d),'P'); gr->Puts(mglPoint(x0,y+4*d),"'\\#+'","rL");
-gr->Mark(mglPoint(x1,3*d),'X'); gr->Puts(mglPoint(x0,y+3*d),"'\\#x'","rL");
-gr->Mark(mglPoint(x1,2*d),'Y'); gr->Puts(mglPoint(x0,y+2*d),"'\\#*'","rL");
-gr->Mark(mglPoint(x1,d),'S'); gr->Puts(mglPoint(x0,y+d),"'\\#s'","rL");
-gr->Mark(mglPoint(x1,0),'D'); gr->Puts(mglPoint(x0,y),"'\\#d'","rL");
-gr->Mark(mglPoint(x1,-d,0),'O'); gr->Puts(mglPoint(x0,y-d),"'\\#o'","rL");
-gr->Mark(mglPoint(x1,-2*d,0),'T'); gr->Puts(mglPoint(x0,y-2*d),"'\\#\\^'","rL");
-gr->Mark(mglPoint(x1,-3*d,0),'V'); gr->Puts(mglPoint(x0,y-3*d),"'\\#v'","rL");
-gr->Mark(mglPoint(x1,-4*d,0),'L'); gr->Puts(mglPoint(x0,y-4*d),"'\\#<'","rL");
-gr->Mark(mglPoint(x1,-5*d,0),'R'); gr->Puts(mglPoint(x0,y-5*d),"'\\#>'","rL");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@c ------------------------------------------------------------------
-@node Arrow styles sample, Text styles sample, Line styles sample, Basic features
-@subsection Пример стилей стрелок
-@cindex Line
-@float
-@image{../png/sampled, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-float a=0.1,b=0.4,c=0.5;
-gr->Line(mglPoint(a,1),mglPoint(b,1),"k-A"); gr->Puts(mglPoint(c,1),"Style 'A' or 'A\\_'","rL");
-gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"k-V"); gr->Puts(mglPoint(c,0.8),"Style 'V' or 'V\\_'","rL");
-gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"k-K"); gr->Puts(mglPoint(c,0.6),"Style 'K' or 'K\\_'","rL");
-gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"k-I"); gr->Puts(mglPoint(c,0.4),"Style 'I' or 'I\\_'","rL");
-gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"k-D"); gr->Puts(mglPoint(c,0.2),"Style 'D' or 'D\\_'","rL");
-gr->Line(mglPoint(a,0),mglPoint(b,0),"k-S"); gr->Puts(mglPoint(c,0),"Style 'S' or 'S\\_'","rL");
-gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"k-O"); gr->Puts(mglPoint(c,-0.2),"Style 'O' or 'O\\_'","rL");
-gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"k-T"); gr->Puts(mglPoint(c,-0.4),"Style 'T' or 'T\\_'","rL");
-gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-_"); gr->Puts(mglPoint(c,-0.6),"Style '\\_' or none","rL");
-gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-AS"); gr->Puts(mglPoint(c,-0.8),"Style 'AS'","rL");
-gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-_A"); gr->Puts(mglPoint(c,-1),"Style '\\_A'","rL");
-
-a=-1; b=-0.7; c=-0.6;
-gr->Line(mglPoint(a,1),mglPoint(b,1),"kAA"); gr->Puts(mglPoint(c,1),"Style 'AA'","rL");
-gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"kVV"); gr->Puts(mglPoint(c,0.8),"Style 'VV'","rL");
-gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"kKK"); gr->Puts(mglPoint(c,0.6),"Style 'KK'","rL");
-gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"kII"); gr->Puts(mglPoint(c,0.4),"Style 'II'","rL");
-gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"kDD"); gr->Puts(mglPoint(c,0.2),"Style 'DD'","rL");
-gr->Line(mglPoint(a,0),mglPoint(b,0),"kSS"); gr->Puts(mglPoint(c,0),"Style 'SS'","rL");
-gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"kOO"); gr->Puts(mglPoint(c,-0.2),"Style 'OO'","rL");
-gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"kTT"); gr->Puts(mglPoint(c,-0.4),"Style 'TT'","rL");
-gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-__"); gr->Puts(mglPoint(c,-0.6),"Style '\\_\\_'","rL");
-gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-VA"); gr->Puts(mglPoint(c,-0.8),"Style 'VA'","rL");
-gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-AV"); gr->Puts(mglPoint(c,-1),"Style 'AV'","rL");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@c ------------------------------------------------------------------
-@node Text styles sample, TeX parsing sample, Arrow styles sample, Basic features
-@subsection Пример стилей текста
-@cindex Puts
-@float
-@image{../png/sample4, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Putsw(mglPoint(0,1),L"Text can be in ASCII and in Unicode");
-gr->Puts(mglPoint(0,0.6),"It can be \\wire{wire}, \\big{big} or #r{colored}");
-gr->Puts(mglPoint(0,0.2),"One can change style in string: "
- "\\b{bold}, \\i{italic, \\b{both}}");
-gr->Puts(mglPoint(0,-0.2),"Easy to \\a{overline} or "
- "\\u{underline}");
-gr->Puts(mglPoint(0,-0.6),"Easy to change indexes ^{up} _{down} @{center}");
-gr->Puts(mglPoint(0,-1),"It parse TeX: \\int \\alpha \\cdot "
- "\\sqrt3{sin(\\pi x)^2 + \\gamma_{i_k}} dx");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-text 0 1 'Text can be in ASCII and in Unicode'
-text 0 0.6 'It can be \wire{wire}, \big{big} or #r{colored}'
-text 0 0.2 'One can change style in string: \b{bold}, \i{italic, \b{both}}'
-text 0 -0.2 'Easy to \a{overline} or \u{underline}'
-text 0 -0.6 'Easy to change indexes ^{up} _{down} @{center}'
-text 0 -1 'It parse TeX: \int \alpha \cdot \sqrt3{sin(\pi x)^2 + \gamma_{i_k}} dx'
-@end verbatim
-@c ------------------------------------------------------------------
-@node TeX parsing sample, Font faces sample, Text styles sample, Basic features
-@subsection Пример TeX формулы
-@cindex Puts
-@float
-@image{../png/samplee, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Puts(mglPoint(0), "\\sqrt{\\frac{\\alpha^{\\gamma^2}+"
- "\\overset 1{\\big\\infty}}{\\sqrt3{2+b}}}", 0, -4);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-text 0 0 '\sqrt{\frac{\alpha^{\gamma^2}+\overset 1{\big\infty}}{\sqrt3{2+b}}}' '' -4
-@end verbatim
-@c ------------------------------------------------------------------
-@node Font faces sample, Colors sample, TeX parsing sample, Basic features
-@subsection Примеры начертаний шрифта
-@cindex Puts
-@float
-@image{../png/fonts, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-float h=1.1, d=0.25;
-gr->LoadFont("STIX"); gr->Puts(mglPoint(0,h), "default font (STIX)");
-gr->LoadFont("adventor"); gr->Puts(mglPoint(0,h-d), "adventor font");
-gr->LoadFont("bonum"); gr->Puts(mglPoint(0,h-2*d), "bonum font");
-gr->LoadFont("chorus"); gr->Puts(mglPoint(0,h-3*d), "chorus font");
-gr->LoadFont("cursor"); gr->Puts(mglPoint(0,h-4*d), "cursor font");
-gr->LoadFont("heros"); gr->Puts(mglPoint(0,h-5*d), "heros font");
-gr->LoadFont("heroscn"); gr->Puts(mglPoint(0,h-6*d), "heroscn font");
-gr->LoadFont("pagella"); gr->Puts(mglPoint(0,h-7*d), "pagella font");
-gr->LoadFont("schola"); gr->Puts(mglPoint(0,h-8*d), "schola font");
-gr->LoadFont("termes"); gr->Puts(mglPoint(0,h-9*d), "termes font");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@c ------------------------------------------------------------------
-@node Colors sample, Color schemes sample, Font faces sample, Basic features
-@subsection Примеры цветов
-@float
-@image{../png/colors, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-//#LENUQ
-gr->FaceZ(-1, -1, 0, 0.4, 0.3, "L#"); gr->Puts(mglPoint(-0.8,-0.9), "L", "C:w", -1.4);
-gr->FaceZ(-0.6, -1, 0, 0.4, 0.3, "E#"); gr->Puts(mglPoint(-0.4,-0.9), "E", "C:w", -1.4);
-gr->FaceZ(-0.2, -1, 0, 0.4, 0.3, "N#"); gr->Puts(mglPoint(0, -0.9), "N", "C:w", -1.4);
-gr->FaceZ(0.2, -1, 0, 0.4, 0.3, "U#"); gr->Puts(mglPoint(0.4,-0.9), "U", "C:w", -1.4);
-gr->FaceZ(0.6, -1, 0, 0.4, 0.3, "Q#"); gr->Puts(mglPoint(0.8,-0.9), "Q", "C:w", -1.4);
-//#lenuq
-gr->FaceZ(-1, -0.7, 0, 0.4, 0.3, "l#"); gr->Puts(mglPoint(-0.8,-0.6), "l", "C:k", -1.4);
-gr->FaceZ(-0.6, -0.7, 0, 0.4, 0.3, "e#"); gr->Puts(mglPoint(-0.4,-0.6), "e", "C:k", -1.4);
-gr->FaceZ(-0.2, -0.7, 0, 0.4, 0.3, "n#"); gr->Puts(mglPoint(0, -0.6), "n", "C:k", -1.4);
-gr->FaceZ(0.2, -0.7, 0, 0.4, 0.3, "u#"); gr->Puts(mglPoint(0.4,-0.6), "u", "C:k", -1.4);
-gr->FaceZ(0.6, -0.7, 0, 0.4, 0.3, "q#"); gr->Puts(mglPoint(0.8,-0.6), "q", "C:k", -1.4);
-//#CMYkP
-gr->FaceZ(-1, -0.4, 0, 0.4, 0.3, "C#"); gr->Puts(mglPoint(-0.8,-0.3), "C", "C:w", -1.4);
-gr->FaceZ(-0.6, -0.4, 0, 0.4, 0.3, "M#"); gr->Puts(mglPoint(-0.4,-0.3), "M", "C:w", -1.4);
-gr->FaceZ(-0.2, -0.4, 0, 0.4, 0.3, "Y#"); gr->Puts(mglPoint(0, -0.3), "Y", "C:w", -1.4);
-gr->FaceZ(0.2, -0.4, 0, 0.4, 0.3, "k#"); gr->Puts(mglPoint(0.4,-0.3), "k", "C:w", -1.4);
-gr->FaceZ(0.6, -0.4, 0, 0.4, 0.3, "P#"); gr->Puts(mglPoint(0.8,-0.3), "P", "C:w", -1.4);
-//#cmywp
-gr->FaceZ(-1, -0.1, 0, 0.4, 0.3, "c#"); gr->Puts(mglPoint(-0.8, 0), "c", "C:k", -1.4);
-gr->FaceZ(-0.6, -0.1, 0, 0.4, 0.3, "m#"); gr->Puts(mglPoint(-0.4, 0), "m", "C:k", -1.4);
-gr->FaceZ(-0.2, -0.1, 0, 0.4, 0.3, "y#"); gr->Puts(mglPoint(0, 0), "y", "C:k", -1.4);
-gr->FaceZ(0.2, -0.1, 0, 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.4, 0), "w", "C:k", -1.4);
-gr->FaceZ(0.6, -0.1, 0, 0.4, 0.3, "p#"); gr->Puts(mglPoint(0.8, 0), "p", "C:k", -1.4);
-//#BGRHW
-gr->FaceZ(-1, 0.2, 0, 0.4, 0.3, "B#"); gr->Puts(mglPoint(-0.8, 0.3), "B", "C:w", -1.4);
-gr->FaceZ(-0.6, 0.2, 0, 0.4, 0.3, "G#"); gr->Puts(mglPoint(-0.4, 0.3), "G", "C:w", -1.4);
-gr->FaceZ(-0.2, 0.2, 0, 0.4, 0.3, "R#"); gr->Puts(mglPoint(0, 0.3), "R", "C:w", -1.4);
-gr->FaceZ(0.2, 0.2, 0, 0.4, 0.3, "H#"); gr->Puts(mglPoint(0.4, 0.3), "H", "C:w", -1.4);
-gr->FaceZ(0.6, 0.2, 0, 0.4, 0.3, "W#"); gr->Puts(mglPoint(0.8, 0.3), "W", "C:w", -1.4);
-//#bgrhw
-gr->FaceZ(-1, 0.2, 0, 0.4, 0.3, "b#"); gr->Puts(mglPoint(-0.8, 0.6), "b", "C:k", -1.4);
-gr->FaceZ(-0.6, 0.5, 0, 0.4, 0.3, "g#"); gr->Puts(mglPoint(-0.4, 0.6), "g", "C:k", -1.4);
-gr->FaceZ(-0.2, 0.2, 0, 0.4, 0.3, "r#"); gr->Puts(mglPoint(0, 0.6), "r", "C:k", -1.4);
-gr->FaceZ(0.2, 0.2, 0, 0.4, 0.3, "h#"); gr->Puts(mglPoint(0.4, 0.6), "h", "C:k", -1.4);
-gr->FaceZ(0.6, 0.2, 0, 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.8, 0.6), "w", "C:k", -1.4);
-//#brighted
-gr->FaceZ(-1, 0.8, 0, 0.4, 0.3, "r1#"); gr->Puts(mglPoint(-0.8, 0.9), "r1", "C:w", -1.4);
-gr->FaceZ(-0.6, 0.8, 0, 0.4, 0.3, "r3#"); gr->Puts(mglPoint(-0.4, 0.9), "r3", "C:w", -1.4);
-gr->FaceZ(-0.2, 0.8, 0, 0.4, 0.3, "r5#"); gr->Puts(mglPoint(0, 0.9), "r5", "C:k", -1.4);
-gr->FaceZ(0.2, 0.8, 0, 0.4, 0.3, "r7#"); gr->Puts(mglPoint(0.4, 0.9), "r7", "C:k", -1.4);
-gr->FaceZ(0.6, 0.8, 0, 0.4, 0.3, "r9#"); gr->Puts(mglPoint(0.8, 0.9), "r9", "C:k", -1.4);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-#LENUQ
-facez -1 -1 0 0.4 0.3 'L#': text -0.8 -0.9 'L' 'C:w'
-facez -0.6 -1 0 0.4 0.3 'E#': text -0.4 -0.9 'E' 'C:w'
-facez -0.2 -1 0 0.4 0.3 'N#': text 0 -0.9 'N' 'C:w'
-facez 0.2 -1 0 0.4 0.3 'U#': text 0.4 -0.9 'U' 'C:w'
-facez 0.6 -1 0 0.4 0.3 'Q#': text 0.8 -0.9 'Q' 'C:w'
-#lenuq
-facez -1 -0.7 0 0.4 0.3 'l#': text -0.8 -0.6 'l' 'C:k'
-facez -0.6 -0.7 0 0.4 0.3 'e#': text -0.4 -0.6 'e' 'C:k'
-facez -0.2 -0.7 0 0.4 0.3 'n#': text 0 -0.6 'n' 'C:k'
-facez 0.2 -0.7 0 0.4 0.3 'u#': text 0.4 -0.6 'u' 'C:k'
-facez 0.6 -0.7 0 0.4 0.3 'q#': text 0.8 -0.6 'q' 'C:k'
-#CMYkP
-facez -1 -0.4 0 0.4 0.3 'C#': text -0.8 -0.3 'C' 'C:w'
-facez -0.6 -0.4 0 0.4 0.3 'M#': text -0.4 -0.3 'M' 'C:w'
-facez -0.2 -0.4 0 0.4 0.3 'Y#': text 0 -0.3 'Y' 'C:w'
-facez 0.2 -0.4 0 0.4 0.3 'k#': text 0.4 -0.3 'k' 'C:w'
-facez 0.6 -0.4 0 0.4 0.3 'P#': text 0.8 -0.3 'P' 'C:w'
-#lenuq
-facez -1 -0.1 0 0.4 0.3 'c#': text -0.8 0 'c' 'C:k'
-facez -0.6 -0.1 0 0.4 0.3 'm#': text -0.4 0 'm' 'C:k'
-facez -0.2 -0.1 0 0.4 0.3 'y#': text 0 0 'y' 'C:k'
-facez 0.2 -0.1 0 0.4 0.3 'w#': text 0.4 0 'w' 'C:k'
-facez 0.6 -0.1 0 0.4 0.3 'p#': text 0.8 0 'p' 'C:k'
-#BGRHW
-facez -1 0.2 0 0.4 0.3 'B#': text -0.8 0.3 'B' 'C:k'
-facez -0.6 0.2 0 0.4 0.3 'G#': text -0.4 0.3 'G' 'C:k'
-facez -0.2 0.2 0 0.4 0.3 'R#': text 0 0.3 'R' 'C:k'
-facez 0.2 0.2 0 0.4 0.3 'H#': text 0.4 0.3 'H' 'C:k'
-facez 0.6 0.2 0 0.4 0.3 'W#': text 0.8 0.3 'W' 'C:k'
-#bgrhw
-facez -1 0.5 0 0.4 0.3 'b#': text -0.8 0.6 'b' 'C:w'
-facez -0.6 0.5 0 0.4 0.3 'g#': text -0.4 0.6 'g' 'C:w'
-facez -0.2 0.5 0 0.4 0.3 'r#': text 0 0.6 'r' 'C:w'
-facez 0.2 0.5 0 0.4 0.3 'h#': text 0.4 0.6 'h' 'C:w'
-facez 0.6 0.5 0 0.4 0.3 'w#': text 0.8 0.6 'w' 'C:w'
-#brighted
-facez -1 0.8 0 0.4 0.3 'r1#': text -0.8 0.9 'r1' 'C:k'
-facez -0.6 0.8 0 0.4 0.3 'r3#': text -0.4 0.9 'r3' 'C:k'
-facez -0.2 0.8 0 0.4 0.3 'r5#': text 0 0.9 'r5' 'C:k'
-facez 0.2 0.8 0 0.4 0.3 'r7#': text 0.4 0.9 'r7' 'C:k'
-facez 0.6 0.8 0 0.4 0.3 'r9#': text 0.8 0.9 'r9' 'C:k'
-@end verbatim
-@c ------------------------------------------------------------------
-@node Color schemes sample, Normal transparency, Colors sample, Basic features
-@subsection Примеры цветовых схем
-@cindex Colorbar
-@float
-@image{../png/color_schemes, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(256,2); a.Fill(-1,1);
-gr->SubPlot(2,10,0,0.2); gr->Dens(a,"kw", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "kw", "C", -8);
-gr->SubPlot(2,10,1,0.2); gr->Dens(a,"wk", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "wk", "C", -8);
-gr->SubPlot(2,10,2,0.2); gr->Dens(a,"kHCcw", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "kHCcw", "C", -8);
-gr->SubPlot(2,10,3,0.2); gr->Dens(a,"kBbcw", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "kBbcw", "C", -8);
-gr->SubPlot(2,10,4,0.2); gr->Dens(a,"kRryw", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "kRryw", "C", -8);
-gr->SubPlot(2,10,5,0.2); gr->Dens(a,"kGgew", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "kGgew", "C", -8);
-gr->SubPlot(2,10,6,0.2); gr->Dens(a,"BbwrR", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "BbwrR", "C", -8);
-gr->SubPlot(2,10,7,0.2); gr->Dens(a,"BbwgG", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "BbwgG", "C", -8);
-gr->SubPlot(2,10,8,0.2); gr->Dens(a,"GgwmM", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "GgwmM", "C", -8);
-gr->SubPlot(2,10,9,0.2); gr->Dens(a,"UuwqR", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "UuwqR", "C", -8);
-gr->SubPlot(2,10,10,0.2); gr->Dens(a,"QqwcC", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "QqwcC", "C", -8);
-gr->SubPlot(2,10,11,0.2); gr->Dens(a,"CcwyY", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "CcwyY", "C", -8);
-gr->SubPlot(2,10,12,0.2); gr->Dens(a,"bcwyr", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "bcwyr", "C", -8);
-gr->SubPlot(2,10,13,0.2); gr->Dens(a,"bwr", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "bwr", "C", -8);
-gr->SubPlot(2,10,14,0.2); gr->Dens(a,"BbcyrR", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR", "C", -8);
-gr->SubPlot(2,10,15,0.2); gr->Dens(a,"UbcyqR", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "UbcyqR", "C", -8);
-gr->SubPlot(2,10,16,0.2); gr->Dens(a,"BbcwyrR", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "BbcwyrR", "C", -8);
-gr->SubPlot(2,10,17,0.2); gr->Dens(a,"bcyr", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "bcyr", "C", -8);
-gr->SubPlot(2,10,18,0.2); gr->Dens(a,"BbcyrR|", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR|", "C", -8);
-gr->SubPlot(2,10,19,0.2); gr->Dens(a,"bgr", nan);
-gr->Puts(mglPoint(-1.4, -0.3), "bgr", "C", -8);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 256 2: fill a 'x'
-subplot 2 10 0 0.2:dens a 'kw'
-text -1.4 -0.3 'kw' '' -8
-subplot 2 10 1 0.2:dens a 'wk'
-text -1.4 -0.3 'wk' '' -8
-subplot 2 10 2 0.2:dens a 'kHCcw'
-text -1.4 -0.3 'kHCcw' '' -8
-subplot 2 10 3 0.2:dens a 'kBbcw'
-text -1.4 -0.3 'kBbcw' '' -8
-subplot 2 10 4 0.2:dens a 'kRryw'
-text -1.4 -0.3 'kRryw' '' -8
-subplot 2 10 5 0.2:dens a 'kGgew'
-text -1.4 -0.3 'kGgew' '' -8
-subplot 2 10 6 0.2:dens a 'BbwrR'
-text -1.4 -0.3 'BbwrR' '' -8
-subplot 2 10 7 0.2:dens a 'BbwgG'
-text -1.4 -0.3 'BbwgG' '' -8
-subplot 2 10 8 0.2:dens a 'GgwmM'
-text -1.4 -0.3 'GgwmM' '' -8
-subplot 2 10 9 0.2:dens a 'UuwqR'
-text -1.4 -0.3 'UuwqR' '' -8
-subplot 2 10 10 0.2:dens a 'QqwcC'
-text -1.4 -0.3 'QqwcC' '' -8
-subplot 2 10 11 0.2:dens a 'CcwyY'
-text -1.4 -0.3 'CcwyY' '' -8
-subplot 2 10 12 0.2:dens a 'bcwyr'
-text -1.4 -0.3 'bcwyr' '' -8
-subplot 2 10 13 0.2:dens a 'bwr'
-text -1.4 -0.3 'bwr' '' -8
-subplot 2 10 14 0.2:dens a 'BbcyrR'
-text -1.4 -0.3 'BbcyrR' '' -8
-subplot 2 10 15 0.2:dens a 'UbcyqR'
-text -1.4 -0.3 'UbcyqR' '' -8
-subplot 2 10 16 0.2:dens a 'BbcwyrR'
-text -1.4 -0.3 'BbcwyrR' '' -8
-subplot 2 10 17 0.2:dens a 'bcyr'
-text -1.4 -0.3 'bcyr' '' -8
-subplot 2 10 18 0.2:dens a 'BbcyrR|'
-text -1.4 -0.3 'BbcyrR|' '' -8
-subplot 2 10 19 0.2:dens a 'bgr'
-text -1.4 -0.3 'bgr' '' -8
-@end verbatim
-@c ------------------------------------------------------------------
-@node Normal transparency, Glass-like transparency, Color schemes sample, Basic features
-@subsection Обычная прозрачность
-@cindex TranspType
-@float
-@image{../png/type0, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Alpha(true); gr->Light(true);
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-
-gr->TranspType = 0; gr->Clf();
-gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box();
-gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box();
-gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box();
-gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-alpha on: light on
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-
-transptype 0: clf
-subplot 2 2 0: rotate 40 60: surf a: box
-subplot 2 2 1: rotate 40 60: dens a: box
-subplot 2 2 2: rotate 40 60: cont a: box
-subplot 2 2 3: rotate 40 60: axial a: box
-@end verbatim
-@c ------------------------------------------------------------------
-@node Glass-like transparency, Lamp-like transparency, Normal transparency, Basic features
-@subsection "Стеклянная" прозрачность
-@cindex TranspType
-@float
-@image{../png/type1, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Alpha(true); gr->Light(true);
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-
-gr->TranspType = 1; gr->Clf();
-gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box();
-gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box();
-gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box();
-gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-alpha on: light on
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-
-transptype 1: clf
-subplot 2 2 0: rotate 40 60: surf a: box
-subplot 2 2 1: rotate 40 60: dens a: box
-subplot 2 2 2: rotate 40 60: cont a: box
-subplot 2 2 3: rotate 40 60: axial a: box
-@end verbatim
-@c ------------------------------------------------------------------
-@node Lamp-like transparency, , Glass-like transparency, Basic features
-@subsection "Ламповая" прозрачность
-@cindex TranspType
-@float
-@image{../png/type2, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Alpha(true); gr->Light(true);
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-
-gr->TranspType = 2; gr->Clf();
-gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box();
-gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box();
-gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box();
-gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-alpha on: light on
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-
-transptype 2: clf
-subplot 2 2 0: rotate 40 60: surf a: box
-subplot 2 2 1: rotate 40 60: dens a: box
-subplot 2 2 2: rotate 40 60: cont a: box
-subplot 2 2 3: rotate 40 60: axial a: box
-@end verbatim
-
-
-
-
-
-
-
-
-
-@c ------------------------------------------------------------------
-@node Additional features, Advanced features, Basic features, Samples
-@section Дополнительные возможности
-@menu
-* Legend sample::
-* Adding mesh sample::
-* Surf & Cont sample::
-* Flow & Dens sample::
-* Several light sample::
-* Mirrored surface sample::
-* Cont with labels sample::
-* Ternary plot sample::
-* Drops sample::
-* Molecules drawing sample::
-@end menu
-@c ------------------------------------------------------------------
-@node Legend sample, Adding mesh sample,, Additional features
-@subsection Legend -- пример использования
-@cindex Plot
-@cindex Legend
-@cindex AddLegend
-@float
-@image{../png/legend, 7cm}
-@c @caption{Example of Legend usage. @tdref{legend}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData f(50,3);
-f.Modify("sin(2*pi*x*x)",0);
-f.Modify("sin(2*pi*x)",1);
-f.Modify("sin(2*pi*sqrt(x))",2);
-gr->Axis(mglPoint(0,-1),mglPoint(1,1));
-gr->Box(); gr->Plot(f); gr->Axis();
-gr->AddLegend("sin(\\pi {x^2})","b");
-gr->AddLegend("sin(\\pi x)","g*");
-gr->AddLegend("sin(\\pi \\sqrt{\\a x})","r+");
-gr->Legend();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new f 50 3
-modify f 'sin(2*pi*x*x)'
-modify f 'sin(2*pi*x)' 1
-modify f 'sin(2*pi*sqrt(x))' 2
-axis 0 -1 1 1
-box
-plot f
-axis
-addlegend 'sin(\pi {x^2})' 'b'
-addlegend 'sin(\pi x)' 'g*'
-addlegend 'sin(\pi \sqrt{\a x})' 'r+'
-legend
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT f = mgl_create_data_size(50,3,1);
-mgl_data_modify(f,"sin(2*pi*x*x)",0);
-mgl_data_modify(f,"sin(2*pi*x)",1);
-mgl_data_modify(f,"sin(2*pi*sqrt(x))",2);
-mgl_set_axis(gr, 0.,-1.,0., 1.,1.,1., 0.,0.,0.);
-mgl_box(gr,1);
-mgl_plot(gr,f,NULL);
-mgl_axis(gr,"xy");
-mgl_add_legend(gr,"sin(\\pi {x^2})","b");
-mgl_add_legend(gr,"sin(\\pi x)","g*");
-mgl_add_legend(gr,"sin(\\pi \\sqrt{\\a x})","r+");
-mgl_legend(gr,3,"rL",-1.,0.1);
-mgl_delete_data(f);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer f, mgl_create_data_size
-f = mgl_create_data_size(50,3,1)
-call mgl_data_modify(f,'sin(2*pi*x*x)',0)
-call mgl_data_modify(f,'sin(2*pi*x)',1)
-call mgl_data_modify(f,'sin(2*pi*sqrt(x))',2)
-call mgl_set_axis(gr, 0.,-1.,0., 1.,1.,1., 0.,0.,0.)
-call mgl_box(gr,1)
-call mgl_plot(gr,f,'')
-call mgl_axis(gr,'xy')
-call mgl_add_legend(gr,'sin(\pi {x^2})','b');
-call mgl_add_legend(gr,'sin(\pi x)','g*');
-call mgl_add_legend(gr,'sin(\pi \sqrt{\a x})','r+');
-call mgl_legend(gr,3,'rL',-1.,0.1);
-call mgl_delete_data(f)
-@end verbatim
-@strong{Python}
-@verbatim
-f = mglData(50,3);
-f.Modify("sin(2*pi*x*x)",0); f.Modify("sin(2*pi*x)",1); f.Modify("sin(2*pi*sqrt(x))",2);
-gr.SetRanges(0,1,-1,1); gr.Box(); gr.Axis(); gr.Plot(f);
-gr.AddLegend("sin(\\pi x^2)","b");
-gr.AddLegend("sin(\\pi x)","g*");
-gr.AddLegend("sin(\\pi\\sqrt{\\a x})","r+");
-gr.Legend();
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Adding mesh sample, Surf & Cont sample, Legend sample, Additional features
-@subsection Добавляем сетку
-@cindex SubPlot
-@cindex Surf
-@cindex Dens
-@cindex Cont
-@cindex Axial
-@float
-@image{../png/samplea, 7cm}
-@c @caption{Example of adding mesh. @tdref{samplea}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Light(true);
-gr->Alpha(true);
-gr->SubPlot(2,2,0); gr->Rotate(40,60);
-gr->Surf(a,"BbcyrR#"); gr->Box();
-gr->SubPlot(2,2,1); gr->Rotate(40,60);
-gr->Dens(a,"BbcyrR#"); gr->Box();
-gr->SubPlot(2,2,2); gr->Rotate(40,60);
-gr->Cont(a,"BbcyrR#"); gr->Box();
-gr->SubPlot(2,2,3); gr->Rotate(40,60);
-gr->Axial(a,"BbcyrR#"); gr->Box();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-alpha on
-light on
-subplot 2 2 0
-rotate 40 60
-surf a 'BbcyrR#'
-box
-subplot 2 2 1
-rotate 40 60
-dens a 'BbcyrR#'
-box
-subplot 2 2 2
-rotate 40 60
-cont a 'BbcyrR#'
-box
-subplot 2 2 3
-rotate 40 60
-axial a 'BbcyrR#'
-box
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_set_alpha(gr,1);
-mgl_set_light(gr,1);
-mgl_subplot(gr,2,2,0); mgl_rotate(gr,40.,60.,0.);
-mgl_surf(gr,a,"BbcyrR#"); mgl_box(gr,1);
-mgl_subplot(gr,2,2,1); mgl_rotate(gr,40.,60.,0.);
-mgl_dens(gr,a,"BbcyrR#",-1.); mgl_box(gr,1);
-mgl_subplot(gr,2,2,2); mgl_rotate(gr,40.,60.,0.);
-mgl_cont(gr,a,"BbcyrR#",7,NAN); mgl_box(gr,1);
-mgl_subplot(gr,2,2,3); mgl_rotate(gr,40.,60.,0.);
-mgl_axial(gr,a,"BbcyrR#",3); mgl_box(gr,1);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-real zero, nan
-zero=0; nan=zero/zero
-a = mgl_create_data_size(50,40,1)
-call mgl_data_modify(a,'0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))',0)
-call mgl_set_alpha(gr,1)
-call mgl_set_light(gr,1)
-call mgl_subplot(gr,2,2,0)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_surf(gr,a,'BbcyrR#')
-call mgl_box(gr,1)
-call mgl_subplot(gr,2,2,1)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_dens(gr,a,'BbcyrR#',-1.)
-call mgl_box(gr,1)
-call mgl_subplot(gr,2,2,2)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_cont(gr,a,'BbcyrR#',7,nan)
-call mgl_box(gr,1)
-call mgl_subplot(gr,2,2,3)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_axial(gr,a,'BbcyrR#',3)
-call mgl_box(gr,1)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Light(True); gr.Alpha(True);
-gr.SubPlot(2,2,0);
-gr.Rotate(40,60); gr.Surf(a,"BbcyrR#"); gr.Box();
-gr.SubPlot(2,2,1);
-gr.Rotate(40,60); gr.Dens(a,"BbcyrR#"); gr.Box();
-gr.SubPlot(2,2,2);
-gr.Rotate(40,60); gr.Cont(a,"BbcyrR#"); gr.Box();
-gr.SubPlot(2,2,3);
-gr.Rotate(40,60); gr.Axial(a,"BbcyrR#"); gr.Box();
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Surf & Cont sample, Flow & Dens sample, Adding mesh sample, Additional features
-@subsection Surf & Cont -- пример использования
-@cindex Surf
-@cindex Cont
-@float
-@image{../png/surf_cont_y, 7cm}
-@c @caption{Example of Surf & Cont. @tdref{surf_cont_y}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Surf(a);
-gr->Cont(a,"y");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-box
-surf a
-cont a 'y'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_cont(gr,a,"y",7,NAN);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-real zero, nan
-zero = 0; nan = zero/zero
-a = mgl_create_data_size(50,40,1)
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_surf(gr,a,'')
-call mgl_cont(gr,a,'y',7,nan)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True);
-gr.Box();
-gr.Surf(a); gr.Cont(a,"y");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Flow & Dens sample, Several light sample, Surf & Cont sample, Additional features
-@subsection Flow & Dens -- пример использования
-@cindex Flow
-@cindex Dens
-@float
-@image{../png/flow_dens, 7cm}
-@c @caption{Example of Flow & Dens. @tdref{flow_dens}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40), b(50,40), d(a);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-d.Modify("sqrt(v^2+w^2)",a,b);
-gr->Box();
-gr->Flow(a,b,"br"); gr->Dens(d,"BbcyrR");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-new b 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-copy d a
-modify d 'sqrt(v^2+w^2)' a b
-box
-flow a b 'br'
-dens d 'BbcyrR'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a, b, d;
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-d = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_data_modify(d,"sqrt(v^2+w^2)",a,b);
-mgl_box(gr,1);
-mgl_flow_2d(gr,a,b,"br",5,1,0.);
-mgl_dens(gr,d,"BbcyrR",-1.);
-mgl_delete_data(a); mgl_delete_data(b); mgl_delete_data(d);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b,d, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-b = mgl_create_data_size(50,40,1);
-d = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_data_modify(d,"sqrt(v^2+w^2)",a,b);
-call mgl_box(gr,1)
-call mgl_flow_2d(gr,a,b,'br',5,1,0.)
-call mgl_dens(gr,d,'BbcyrR',-1.);
-call mgl_delete_data(a)
-call mgl_delete_data(b)
-call mgl_delete_data(d)
-@end verbatim
-@strong{Python}
-@verbatim
-a, b= mglData(50,40), mglData(50,40); d = mglData(a)
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
-d.Modify("sqrt(v^2+w^2)",a,b);
-gr.Box();
-gr.Flow(a,b,"br"); gr.Dens(d,"BbcyrR");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Several light sample, Mirrored surface sample, Flow & Dens sample, Additional features
-@subsection Несколько источников света
-@cindex Surf
-@cindex Light
-@float
-@image{../png/several_light, 7cm}
-@c @caption{Example of Surf with several light. @tdref{several_light}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Light(1,mglPoint(0,1,0),'c');
-gr->Light(2,mglPoint(1,0,0),'y');
-gr->Light(3,mglPoint(0,-1,0),'m');
-gr->Box();
-gr->Surf(a,"h");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-rotate 40 60
-light on
-light 1 0 1 0 'c'
-light 2 1 0 0 'y'
-light 3 0 -1 0 'm'
-box
-surf a 'h'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_add_light_rgb(gr,1,0.,1.,0.,1, 0.,1.,1.,0.5);
-mgl_add_light_rgb(gr,2,1.,0.,0.,1, 1.,1.,0.,0.5);
-mgl_add_light_rgb(gr,3,0.,-1.,0.,1, 1.,0.,1.,0.5);
-mgl_box(gr,1);
-mgl_surf(gr,a,"h");
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_add_light_rgb(gr,1,0.,1.,0.,1, 0.,1.,1.,0.5)
-call mgl_add_light_rgb(gr,2,1.,0.,0.,1, 1.,1.,0.,0.5)
-call mgl_add_light_rgb(gr,3,0.,-1.,0.,1, 1.,0.,1.,0.5)
-call mgl_box(gr,1)
-call mgl_surf(gr,a,'h')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Rotate(40,60); gr.Light(True);
-gr.AddLight(1,0,1,0,"c");
-gr.AddLight(2,1,0,0,"y");
-gr.AddLight(3,0,-1,0,"m");
-gr.Box();
-gr.Surf(a,"h")
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Mirrored surface sample, Cont with labels sample, Several light sample, Additional features
-@subsection Отражение поверхности
-@cindex Surf
-@float
-@image{../png/mirror, 7cm}
-@c @caption{Example of mirrored surface. @tdref{mirror}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(30,40),x(30),y1(40),y2(40);
-a.Modify("pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)");
-x.Fill(-1,1); y1.Fill(0,1); y2.Fill(0,-1);
-gr->Rotate(40,60);
-gr->Light(true);
-gr->Box();
-gr->Surf(x,y1,a,"r"); gr->Surf(x,y2,a,"b");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 30 40
-modify a 'pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)'
-rotate 40 60
-light on
-surf a 'r'; yrange 0 1
-surf a 'b'; yrange 0 -1
-box
-@end verbatim
-or
-@verbatim
-new a 30 40
-var x 30 -1 1
-var y1 40 0 1
-var y2 40 0 -1
-modify a 'pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)'
-rotate 40 60
-light on
-surf x y1 a 'r'
-surf x y2 a 'b'
-box
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a,x,y1,y2;
-a = mgl_create_data_size(30,40,1);
-x = mgl_create_data_size(30,1,1);
-y1 = mgl_create_data_size(40,1,1);
-y2 = mgl_create_data_size(40,1,1);
-mgl_data_modify(a,"pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)",0);
-mgl_data_fill(x,-1.,1.,'x');
-mgl_data_fill(y1,0.,1.,'x');
-mgl_data_fill(y2,0.,-1.,'x');
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_box(gr,1);
-mgl_surf_xy(gr,x,y1,a,"r"); mgl_surf_xy(gr,x,y2,a,"b");
-mgl_delete_data(a); mgl_delete_data(y1);
-mgl_delete_data(x); mgl_delete_data(y2);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,x,y1,y2, mgl_create_data_size
-a = mgl_create_data_size(30,40,1)
-x = mgl_create_data_size(30,1,1)
-y1 = mgl_create_data_size(40,1,1)
-y2 = mgl_create_data_size(40,1,1)
-call mgl_data_modify(a,'pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)',0)
-call mgl_data_fill(x,-1.,1.,'x')
-call mgl_data_fill(y1,0.,1.,'x')
-call mgl_data_fill(y2,0.,-1.,'x')
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_box(gr,1)
-call mgl_surf_xy(gr,x,y1,a,'r')
-call mgl_surf_xy(gr,x,y2,a,'b')
-call mgl_delete_data(a)
-call mgl_delete_data(y1)
-call mgl_delete_data(x)
-call mgl_delete_data(y2)
-@end verbatim
-@strong{Python}
-@verbatim
-a, x, y1, y2 = mglData(30,40), mglData(30), mglData(40), mglData(40);
-a.Modify("pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)");
-x.Fill(-1,1); y1.Fill(0,1); y2.Fill(0,-1);
-gr.Rotate(40,60); gr.Light(True); gr.Box();
-gr.Surf(x,y1,a,"r"); gr.Surf(x,y2,a,"b");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Cont with labels sample, Ternary plot sample, Mirrored surface sample, Additional features
-@subsection Cont и подписи -- пример использования
-@cindex Cont
-@float
-@image{../png/contt, 7cm}
-@c @caption{Example of Cont with labels. @tdref{contt}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Box();
-gr->Cont(a,"BbcyrRt");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-box
-cont a 'BbcyrRt'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_box(gr,1);
-mgl_cont(gr,a,"BbcyrRt",7,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_box(gr,1)
-call mgl_cont(gr,a,'BbcyrRt',7,0)
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Box();
-gr.Cont(a,"BbcyrRt");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Ternary plot sample, Drops sample, Cont with labels sample, Additional features
-@subsection Ternary plot -- пример использования
-@cindex Ternary
-@float
-@image{../png/ternary, 7cm}
-@c @caption{Example of Ternary plot. @tdref{ternary}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData x(50),y(50),rx(10),ry(10), a(20,30);
-a.Modify("4*x*y");
-x.Modify("0.25*(1+cos(2*pi*x))");
-y.Modify("0.25*(1+sin(2*pi*x))");
-rx.Modify("rnd"); ry.Modify("(1-v)*rnd",rx);
-gr->Text(mglPoint(-0.8,1.3), "Ternary plot (x+y+t=1)");
-gr->Ternary(true);
-gr->Plot(x,y,"r2");
-gr->Plot(rx,ry,"q^ ");
-gr->Cont(a);
-gr->Line(mglPoint(0.5,0), mglPoint(0,0.75), "g2");
-gr->Axis(); gr->Grid("xyz","B;");
-gr->Label('x',"x comp.");
-gr->Label('y',"y comp.");
-gr->Label('t',"t comp.");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new rx 10
-new ry 10
-new x 50
-new y 50
-new a 20 30
-modify a '4*x*y'
-modify x '0.25*(1+cos(2*pi*x))'
-modify y '0.25*(1+sin(2*pi*x))'
-modify rx 'rnd'
-modify ry 'rnd*(1-v)' rx
-text -0.8 1.3 'Ternary plot (x+y+t=1)'
-ternary on
-plot x y 'r2'
-plot rx ry 'q^ '
-cont a
-line 0.5 0 0 0.75 'g2'
-axis
-grid 'xyz' 'B;'
-xlabel 'x comp.'
-ylabel 'y comp.'
-tlabel 't comp.'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT x,y,rx,ry,a;
-x = mgl_create_data_size(50,1,1);
-y = mgl_create_data_size(50,1,1);
-rx = mgl_create_data_size(50,1,1);
-ry = mgl_create_data_size(50,1,1);
-a = mgl_create_data_size(20,30,1);
-mgl_data_modify(x,"0.25*(1+cos(2*pi*x))",0);
-mgl_data_modify(y,"0.25*(1+sin(2*pi*x))",0);
-mgl_data_modify(rx,"rnd",0);
-mgl_data_modify_vw(ry,"(1-v)*rnd",rx,0);
-mgl_data_modify(a,"4*x*y",0);
-mgl_puts_ext(gr,-0.8,1.3,0.,"Ternary plot (x+y+t=1)","C",-1.4,'t');
-mgl_set_ternary(gr,1);
-mgl_plot_xy(gr,x,y,"r2");
-mgl_plot_xy(gr,rx,ry,"q^ ");
-mgl_cont(gr,a,"",7,0.);
-mgl_line(gr,0.5,0.,0.,0.,0.75,0.,"g2",2);
-mgl_axis(gr,"xyz");
-mgl_axis_grid(gr,"xyz","B:");
-mgl_label(gr,'x',"x comp");
-mgl_label(gr,'y',"y comp");
-mgl_label(gr,'t',"t comp");
-mgl_delete_data(a);
-mgl_delete_data(x); mgl_delete_data(y);
-mgl_delete_data(rx); mgl_delete_data(ry);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,x,y,rx,ry, mgl_create_data_size
-x = mgl_create_data_size(50,1,1)
-y = mgl_create_data_size(50,1,1)
-rx = mgl_create_data_size(50,1,1)
-ry = mgl_create_data_size(50,1,1)
-a = mgl_create_data_size(20,30,1)
-call mgl_data_modify(x,'0.25*(1+cos(2*pi*x))',0)
-call mgl_data_modify(y,'0.25*(1+sin(2*pi*x))',0)
-call mgl_data_modify(rx,'rnd',0)
-call mgl_data_modify_vw(ry,'(1-v)*rnd',rx,rx)
-call mgl_data_modify(a,'4*x*y',0)
-call mgl_puts_ext(gr,-0.8,1.3,0.,'Ternary plot (x+y+t=1)','C',-1.4,'t')
-call mgl_set_ternary(gr,1)
-call mgl_plot_xy(gr,x,y,'r2')
-call mgl_plot_xy(gr,rx,ry,'q^ ')
-call mgl_cont(gr,a,'',7,0.)
-call mgl_line(gr,0.5,0.,0.,0.,0.75,0.,'g2',2)
-call mgl_axis(gr,'xyz')
-call mgl_axis_grid(gr,'xyz','B:')
-call mgl_label(gr,'x','x comp')
-call mgl_label(gr,'y','y comp')
-call mgl_label(gr,'t','t comp')
-call mgl_delete_data(a)
-call mgl_delete_data(x)
-call mgl_delete_data(y)
-call mgl_delete_data(rx)
-call mgl_delete_data(ry)
-@end verbatim
-@strong{Python}
-@verbatim
-x, y, rx, ry, a = mglData(50), mglData(50), mglData(10), mglData(10), mglData(20,30);
-a.Modify("4*x*y");
-x.Modify("0.25*(1+cos(2*pi*x))"); y.Modify("0.25*(1+sin(2*pi*x))");
-rx.Modify("rnd"); ry.Modify("(1-v)*rnd",rx);
-gr.Puts(-0.8,1.3,0,"Ternary plot (x+y+t=1)","C",-1.4);
-gr.Ternary(True);
-gr.Plot(x,y,"r2"); gr.Plot(rx,ry,"q^ "); gr.Cont(a);
-gr.Line(0.5,0,0,0,0.75,0,"g2");
-gr.Axis(); gr.Grid("xyz","B;");
-gr.Label("x","x comp.");
-gr.Label("y","y comp.");
-gr.Label("t","t comp.");
-@end verbatim
-@end ifclear
-
-@c ------------------------------------------------------------------
-@node Drops sample, Molecules drawing sample, Quaternary plot sample, Additional features
-@subsection Drops -- пример использования
-@cindex Drop
-@float
-@image{../png/drops, 7cm}
-@c @caption{Example of Drop(s). @tdref{drops}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Light(true);
-gr->Puts(mglPoint(-1,1.2),"sh=0");
-gr->Drop(mglPoint(-1,0),mglPoint(0,1),0.5,"r",0);
-gr->Puts(mglPoint(-0.33,1.2),"sh=0.33");
-gr->Drop(mglPoint(-0.33,0),mglPoint(0,1),0.5,"r",0.33);
-gr->Puts(mglPoint(0.33,1.2),"sh=0.67");
-gr->Drop(mglPoint(0.33,0),mglPoint(0,1),0.5,"r",0.67);
-gr->Puts(mglPoint(1,1.2),"sh=1");
-gr->Drop(mglPoint(1,0),mglPoint(0,1),0.5,"r",1);
-gr->Ball(mglPoint(-1,0,1),'k');
-gr->Ball(mglPoint(-0.33,0,1),'k');
-gr->Ball(mglPoint(0.33,0,1),'k');
-gr->Ball(mglPoint(1,0,1),'k');
-gr->Line(mglPoint(-1,0,1),mglPoint(1,0,1),"b");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-light on
-text -1 1.2 'sh=0'
-drop -1 0 0 1 0.5 'r' 0
-text -0.33 1.2 'sh=0.33'
-drop -0.33 0 0 1 0.5 'r' 0.33
-text 0.33 1.2 'sh=0.67'
-drop 0.33 0 0 1 0.5 'r' 0.67
-text 1 1.2 'sh=1'
-drop 1 0 0 1 0.5 'r' 1
-ball -1 0 1 'k'
-ball -0.33 0 1 'k'
-ball 0.33 0 1 'k'
-ball 1 0 1 'k'
-line -1 0 1 1 0 1 'b'
-new h 100
-modify h '0.25*(1+x)^2'
-plot h 'k|'
-text -1 0.6 'h\sim(1+sh)^2' 'rL'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-mgl_set_light(gr,1);
-mgl_puts(gr,-1.,1.2,0.,"sh=0");
-mgl_drop(gr,-1.,0.,0.,0.,1.,0.,0.5,"r",0.,1.);
-mgl_puts(gr,-0.33,1.2,0.,"sh=0.33");
-mgl_drop(gr,-0.33,0.,0.,0.,1.,0.,0.5,"r",0.33,1.);
-mgl_puts(gr,0.33,1.2,0.,"sh=0.67");
-mgl_drop(gr,0.33,0.,0.,0.,1.,0.,0.5,"r",0.67,1.);
-mgl_puts(gr,1.,1.2,0.,"sh=1");
-mgl_drop(gr,1.,0.,0.,0.,1.,0.,0.5,"r",1.,1.);
-mgl_ball_str(gr,-1.,0.,1.,"k");
-mgl_ball_str(gr,-0.33,0.,1.,"k");
-mgl_ball_str(gr,0.33,0.,1.,"k");
-mgl_ball_str(gr,1.,0.,1.,"k");
-mgl_line(gr,-1.,0.,1.,1.,0.,1.,"b",2);
-@end verbatim
-@strong{Fortran}
-@verbatim
-call mgl_set_light(gr,1);
-call mgl_puts(gr,-1.,1.2,0.,"sh=0");
-call mgl_drop(gr,-1.,0.,0.,0.,1.,0.,0.5,"r",0.,1.);
-call mgl_puts(gr,-0.33,1.2,0.,"sh=0.33");
-call mgl_drop(gr,-0.33,0.,0.,0.,1.,0.,0.5,"r",0.33,1.);
-call mgl_puts(gr,0.33,1.2,0.,"sh=0.67");
-call mgl_drop(gr,0.33,0.,0.,0.,1.,0.,0.5,"r",0.67,1.);
-call mgl_puts(gr,1.,1.2,0.,"sh=1");
-call mgl_drop(gr,1.,0.,0.,0.,1.,0.,0.5,"r",1.,1.);
-call mgl_ball_str(gr,-1.,0.,1.,"k");
-call mgl_ball_str(gr,-0.33,0.,1.,"k");
-call mgl_ball_str(gr,0.33,0.,1.,"k");
-call mgl_ball_str(gr,1.,0.,1.,"k");
-call mgl_line(gr,-1.,0.,1.,1.,0.,1.,"b",2);
-@end verbatim
-@strong{Python}
-@verbatim
-gr.Light(True);
-gr.Puts(-1,1.2,0,"sh=0","rC");
-gr.Drop(-1,0,0,0,1,0,0.5,"r",0);
-gr.Puts(-0.33,1.2,0,"sh=0.33","rC");
-gr.Drop(-0.33,0,0,0,1,0,0.5,"r",0.33);
-gr.Puts(0.33,1.2,0,"sh=0.67","rC");
-gr.Drop(0.33,0,0,0,1,0,0.5,"r",0.67);
-gr.Puts(1,1.2,0,"sh=1","rC");
-gr.Drop(1,0,0,0,1,0,0.5,"r",1);
-gr.Ball(-1,0,1,"k"); gr.Ball(-0.33,0,1,"k");
-gr.Ball(0.33,0,1,"k"); gr.Ball(1,0,1,"k");
-gr.Line(-1,0,1,1,0,1,"b");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Molecules drawing sample,, Drops sample, Additional features
-@subsection Рисование молекул
-@cindex Drop
-@cindex Sphere
-@float
-@image{../png/molecule, 7cm}
-@c @caption{Example of molecules drawing. @tdref{molecule}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Alpha(true); gr->Light(true);
-gr->SubPlot(2,2,0);
-gr->Text(mglPoint(0,1.2),"Methane, CH_4",0,-3); gr->Rotate(60,120);
-gr->Sphere(mglPoint(0,0,0),0.25,"k");
-gr->Drop(mglPoint(0,0,0),mglPoint(0,0,1),0.35,"h",1,2);
-gr->Sphere(mglPoint(0,0,0.7),0.25,"g");
-gr->Drop(mglPoint(0,0,0),mglPoint(-0.94,0,-0.33),0.35,"h",1,2);
-gr->Sphere(mglPoint(-0.66,0,-0.23),0.25,"g");
-gr->Drop(mglPoint(0,0,0),mglPoint(0.47,0.82,-0.33),0.35,"h",1,2);
-gr->Sphere(mglPoint(0.33,0.57,-0.23),0.25,"g");
-gr->Drop(mglPoint(0,0,0),mglPoint(0.47,-0.82,-0.33),0.35,"h",1,2);
-gr->Sphere(mglPoint(0.33,-0.57,-0.23),0.25,"g");
-gr->SubPlot(2,2,1);
-gr->Text(mglPoint(0,1.2),"Water, H{_2}O",0,-3); gr->Rotate(60,100);
-gr->Sphere(mglPoint(0,0,0),0.25,"r");
-gr->Drop(mglPoint(0,0,0),mglPoint(0.3,0.5,0),0.3,"m",1,2);
-gr->Sphere(mglPoint(0.3,0.5,0),0.25,"g");
-gr->Drop(mglPoint(0,0,0),mglPoint(0.3,-0.5,0),0.3,"m",1,2);
-gr->Sphere(mglPoint(0.3,-0.5,0),0.25,"g");
-gr->SubPlot(2,2,2);
-gr->Text(mglPoint(0,1.2),"Oxygen, O_2",0,-3); gr->Rotate(60,120);
-gr->Drop(mglPoint(0,0.5,0),mglPoint(0,-0.3,0),0.3,"m",1,2);
-gr->Sphere(mglPoint(0,0.5,0),0.25,"r");
-gr->Drop(mglPoint(0,-0.5,0),mglPoint(0,0.3,0),0.3,"m",1,2);
-gr->Sphere(mglPoint(0,-0.5,0),0.25,"r");
-gr->SubPlot(2,2,3);
-gr->Text(mglPoint(0,1.2),"Ammonia, NH_3",0,-3); gr->Rotate(60,120);
-gr->Sphere(mglPoint(0,0,0),0.25,"b");
-gr->Drop(mglPoint(0,0,0),mglPoint(0.33,0.57,0),0.32,"n",1,2);
-gr->Sphere(mglPoint(0.33,0.57,0),0.25,"g");
-gr->Drop(mglPoint(0,0,0),mglPoint(0.33,-0.57,0),0.32,"n",1,2);
-gr->Sphere(mglPoint(0.33,-0.57,0),0.25,"g");
-gr->Drop(mglPoint(0,0,0),mglPoint(-0.65,0,0),0.32,"n",1,2);
-gr->Sphere(mglPoint(-0.65,0,0),0.25,"g");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-alpha on
-light on
-subplot 2 2 0
-text 0 1.2 'Methane, CH_4' '' -3
-rotate 60 120
-sphere 0 0 0 0.25 'k'
-drop 0 0 0 0 0 1 0.35 'h' 1 2
-sphere 0 0 0.7 0.25 'g'
-drop 0 0 0 -0.94 0 -0.33 0.35 'h' 1 2
-sphere -0.66 0 -0.23 0.25 'g'
-drop 0 0 0 0.47 0.82 -0.33 0.35 'h' 1 2
-sphere 0.33 0.57 -0.23 0.25 'g'
-drop 0 0 0 0.47 -0.82 -0.33 0.35 'h' 1 2
-sphere 0.33 -0.57 -0.23 0.25 'g'
-subplot 2 2 1
-text 0 1.2 'Water, H{_2}O' '' -3
-rotate 60 100
-sphere 0 0 0 0.25 'r'
-drop 0 0 0 0.3 0.5 0 0.3 'm' 1 2
-sphere 0.3 0.5 0 0.25 'g'
-drop 0 0 0 0.3 -0.5 0 0.3 'm' 1 2
-sphere 0.3 -0.5 0 0.25 'g'
-subplot 2 2 2
-text 0 1.2 'Oxygen, O_2' '' -3
-rotate 60 120
-drop 0 0.5 0 0 -0.3 0 0.3 'm' 1 2
-sphere 0 0.5 0 0.25 'r'
-drop 0 -0.5 0 0 0.3 0 0.3 'm' 1 2
-sphere 0 -0.5 0 0.25 'r'
-subplot 2 2 3
-text 0 1.2 0 'Ammonia, NH_3' '' -3
-rotate 60 120
-sphere 0 0 0 0.25 'b'
-drop 0 0 0 0.33 0.57 0 0.32 'n' 1 2
-sphere 0.33 0.57 0 0.25 'g'
-drop 0 0 0 0.33 -0.57 0 0.32 'n' 1 2
-sphere 0.33 -0.57 0 0.25 'g'
-drop 0 0 0 -0.65 0 0 0.32 'n' 1 2
-sphere -0.65 0 0 0.25 'g'
-@end verbatim
-@c ------------------------------------------------------------------
-@node Advanced features,, Additional features, Samples
-@section "Продвинутые" возможности
-@c ------------------------------------------------------------------
-@menu
-* Curvelinear coorinates sample::
-* 2-axes sample::
-* Semi-log sample::
-* Log-log sample::
-* Fitting sample::
-* Envelop sample::
-* Sew sample::
-* STFA sample::
-* PDE sample::
-* Beam tracing sample::
-* Parser sample::
-* Manual ticks sample::
-* ColumnPlot sample::
-* StickPlot sample::
-* Stereo image sample::
-@end menu
-@node Curvelinear coorinates sample, 2-axes sample,, Advanced features
-@subsection Криволинейные координаты
-@cindex Axis
-@float
-@image{../png/sample3, 7cm}
-@c @caption{Example of curvelinear coorinates usage. @tdref{sample3}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Org = mglPoint(-1,1,-1);
-gr->SubPlot(2,2,0); gr->Rotate(60,40);
-gr->Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100);
-gr->Axis(); gr->Grid();
-gr->Text(mglPoint(0,1.3,1),"Cartesian");
-gr->SubPlot(2,2,1); gr->Rotate(60,40);
-gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)");
-gr->Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100);
-gr->Axis(); gr->Grid();
-gr->Text(mglPoint(0,1.3,1),"Cylindrical");
-gr->SubPlot(2,2,2); gr->Rotate(60,40);
-gr->SetFunc("2*y*x","y*y - x*x");
-gr->Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100);
-gr->Axis(); gr->Grid();
-gr->Text(mglPoint(0,1.3,1),"Parabolic");
-gr->SubPlot(2,2,3); gr->Rotate(60,40);
-gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z");
-gr->Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100);
-gr->Axis(); gr->Grid();
-gr->Text(mglPoint(0,1.3,1),"Spiral");
-gr->Axis(0,0,0); // set to default Cartesian
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-origin -1 1 -1
-subplot 2 2 0
-rotate 60 40
-line -1 0.5 0 1 0.5 0 'r2'
-axis
-grid
-text 0 1.3 1 'Cartesian'
-subplot 2 2 1
-rotate 60 40
-axis 'y*sin(pi*x)' 'y*cos(pi*x)' ''
-line -1 0.5 0 1 0.5 0 'r2'
-axis
-grid
-text 0 1.3 1 'Cylindrical'
-subplot 2 2 2
-rotate 60 40
-axis '2*y*x' 'y*y - x*x' ''
-line -1 0.5 0 1 0.5 0 'r2'
-axis
-grid
-text 0 1.3 1 'Parabolic'
-subplot 2 2 3
-rotate 60 40
-axis 'y*sin(pi*x)' 'y*cos(pi*x)' 'x+z'
-line -1 0.5 0 1 0.5 0 'r2'
-axis
-grid
-text 0 1.3 1 'Spiral'
-axis '' '' '' # set to default Cartesian
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-mgl_set_origin(gr,-1,1,-1);
-mgl_subplot(gr,2,2,0); mgl_rotate(gr,60,40,0);
-mgl_line(gr,-1,0.5,0,1,0.5,0,"r2",100);
-mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz","B");
-mgl_text(gr,0,1.3,1,"Cartesian");
-mgl_subplot(gr,2,2,1); mgl_rotate(gr,60,40,0);
-mgl_set_func(gr,"y*sin(pi*x)","y*cos(pi*x)",0);
-mgl_line(gr,-1,0.5,0,1,0.5,0,"r2",100);
-mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz","B");
-mgl_text(gr,0,1.3,1,"Cylindrical");
-mgl_subplot(gr,2,2,2); mgl_rotate(gr,60,40,0);
-mgl_set_func(gr,"2*y*x","y*y - x*x","");
-mgl_line(gr,-1,0.5,0,1,0.5,0,"r2",100);
-mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz","B");
-mgl_text(gr,0,1.3,1,"Parabolic");
-mgl_subplot(gr,2,2,3); mgl_rotate(gr,60,40,0);
-mgl_set_func(gr,"y*sin(pi*x)","y*cos(pi*x)","x+z");
-mgl_line(gr,-1,0.5,0,1,0.5,0,"r2",100);
-mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz","B");
-mgl_text(gr,0,1.3,1,"Spiral");
-mgl_set_func(gr,0,0,0); /* set to default Cartesian */
-@end verbatim
-@strong{Fortran}
-@verbatim
-call mgl_set_origin(gr,-1.,1.,-1.)
-call mgl_subplot(gr,2,2,0)
-call mgl_rotate(gr,60.,40.,0.)
-call mgl_line(gr,-1.,0.5,0.,1.,0.5,0.,'r2',100)
-call mgl_axis(gr,'xyz')
-call mgl_axis_grid(gr,'xyz','B')
-call mgl_text(gr,0.,1.3,1.,'Cartesian')
-call mgl_subplot(gr,2,2,1)
-call mgl_rotate(gr,60.,40.,0.)
-call mgl_set_func(gr,'y*sin(pi*x)','y*cos(pi*x)','')
-call mgl_line(gr,-1.,0.5,0.,1.,0.5,0.,'r2',100)
-call mgl_axis(gr,'xyz')
-call mgl_axis_grid(gr,'xyz','B')
-call mgl_text(gr,0.,1.3,1.,'Cylindrical')
-call mgl_subplot(gr,2,2,2)
-call mgl_rotate(gr,60.,40.,0.)
-call mgl_set_func(gr,'2*y*x','y*y - x*x','')
-call mgl_line(gr,-1.,0.5,0.,1.,0.5,0.,'r2',100)
-call mgl_axis(gr,'xyz')
-call mgl_axis_grid(gr,'xyz','B')
-call mgl_text(gr,0.,1.3,1.,"Parabolic")
-call mgl_subplot(gr,2,2,3)
-call mgl_rotate(gr,60.,40.,0.)
-call mgl_set_func(gr,'y*sin(pi*x)','y*cos(pi*x)','x+z')
-call mgl_line(gr,-1.,0.5,0.,1.,0.5,0.,'r2',100)
-call mgl_axis(gr,'xyz')
-call mgl_axis_grid(gr,'xyz','B')
-call mgl_text(gr,0.,1.3,1.,'Spiral')
-call mgl_set_func(gr,'','','') ! set to default Cartesian
-@end verbatim
-@strong{Python}
-@verbatim
-gr.SetOrigin(-1,1,-1);
-gr.SubPlot(2,2,0); gr.Rotate(60,40);
-gr.Line(-1,0.5,0,1,0.5,0,"r2",100);
-gr.Axis(); gr.Grid();
-gr.Puts(0,1.3,1,"Gartesian","rC",-1.5);
-gr.SubPlot(2,2,1); gr.Rotate(60,40);
-gr.SetFunc("y*sin(pi*x)","y*cos(pi*x)");
-gr.Line(-1,0.5,0,1,0.5,0,"r2",100);
-gr.Axis(); gr.Grid();
-gr.Puts(0,1.3,1,"Cylindrical","rC",-1.5);
-gr.SubPlot(2,2,2); gr.Rotate(60,40);
-gr.SetFunc("2*y*x","y*y-x*x");
-gr.Line(-1,0.5,0,1,0.5,0,"r2",100);
-gr.Axis(); gr.Grid();
-gr.Puts(0,1.3,1,"Parabolic","rC",-1.5);
-gr.SubPlot(2,2,3); gr.Rotate(60,40);
-gr.SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z");
-gr.Line(-1,0.5,0,1,0.5,0,"r2",100);
-gr.Axis(); gr.Grid();
-gr.Puts(0,1.3,1,"Spiral","rC",-1.5);
-gr.SetFunc("",""); # set to default Gartesian
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node 2-axes sample, Semi-log sample, Curvelinear coorinates sample, Advanced features
-@subsection Несколько осей на одном графике
-@cindex Axis
-@float
-@image{../png/2_axis, 7cm}
-@c @caption{Example of 2 axes on the plot. @tdref{2_axis}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData y1(50), y2(50);
-y1.Modify("0.3*sin(2*pi*x)"); y2.Modify("0.5+0.3*cos(2*pi*x)");
-gr->Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(-1,-1,-1));
-gr->Axis(); gr->Label('y',"axis 1",0);
-gr->Plot(y1,"b");
-gr->Axis(mglPoint(0,0,0),mglPoint(1,1,1),mglPoint(1,1,1));
-gr->Axis(); gr->Label('y',"axis 2",0);
-gr->Stem(y2,"r");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new y1 50
-new y2 50
-modify y1 '0.3*sin(2*pi*x)'
-modify y2 '0.5+0.3*cos(2*pi*x)'
-axis -1 -1 -1 1 1 1
-origin -1 -1 -1
-axis
-ylabel 'axis 1' 0
-plot y1 'b'
-axis 0 0 0 1 1 1
-origin 1 1 1
-axis
-ylabel 'axis 2' 0
-stem y2 'r'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT y1 = mgl_create_data_size(50,1,1);
-HMDT y2 = mgl_create_data_size(50,1,1);
-mgl_data_modify(y1,"0.3*sin(2*pi*x)",0);
-mgl_data_modify(y2,"0.5+0.3*cos(2*pi*x)",0);
-mgl_set_axis_2d(gr,-1.,1.,-1.,1.);
-mgl_set_origin(gr,-1.,-1.,-1.);
-mgl_axis(gr,"xyz");
-mgl_label_ext(gr,'y',"axis 1",0,-1.4,0.);
-mgl_plot(gr,y1,"b");
-mgl_set_axis_2d(gr,0.,0.,1.,1.);
-mgl_set_origin(gr,1.,1.,1.);
-mgl_axis(gr,"xyz");
-mgl_label_ext(gr,'y',"axis 2",0,-1.4,0.);
-mgl_stem(gr,y2,"r");
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer y1,y2, mgl_create_data_size
-y1 = mgl_create_data_size(50,1,1)
-y2 = mgl_create_data_size(50,1,1)
-call mgl_data_modify(y1,'0.3*sin(2*pi*x)',0)
-call mgl_data_modify(y2,'0.5+0.3*cos(2*pi*x)',0)
-call mgl_set_axis_2d(gr,-1.,1.,-1.,1.)
-call mgl_set_origin(gr,-1.,-1.,-1.)
-call mgl_axis(gr,'xyz')
-call mgl_label_ext(gr,'y','axis 1',0,-1.4,0.)
-call mgl_plot(gr,y1,'b')
-call mgl_set_axis_2d(gr,0.,0.,1.,1.)
-call mgl_set_origin(gr,1.,1.,1.)
-call mgl_axis(gr,'xyz')
-call mgl_label_ext(gr,'y','axis 2',0,-1.4,0.)
-call mgl_stem(gr,y2,'r')
-@end verbatim
-@strong{Python}
-@verbatim
-y1, y2 = mglData(50), mglData(50);
-y1.Modify("0.3*sin(2*pi*x)"); y2.Modify("0.5+0.3*cos(2*pi*x)");
-gr.SetRanges(-1,1,-1,1); gr.SetOrigin(-1,-1);
-gr.Axis(); gr.Label("y","axis 1",0);
-gr.Plot(y1,"b");
-gr.SetRanges(0,1,0,1); gr.SetOrigin(1,1);
-gr.Axis(); gr.Label("y","axis 2",0);
-gr.Stem(y2,"r");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Semi-log sample, Log-log sample, 2-axes sample, Advanced features
-@subsection Semi-log -- пример использования
-@cindex Axis
-@cindex SetTicks
-@cindex Plot
-@float
-@image{../png/semilog, 7cm}
-@c @caption{Example of semi-log plot. @tdref{semilog}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData x(2000), y(2000);
-x.Modify("0.01/(x+10^(-5))"); y.Modify("sin(1/v)",x);
-gr->Axis(mglPoint(0.01,-1),mglPoint(1000,1),mglPoint(0.01,-1));
-gr->SetFunc("lg(x)",0); gr->SetTicks('x',0);
-gr->Box();
-gr->Plot(x,y,"b2");
-gr->Axis(); gr->Grid("xy","g");
-gr->Label('x',"x",0); gr->Label('y', "y = sin 1/x",0);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new x 2000
-new y 2000
-modify x '0.01/(x+10^(-5))'
-modify y 'sin(1/v)' x
-xrange 0.01 1000
-origin 0.01 -1 0
-xtick 0
-axis 'lg(x)' '' ''
-plot x y 'b2'
-axis
-grid 'xy' 'g'
-xlabel 'x' 0
-ylabel 'y = sin 1/x' 0
-box
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT x = mgl_create_data_size(2000,1,1);
-HMDT y = mgl_create_data_size(2000,1,1);
-mgl_data_modify(x,"0.01/(x+10^(-5))",0);
-mgl_data_modify_vw(y,"sin(1/v)",x,0);
-mgl_set_axis(gr,0.01,-1.,0.,1000.,1.,0.,0.01,-1.,0.);
-mgl_set_func(gr,"lg(x)",0,0);
-mgl_set_ticks(gr,0.,-5.,-5.);
-mgl_box(gr,1);
-mgl_plot_xy(gr,x,y,"b2");
-mgl_axis(gr,"xy"); mgl_axis_grid(gr,"xy","g");
-mgl_label_ext(gr,'x',"x",0,-1.4,0);
-mgl_label_ext(gr,'y', "y = sin 1/x",0,-1.4,0);
-mgl_delete_data(x); mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer x,y, mgl_create_data_size
-x = mgl_create_data_size(2000,1,1)
-y = mgl_create_data_size(2000,1,1)
-call mgl_data_modify(x,'0.01/(x+10^(-5))',0)
-call mgl_data_modify_vw(y,'sin(1/v)',x,x)
-call mgl_set_axis(gr,0.01,-1.,0.,1000.,1.,0.,0.01,-1.,0.)
-call mgl_set_func(gr,'lg(x)','','')
-call mgl_set_ticks(gr,0.,-5.,-5.)
-call mgl_box(gr,1)
-call mgl_plot_xy(gr,x,y,'b2')
-call mgl_axis(gr,'xy')
-call mgl_axis_grid(gr,'xy','g')
-call mgl_label_ext(gr,'x','x',0.,-1.4,0.)
-call mgl_label_ext(gr,'y', 'y = sin 1/x',0.,-1.4,0.)
-call mgl_delete_data(x)
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-TO BE DONE
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Log-log sample, Fitting sample, Semi-log sample, Advanced features
-@subsection Log-log -- пример использования
-@cindex Axis
-@cindex SetTicks
-@cindex Plot
-@float
-@image{../png/loglog, 7cm}
-@c @caption{Example of log-log plot. @tdref{loglog}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData x(100), y(100);
-x.Modify("pow(10,6*x-3)"); y.Modify("sqrt(1+v^2)",x);
-gr->Axis(mglPoint(0.001,0.1),mglPoint(1000,1000),mglPoint(0.001,0.1));
-gr->SetFunc("lg(x)","lg(y)");
-gr->SetTicks('x',0); gr->SetTicks('y',0);
-gr->Box();
-gr->Plot(x,y,"b2");
-gr->Axis(); gr->Grid("xy","g;");
-gr->Label('x',"x",0); gr->Label('y', "y=\\sqrt{1+x^2}",0);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new x 100
-new y 100
-modify x 'pow(10,6*x-3)'
-modify y 'sqrt(1+v^2)' x
-axis 0.001 0.1 1000 1000
-xtick 0
-ytick 0
-axis 'lg(x)' 'lg(y)' ''
-plot x y 'b2'
-axis
-grid 'xy' 'g;'
-xlabel 'x' 0
-ylabel 'y=\sqrt{1+x^2}' 0
-box
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT x = mgl_create_data_size(100,1,1);
-HMDT y = mgl_create_data_size(100,1,1);
-mgl_data_modify(x,"pow(10,6*x-3)",0);
-mgl_data_modify_vw(y,"sqrt(1+v^2)",x,0);
-mgl_set_axis(gr,0.001,0.1,0.,1000.,1000.,0.,0.001,0.1,0.);
-mgl_set_func(gr,"lg(x)","lg(y)",0);
-mgl_set_ticks(gr,0.,0.,-5.);
-mgl_box(gr,1);
-mgl_plot_xy(gr,x,y,"b2");
-mgl_axis(gr,"xy"); mgl_axis_grid(gr,"xy","g;");
-mgl_label_ext(gr,'x',"x",0,-1.4,0);
-mgl_label_ext(gr,'y', "y=\\sqrt{1+x^2}",0,-1.4,0);
-mgl_delete_data(x); mgl_delete_data(y);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer x,y, mgl_create_data_size
-x = mgl_create_data_size(100,1,1)
-y = mgl_create_data_size(100,1,1)
-call mgl_data_modify(x,'pow(10,6*x-3)',0)
-call mgl_data_modify_vw(y,'sqrt(1+v^2)',x,x)
-call mgl_set_axis(gr,0.001,0.1,0.,1000.,1000.,0.,0.001,0.1,0.)
-call mgl_set_func(gr,'lg(x)','lg(y)','')
-call mgl_set_ticks(gr,0.,0.,-5.)
-call mgl_box(gr,1)
-call mgl_plot_xy(gr,x,y,'b2')
-call mgl_axis(gr,'xy')
-call mgl_axis_grid(gr,'xy','g;')
-call mgl_label_ext(gr,'x','x',0.,-1.4,0)
-call mgl_label_ext(gr,'y', 'y=\sqrt{1+x^2}',0.,-1.4,0)
-call mgl_delete_data(x)
-call mgl_delete_data(y)
-@end verbatim
-@strong{Python}
-@verbatim
-x, y = mglData(100), mglData(100);
-x.Modify("pow(10,6*x-3)"); y.Modify("sqrt(1+v^2)",x);
-gr.SetRanges(0.001,1000,0.1,1000); gr.SetOrigin(0.001,0.1);
-gr.SetFunc("lg(x)","lg(y)");
-gr.SetTicks("x",0); gr.SetTicks("y",0);
-gr.Box(); gr.Plot(x,y,"b2");
-gr.Axis(); gr.Grid("xy","g;");
-gr.Label("x","x",0); gr.Label("y","y=\\sqrt{1+x^2}",0);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Fitting sample, Envelop sample, Log-log sample, Advanced features
-@subsection Fitting -- пример использования
-@cindex Fit
-@cindex PutsFit
-@float
-@image{../png/fit, 7cm}
-@c @caption{Example of nonlinear fitting. @tdref{fit}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData rnd(100), in(100), res;
-rnd.Fill("0.4*rnd+0.1+sin(2*pi*x)", gr->Min, gr->Max);
-in.Fill("0.3+sin(2*pi*x)", gr->Min, gr->Max);
-gr->Axis(mglPoint(-1,-2), mglPoint(1,2));
-gr->Plot(rnd, ". ");
-gr->Box();
-float ini[3] = {1,1,3};
-gr->Fit(res, rnd, "a+b*sin(c*x)", "abc", ini);
-gr->Plot(res, "r");
-gr->Plot(in, "b");
-gr->Text(mglPoint(-1, -1.3), "fitted:", "L:r", -1);
-gr->PutsFit(mglPoint(0, -1.8), "y = ", "C:r", -1);
-gr->Text(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "C:b", -1);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new rnd 100
-fill rnd '0.4*rnd+0.1+sin(2*pi*x)'
-new in 100
-fill in '0.3+sin(2*pi*x)'
-yrange -2 2
-plot rnd '. '
-box
-list ini 1 1 3
-fit res rnd 'a+b*sin(c*x)' 'abc' ini
-plot res 'r'
-plot in 'b'
-text -1 -1.3 'fitted:' 'L:r' -1
-putsfit 0 -1.8 'y = ' 'C:r'
-text 0 2.2 'initial: y = 0.3+sin(2\pi x)' 'C:b' -1
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT rnd,in,res;
-float ini[3] = {1,1,3};
-rnd = mgl_create_data_size(100,1,1);
-in = mgl_create_data_size(100,1,1);
-res = mgl_create_data();
-mgl_data_modify(rnd,"0.4*rnd+0.1+sin(4*pi*x)",0);
-mgl_data_modify(in,"0.3+sin(4*pi*x)",0);
-mgl_set_axis_2d(gr,-1.,-2.,1.,2.);
-mgl_plot(gr,rnd,". ");
-mgl_box(gr,1);
-mgl_fit_1(gr,res,rnd,"a+b*sin(c*x)","abc",ini);
-mgl_plot(gr,res,"r"); mgl_plot(gr,in,"b");
-mgl_puts_ext(gr,-1.,-1.3,0.,"fitted:","L:r",-1.,'t');
-mgl_puts_fit(gr,0.,-1.8,0.,"y = ","C:r",-1.);
-mgl_puts_ext(gr,0.,2.2,0.,"initial: y = 0.3+sin(2\\pi x)","C:b", -1., 't');
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer rnd,in,res, mgl_create_data_size
-real ini(3)
-ini(1)=1; ini(2)=1; ini(3)=3;
-rnd = mgl_create_data_size(100,1,1);
-in = mgl_create_data_size(100,1,1);
-res = mgl_create_data();
-call mgl_data_modify(rnd,"0.4*rnd+0.1+sin(4*pi*x)",0);
-call mgl_data_modify(in,"0.3+sin(4*pi*x)",0);
-call mgl_set_axis_2d(gr,-1.,-2.,1.,2.);
-call mgl_plot(gr,rnd,". ");
-call mgl_box(gr,1);
-call mgl_fit_1(gr,res,rnd,"a+b*sin(c*x)","abc",ini);
-call mgl_plot(gr,res,"r");
-call mgl_plot(gr,in,"b");
-call mgl_puts_ext(gr,-1.,-1.3,0.,"fitted:","L:r",-1.,'t');
-call mgl_puts_fit(gr,0.,-1.8,0.,"y = ","C:r",-1.);
-call mgl_puts_ext(gr,0.,2.2,0.,"initial: y = 0.3+sin(2\\pi x)","C:b", -1., 't');
-@end verbatim
-@strong{Python}
-@verbatim
-rnd, In, res, ini = mglData(100), mglData(100), mglData(), mglData(3);
-rnd.Modify("0.4*rnd+0.1+sin(4*pi*x)");
-In.Modify("0.3+sin(4*pi*x)");
-gr.SetRanges(-1,1,-2,2);
-gr.Plot(rnd,". ");
-gr.Box();
-ini[0], ini[1], ini[2] = 1, 1, 3;
-gr.Fit(res,rnd,"a+b*sin(c*x)","abc",ini);
-gr.Plot(res,"r"); gr.Plot(In,"b");
-gr.Puts(-1,-1.3,0,"fitted:","L:r",-1);
-gr.PutsFit(0,-1.8,0,"y = ","C:r",-1);
-gr.Puts(0,2.2,0,"initial: y = 0.3+sin(2\\pi x)","C:b",-1);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Envelop sample, Sew sample, Fitting sample, Advanced features
-@subsection Envelop -- пример использования
-@cindex Envelop
-@float
-@image{../png/envelop, 7cm}
-@c @caption{Example of envelop reconstruction.}@c @tdref{envelop}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(1000);
-a.Fill("exp(-8*x^2)*sin(10*pi*x)", gr->Min, gr->Max);
-gr->Plot(a, "b");
-a.Envelop('x');
-gr->Plot(a, "r");
-gr->Axis();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 1000
-fill a 'exp(-8*x^2)*sin(10*pi*x)'
-plot a 'b'
-envelop a
-plot a 'r'
-axis
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(1000,1,1);
-mgl_data_fill_eq(gr,a, "exp(-8*x^2)*sin(10*pi*x)", 0,0);
-mgl_plot(gr,a,"b");
-mgl_data_envelop(a,'x');
-mgl_plot(gr,a,"r");
-mgl_axis(gr,"xyz");
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(1000,1,1)
-call mgl_data_fill_eq(gr,a, 'exp(-8*x^2)*sin(10*pi*x)', 0,0)
-call mgl_plot(gr,a,'b')
-call mgl_data_envelop(a,'x')
-call mgl_plot(gr,a,'r')
-call mgl_axis(gr,'xyz')
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(1000);
-gr.Fill(a, "exp(-8*x^2)*sin(10*pi*x)");
-gr.Plot(a,"b");
-a.Envelop("x");
-gr.Plot(a,"r");
-gr.Axis();
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Sew sample, STFA sample, Envelop sample, Advanced features
-@subsection Sew -- пример использования
-@cindex Sew
-@float
-@image{../png/sew, 7cm}
-@c @caption{Example of phase ``sewing''.}@c @tdref{sew}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(100, 100);
-a.Modify("mod((y^2-(1-x)^2)/2,0.1)");
-gr->Rotate(40, 60);
-gr->Light(true);
-gr->Alpha(true);
-gr->Surf(a, "b");
-a.Sew("xy", 0.1);
-gr->Surf(a, "r");
-gr->Box();
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 100 100
-modify a 'mod((y^2-(1-x)^2)/2,0.1)'
-rotate 40 60
-light on
-alpha on
-surf a 'b'
-sew a 'xy' 0.1
-surf a 'r'
-box
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(100,100,1);
-mgl_data_modify(a, "mod((y^2-(1-x)^2)/2, 0.1)", 0);
-mgl_rotate(gr,40.,60.,0.);
-mgl_set_light(gr,1);
-mgl_set_alpha(gr,1);
-mgl_surf(gr,a,"b");
-mgl_data_sew(a,"xy",0.1);
-mgl_surf(gr,a,"r");
-mgl_box(gr,1);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(100,100,1)
-call mgl_data_modify(a, 'mod((y^2-(1-x)^2)/2, 0.1)', 0)
-call mgl_rotate(gr,40.,60.,0.)
-call mgl_set_light(gr,1)
-call mgl_set_alpha(gr,1)
-call mgl_surf(gr,a,'b')
-call mgl_data_sew(a,'xy',0.1)
-call mgl_surf(gr,a,'r')
-call mgl_box(gr,1)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(100, 100);
-a.Modify("mod((y^2-(1-x)^2)/2, 0.1)");
-gr.Rotate(40, 60); gr.Light(True); gr.Alpha(True);
-gr.Surf(a, "b");
-a.Sew("xy", 0.1);
-gr.Surf(a, "r");
-gr.Box();
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node STFA sample, PDE sample, Sew sample, Advanced features
-@subsection STFA -- пример использования
-@cindex STFA
-@float
-@image{../png/stfa, 7cm}
-@c @caption{Example of Short Time Fourier Analysis.}@c @tdref{stfa}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(2000), b(2000);
-a.Fill("cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+ \
- cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)",
- gr->Min, gr->Max);
-gr->SubPlot(1, 2, 0);
-gr->Plot(a);
-gr->Axis();
-gr->Label('x', "\\i t");
-gr->SubPlot(1, 2, 1);
-gr->STFA(a, b, 64);
-gr->Axis();
-gr->Label('x', "\\i t");
-gr->Label('y', "\\omega", 0);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 2000
-new b 2000
-fill a 'cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+
- cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)'
-subplot 1 2 0
-plot a
-axis
-xlabel '\i t'
-subplot 1 2 1
-stfa a b 64 ''
-axis
-ylabel '\omega' 0
-xlabel '\i t'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(2000,1,1);
-HMDT b = mgl_create_data_size(2000,1,1);
-mgl_data_fill_eq(gr, a, "cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+ \
- cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)",0,0);
-mgl_subplot(gr,1,2,0);
-mgl_plot(gr,a,"");
-mgl_axis(gr,"xy");
-mgl_label(gr,'x', "\\i t");
-mgl_subplot(gr,1,2,1);
-mgl_stfa(gr,a,b,64,"",0.);
-mgl_axis(gr,"xy");
-mgl_label(gr,'x', "\\i t");
-mgl_label(gr,'y', "\\omega");
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,b, mgl_create_data_size
-a = mgl_create_data_size(2000,1,1)
-b = mgl_create_data_size(2000,1,1)
-call mgl_data_fill_eq(gr, a, 'cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+ &
- cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)',0,0)
-call mgl_subplot(gr,1,2,0)
-call mgl_plot(gr,a,'')
-call mgl_axis(gr,'xy')
-call mgl_label(gr,'x', '\i t')
-call mgl_subplot(gr,1,2,1)
-call mgl_stfa(gr,a,b,64,'',0.)
-call mgl_axis(gr,'xy')
-call mgl_label(gr,'x', '\i t')
-call mgl_label(gr,'y', '\omega')
-@end verbatim
-@strong{Python}
-@verbatim
-a, b = mglData(2000), mglData(2000);
-gr.Fill(a,"cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+ \
- cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)");
-gr.SubPlot(1, 2, 0);
-gr.Plot(a);
-gr.Axis();
-gr.Label('x', "\\i t");
-gr.SubPlot(1, 2, 1);
-gr.STFA(a, b, 64);
-gr.Axis();
-gr.Label('x', "\\i t");
-gr.Label('y', "\\omega", 0);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node PDE sample, Beam tracing sample, STFA sample, Advanced features
-@subsection PDE -- пример использования
-@cindex mglPDE
-@cindex mglRay
-@float
-@image{../png/pde, 7cm}
-@c @caption{Example of Partial Differential Eduation solving.}@c @tdref{pde}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a,re(128),im(128);
-gr->Axis();
-gr->Label('x', "\\i x");
-gr->Label('y', "\\i z");
-
-re.Fill("exp(-48*(x+0.7)^2)", gr->Min, gr->Max);
-a = mglPDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, gr->Min, gr->Max, 0.01, 30);
-a.Transpose("yxz");
-gr->CAxis(0, 1);
-gr->Dens(a,"wyrRk");
-gr->Plot("-x", "k|");
-gr->Puts(mglPoint(0, 0.85), "absorption: (x+z)/2 for x+z>0");
-gr->Title("\\r{Equation:} ik_0\\partial_zu + \\Delta u + x\\cdot u + \
-i \\frac{x+z}{2}\\cdot u = 0", "iC", -1.5);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-axis
-xlabel '\i x'
-ylabel '\i z'
-new re 128
-new im 128
-fill re 'exp(-48*(x+0.7)^2)'
-pde a 'p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)' re im 0.01 30
-transpose a
-crange 0 1
-dens a 'wyrRk'
-fplot '-x' 'k|'
-text 0 0.85 'absorption: (x+z)/2 for x+z>0' '' -1
-title 'Equation: ik_0\partial_zu + \Delta u + x\cdot u + i \frac{x+z}{2}\cdot u = 0' 'iC' -1.5
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data();
-HMDT re = mgl_create_data_size(128,1,1);
-HMDT im = mgl_create_data_size(128,1,1);
-mgl_axis(gr,"xyz");
-mgl_label(gr,'x', "\\i x");
-mgl_label(gr,'y', "\\i z");
-mgl_data_fill_eq(gr,re,"exp(-48*(x+0.7)^2)", 0, 0);
-a = mgl_pde_solve(gr, "p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, 0.01, 30.);
-mgl_data_transpose(a, "yxz");
-mgl_set_caxis(gr, 0, 1);
-mgl_dens(gr, a,"wyrRk", -1.);
-mgl_fplot(gr, "-x", "k|", 100);
-mgl_puts(gr, 0., 0.85, 0., "absorption: (x+z)/2 for x+z>0");
-mgl_title(gr, "\\r{Equation:} ik_0\\partial_zu + \\Delta u + x\\cdot u + \
-i \\frac{x+z}{2}\\cdot u = 0", "iC", -1.5);
-mgl_delete_data(a);
-mgl_delete_data(im);
-mgl_delete_data(re);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a,re,im, mgl_create_data_size
-a = mgl_create_data()
-re = mgl_create_data_size(128,1,1)
-im = mgl_create_data_size(128,1,1)
-call mgl_axis(gr,'xyz')
-call mgl_label(gr,'x', '\i x')
-call mgl_label(gr,'y', '\i z')
-call mgl_data_fill_eq(gr,re,'exp(-48*(x+0.7)^2)', 0, 0)
-a = mgl_pde_solve(gr, 'p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)', re, im, 0.01, 30.)
-call mgl_data_transpose(a, 'yxz')
-call mgl_set_caxis(gr, 0., 1.)
-call mgl_dens(gr, a,'wyrRk', -1.)
-call mgl_fplot(gr, '-x', 'k|', 100)
-call mgl_puts(gr, 0., 0.85, 0., 'absorption: (x+z)/2 for x+z>0')
-call mgl_title(gr, '\r{Equation:} ik_0\partial_zu + \Delta u + x\cdot u + &
-i \frac{x+z}{2}\cdot u = 0', 'iC', -1.5)
-call mgl_delete_data(a)
-call mgl_delete_data(im)
-call mgl_delete_data(re)
-@end verbatim
-@strong{Python}
-@verbatim
-a, re, im = mglData(), mglData(128), mglData(128);
-gr.Axis();
-gr.Label('x', "\\i x");
-gr.Label('y', "\\i z");
-
-gr.Fill(re,"exp(-48*(x+0.7)^2)");
-a = gr.PDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, 0.01, 30);
-a.Transpose("yxz");
-gr.SetCRange(0, 1);
-gr.Dens(a,"wyrRk");
-gr.Plot("-x", "k|");
-gr.Puts(0, 0.85, 0., "absorption: (x+z)/2 for x+z>0");
-gr.Title("\\r{Equation:} ik_0\\partial_zu + \\Delta u + x\\cdot u + \
-i \\frac{x+z}{2}\\cdot u = 0", "iC", -1.5);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Beam tracing sample, Parser sample, PDE sample, Advanced features
-@subsection Beam tracing -- пример использования
-@cindex mglQO2d
-@cindex mglRay
-@float
-@image{../png/qo2d, 7cm}
-@c @caption{Example of ray and beam tracing. Compare with @ref{PDE sample}.}@c @tdref{qo2d}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData r, xx, yy, a, im(128), re(128);
-const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)";
-r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2);
-gr->Plot(r.SubData(0), r.SubData(1), "k");
-gr->Axis(); gr->Label('x', "\\i x"); gr->Label('y', "\\i z");
-// now start beam tracing
-re.Fill("exp(-48*x^2)", gr->Min, gr->Max);
-a = mglQO2d(ham, re, im, r, 1, 30, &xx, &yy);
-gr->CAxis(0, 1);
-gr->Dens(xx, yy, a, "wyrRk");
-gr->Plot("-x", "k|");
-gr->Puts(mglPoint(0, 0.85), "absorption: (x+y)/2 for x+y>0");
-gr->Puts(mglPoint(0.7, -0.05), "central ray");
-gr->Title("Beam and ray tracing", "C", -1.5);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-define $1 'p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)'
-ray r $1 -0.7 -1 0 0 0.5 0 0.02 2
-plot r(0) r(1) 'k'
-axis
-xlabel '\i x'
-ylabel '\i z'
-new re 128
-new im 128
-new xx
-new yy
-fill re 'exp(-48*x^2)'
-qo2d a $1 re im r 1 30 xx yy
-crange 0 1
-dens xx yy a 'wyrRk'
-fplot '-x' 'k|'
-text -0.8 0.85 'absorption: (x+y)/2 for x+y>0' 'L' -1
-text 0.5 -0.05 'central ray' 'L' -1
-title 'Beam and ray tracing' 'C' -1.5
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)";
-HMDT r, xx, yy, a, im, re;
-im = mgl_create_data_size(128,1,1);
-re = mgl_create_data_size(128,1,1);
-r = mgl_ray_trace(ham, -0.7, -1., 0., 0., 0.5, 0., 0.02, 2.);
-xx = mgl_data_subdata(r,0,-1,-1);
-yy = mgl_data_subdata(r,1,-1,-1);
-mgl_plot_xy(gr, xx, yy, "k");
-mgl_axis(gr,"xyz");
-mgl_label(gr,'x',"\\i x");
-mgl_label(gr,'y',"\\i z");
-mgl_data_fill_eq(gr,re,"exp(-48*x^2)", 0, 0);
-a = mgl_qo2d_solve(ham, re, im, r, 1, 30, xx, yy);
-mgl_set_caxis(gr,0.,1.);
-mgl_dens_xy(gr,xx, yy, a, "wyrRk", -1.);
-mgl_fplot(gr,"-x", "k|",100);
-mgl_puts(gr, 0., 0.85, 0., "absorption: (x+y)/2 for x+y>0");
-mgl_puts(gr, 0.7, -0.05, 0., "central ray");
-mgl_title(gr, "Beam and ray tracing", "C", -1.5);
-mgl_delete_data(a); mgl_delete_data(r);
-mgl_delete_data(xx); mgl_delete_data(yy);
-mgl_delete_data(im); mgl_delete_data(re);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer r, xx, yy, a, im, re, mgl_create_data_size
-integer mgl_data_subdata, mgl_ray_trace, mgl_qo2d_solve
-character*64 ham
-ham = 'p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)'
-im = mgl_create_data_size(128,1,1)
-re = mgl_create_data_size(128,1,1)
-r = mgl_ray_trace(ham, -0.7, -1., 0., 0., 0.5, 0., 0.02, 2.)
-xx = mgl_data_subdata(r,0,-1,-1)
-yy = mgl_data_subdata(r,1,-1,-1)
-call mgl_plot_xy(gr, xx, yy, 'k')
-call mgl_axis(gr,'xyz')
-call mgl_label(gr,'x','\i x')
-call mgl_label(gr,'y','\i z')
-call mgl_data_fill_eq(gr,re,'exp(-48*x^2)', 0, 0)
-a = mgl_qo2d_solve(ham, re, im, r, 1., 30., xx, yy)
-call mgl_set_caxis(gr,0.,1.)
-call mgl_dens_xy(gr,xx, yy, a, 'wyrRk', -1.)
-call mgl_fplot(gr,'-x', 'k|',100)
-call mgl_puts(gr, 0., 0.85, 0., 'absorption: (x+y)/2 for x+y>0')
-call mgl_puts(gr, 0.7, -0.05, 0., 'central ray')
-call mgl_title(gr, 'Beam and ray tracing', 'C', -1.5)
-call mgl_delete_data(a)
-call mgl_delete_data(r)
-call mgl_delete_data(xx)
-call mgl_delete_data(yy)
-call mgl_delete_data(im)
-call mgl_delete_data(re)
-@end verbatim
-@strong{Python}
-@verbatim
-ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)";
-r, xx, yy, a = mglData(), mglData(), mglData(), mglData();
-im, re = mglData(128), mglData(128);
-r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2);
-gr.Plot(r.SubData(0), r.SubData(1), "k");
-gr.Axis(); gr.Label('x', "\\i x"); gr.Label('y', "\\i z");
-gr.Fill(re,"exp(-48*x^2)");
-a = mglQO2d(ham, re, im, r, 1, 30, xx, yy);
-gr.SetCRange(0, 1);
-gr.Dens(xx, yy, a, "wyrRk");
-gr.Plot("-x", "k|");
-gr.Puts(0, 0.85, 0, "absorption: (x+y)/2 for x+y>0");
-gr.Puts(0.7, -0.05, 0, "central ray");
-gr.Title("Beam and ray tracing", "C", -1.5);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Parser sample, Manual ticks sample, Beam tracing sample, Advanced features
-@subsection Parser -- пример использования
-@cindex mglParse
-@ifclear UDAV
-@float
-@image{../png/parser, 7cm}
-@c @caption{Example of MGL parsing.}@c @tdref{parser}}
-@end float
-@strong{C++ код}
-@verbatim
-float a[100]; // let a_i = sin(4*pi*x), x=0...1
-for(int i=0;i<100;i++) a[i]=sin(4*M_PI*i/99);
-mglParse *parser = new mglParse;
-mglData &d = (parser->AddVar("dat"))->d;
-d.Set(a,100); // set data to variable
-parser->Execute(gr, "plot dat; xrange 0 1\nbox\naxis");
-// you may break script at any line do something
-// and continue after that
-parser->Execute(gr, "xlabel 'x'\nylabel 'y'\nbox");
-// also you may use cycles or conditions in script
-parser->Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext");
-@end verbatim
-@strong{MGL скрипт}
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@strong{C-ый код}
-@verbatim
-float a[100]; /* let a_i = sin(4*pi*x), x=0...1 */
-int i;
-for(i=0;i<100;i++) a[i]=sin(4*M_PI*i/99);
-HMPR parser = mgl_create_parser();
-HMDT d = mgl_add_var(parser, "dat");
-mgl_data_set_float(d,a,100,1,1); /* set data to variable */
-mgl_parse_text(gr, parser, "plot dat; xrange 0 1\nbox\naxis");
-/* you may break script at any line do something
- and continue after that */
-mgl_parse_text(gr, parser, "xlabel 'x'\nylabel 'y'");
-/* also you may use cycles or conditions in script */
-mgl_parse_text(gr, parser, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext");
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer i,parser,d, mgl_create_data_size, mgl_create_parser
-real a(100)
-! let a_i = sin(4*pi*x), x=0...1
-do i = 1,100
- a(i)=sin(4*3.1415926*(i-1)/99)
-end do
-parser = mgl_create_parser()
-d = mgl_add_var(parser, "dat")
-call mgl_data_set_real(d,a,100,1,1) ! set data to variable
-! I don't know how put new line ('\n') into fortran string
-! So call mgl_parse_text() for each string :(
-call mgl_parse_text(gr, parser, "plot dat; xrange 0 1")
-call mgl_parse_text(gr, parser, "box")
-call mgl_parse_text(gr, parser, "axis")
-! you may break script at any line do something
-! and continue after that
-call mgl_parse_text(gr, parser, "xlabel 'x'")
-call mgl_parse_text(gr, parser, "ylabel 'y'")
-! there is now conditions because I don't know
-! how to send several string into parser at once :(
-!! also you may use cycles or conditions in script
-!call mgl_parse_text(gr, parser, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext")
-@end verbatim
-@strong{Python}
-You may need to use @code{from numpy import *} for defining functions like @code{sin()}.
-@verbatim
-parser = mglParse();
-dat = parser.AddVar("dat");
-dat.Create(100);
-for i in range(100):
- dat[i] = sin(4*pi*i/99);
-parser.Execute(gr, "plot dat; xrange 0 1\nbox\naxis");
-# you may break script at any line do something
-# and continue after that
-parser.Execute(gr, "xlabel 'x'\nylabel 'y'");
-# also you may use cycles or conditions in script
-parser.Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext");
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Manual ticks sample, ColumnPlot sample, Parser sample, Advanced features
-@subsection Особые метки по осям
-@cindex SetTicksVal
-@float
-@image{../png/tval, 7cm}
-@c @caption{Example of manual tick values.}@c @tdref{tval}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->Axis(mglPoint(-M_PI, 0), mglPoint(M_PI, 2));
-gr->SetTicksVal('x', 6, -M_PI, "-\\pi", -M_PI/2, "-\\pi/2", 0., "0",
- 0.886, "x^*", M_PI/2, "\\pi/2", M_PI, "\\pi");
-gr->Axis(); gr->Grid();
-gr->Plot("2*cos(x^2)^2", "r2", NAN, 300);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-axis -pi 0 pi 2
-xtick -pi '-\pi' -1.571 '-\pi/2' 0 '0' 0.886 'x^*' 1.571 '\pi/2' pi '\pi'
-axis
-grid
-fplot '2*cos(x^2)^2' 'r2' nan 300
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-mgl_set_axis_2d(gr, -M_PI, 0, M_PI, 2);
-mgl_set_ticks_val(gr, 'x', 6, -M_PI, "-\\pi", -M_PI/2, "-\\pi/2",
- 0., "0", 0.886, "x^*", M_PI/2, "\\pi/2", M_PI, "\\pi");
-mgl_axis(gr,"xyz");
-mgl_axis_grid(gr,"xyz", "B-");
-mgl_fplot(gr, "2*cos(x^2)^2", "r2", 300);
-@end verbatim
-@strong{Fortran}
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@strong{Python}
-@verbatim
-gr.SetRanges(-pi, pi, 0, 2);
-parser = mglParse();
-# very "stupid" way because SWIG not support variable arguments
-parser.Execute(gr, "xtick -pi '-\pi' -1.571 '-\pi/2' 0 '0' "
- "0.886 'x^*' 1.571 '\pi/2' pi '\pi'");
-gr.Axis(); gr.Grid();
-gr.Plot("2*cos(x^2)^2", "r2", 300);
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node ColumnPlot sample, StickPlot sample, Manual ticks sample, Advanced features
-@subsection ColumnPlot -- пример использования
-@cindex SetTicksVal
-@float
-@image{../png/column, 7cm}
-@c @caption{Example of ColumnPlot.}@c @tdref{tval}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-char str[32];
-for(int i=0;i<4;i++)
-{
- gr->ColumnPlot(4,i);
- gr->Box();
- sprintf(str,"Plot %d of 4",i);
- gr->Text(mglPoint(-0.5,0.5),str);
- sprintf(str,"sin(pi*x+pi*%d/2)",i);
- gr->Plot(str);
-}
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-for $1 0 3
-columnplot 4 $1
-box
-text -0.5 0.5 'Plot $1 of 4'
-fplot 'sin(pi*x+pi*$1/2)'
-next
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-int i;
-char str[32];
-for(i=0;i<4;i++)
-{
- mgl_columnplot(gr,4,i);
- mgl_box(gr,1);
- sprintf(str,"Plot %d of 4",i);
- mgl_text(gr,-0.5,0.5,0.,str);
- sprintf(str,"sin(pi*x+pi*%d/2)",i);
- mgl_fplot(gr,str,"",100);
-}
-@end verbatim
-@strong{Fortran}
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@strong{Python}
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node StickPlot sample, , ColumnPlot sample, Advanced features
-@subsection StickPlot -- пример использования
-@cindex SetTicksVal
-@float
-@image{../png/stick, 7cm}
-@c @caption{Example of StickPlot.}@c @tdref{tval}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-gr->SetRanges(-1, 1, -1, 1, 0, 1); gr->Light(true);
-gr->StickPlot(3, 0, 40, 30); gr->Axis("xyz_");
-gr->Surf("exp(-10*y^2-6*x^2)");
-gr->Text(mglPoint(0.2, 0, 1.2), "z=0", "", -2);
-gr->StickPlot(3, 1, 40, 30); gr->Axis("xyz_");
-gr->Surf("exp(-10*y^2/2-6*x^2)/sqrt(2)");
-gr->Text(mglPoint(0.2, 0, 1.2), "z=1", "", -2);
-gr->StickPlot(3, 2, 40, 30); gr->Axis("xyz_");
-gr->Surf("exp(-10*y^2/5-6*x^2)/sqrt(5)");
-gr->Text(mglPoint(0.2, 0, 1.2), "z=2", "", -2);
-gr->Label('x',"\\tau", 0); gr->Label('y', "\\rho");
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-ranges -1 1 -1 1 0 1:light on
-stickplot 3 0 40 30 : axis 'xyz_'
-fsurf 'exp(-10*y^2-6*x^2)'
-text 0.2 0 1.2 'z=0' '' -2
-stickplot 3 1 40 30 : axis 'xy_'
-fsurf 'exp(-10*y^2/2-6*x^2)/sqrt(2)'
-text 0.2 0 1.2 'z=1' '' -2
-stickplot 3 2 40 30 : axis 'xy_'
-fsurf 'exp(-10*y^2/5-6*x^2)/sqrt(5)'
-text 0.2 0 1.2 'z=2' '' -2
-xlabel '\tau' 0 : ylabel '\rho'
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-mgl_set_axis_3d(gr, -1, -1, 0, 1, 1, 1);
-mgl_set_light(gr, 1);
-mgl_stickplot(gr, 3, 0, 40, 30);
-mgl_axis(gr, "xyz_");
-mgl_fsurf(gr,"exp(-10*y^2-6*x^2)","",100);
-mgl_text(gr, 0.2, 0, 1.2, "z=0");
-mgl_stickplot(gr, 3, 1, 40, 30);
-mgl_axis(gr, "xyz_");
-mgl_fsurf(gr,"exp(-10*y^2/2-6*x^2)/sqrt(2)","",100);
-mgl_text(gr, 0.2, 0, 1.2, "z=1");
-mgl_stickplot(gr, 3, 2, 40, 30);
-mgl_axis(gr, "xyz_");
-mgl_fsurf(gr,"exp(-10*y^2/5-6*x^2)/sqrt(5)","",100);
-mgl_text(gr, 0.2, 0, 1.2, "z=2");
-mgl_label(gr,'x',"\\tau");
-mgl_label(gr,'y', "\\rho");
-@end verbatim
-@strong{Fortran}
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@strong{Python}
-@verbatim
-NOT AVAILABLE
-@end verbatim
-@end ifclear
-@c ------------------------------------------------------------------
-@node Stereo image sample, , StickPlot sample, Advanced features
-@subsection Пример стерео изображения
-@float
-@image{../png/stereo, 7cm}
-@c @caption{Example of stereo image.}@c @tdref{stereo}}
-@end float
-@ifclear UDAV
-@strong{C++ код}
-@verbatim
-mglData a(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
-gr->Light(true);
-gr->SubPlot(2,1,0);
-gr->Rotate(40,60+3);
-gr->Box(); gr->Surf(a);
-gr->SubPlot(2,1,1);
-gr->Rotate(40,60-3);
-gr->Box(); gr->Surf(a);
-@end verbatim
-@strong{MGL скрипт}
-@end ifclear
-@verbatim
-new a 50 40
-modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
-light on
-subplot 2 1 0
-rotate 40 60+3
-box:surf a
-subplot 2 1 1
-rotate 40 60-3
-box:surf a
-@end verbatim
-@ifclear UDAV
-@strong{C-ый код}
-@verbatim
-HMDT a = mgl_create_data_size(50,40,1);
-mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-mgl_set_light(gr,1);
-mgl_subplot(gr,2,1,0);
-mgl_rotate(gr,40.,60.+3.,0.);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_subplot(gr,2,1,1);
-mgl_rotate(gr,40.,60.-3.,0.);
-mgl_box(gr,1);
-mgl_surf(gr,a,0);
-mgl_delete_data(a);
-@end verbatim
-@strong{Fortran}
-@verbatim
-integer a, mgl_create_data_size
-a = mgl_create_data_size(50,40,1);
-call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
-call mgl_set_light(gr,1)
-call mgl_subplot(gr,2,1,0)
-call mgl_rotate(gr,40.,60.+3.,0.)
-call mgl_box(gr,1)
-call mgl_surf(gr,a,'')
-call mgl_subplot(gr,2,1,1)
-call mgl_rotate(gr,40.,60.-3.,0.)
-call mgl_box(gr,1)
-call mgl_surf(gr,a,'')
-call mgl_delete_data(a)
-@end verbatim
-@strong{Python}
-@verbatim
-a = mglData(50,40);
-a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
-gr.Light(True);
-gr.SubPlot(2,1,0);
-gr.Rotate(40,60+3);
-gr.Surf(a); gr.Box();
-gr.SubPlot(2,1,1);
-gr.Rotate(40,60-3);
-gr.Surf(a); gr.Box();
-@end verbatim
-@end ifclear
-
@end deftypefn
@deftypefn {Method on @code{mglWindow}} @code{void} ReLoad ()
@deftypefnx {C function} @code{int} mgl_wnd_reload (@code{HMGL} gr)
-Reload user data and update picture.
+Reload user data and update picture. This function also update number of frames which drawing function can create.
@end deftypefn
@deftypefn {Method on @code{mglWindow}} @code{void} Adjust ()
@deftypefnx {C function} @code{int} mgl_wnd_adjust (@code{HMGL} gr)
Sets delay for animation in seconds. Default value is 1 sec.
@end deftypefn
-@deftypefn {Method on @code{mglWindow}} @code{void} Setup (@code{bool} autoclf, @code{bool} showpos, @code{bool} clfupd)
-@deftypefnx {C function} @code{int} mgl_setup_window (@code{HMGL} gr, @code{bool} autoclf, @code{bool} showpos, @code{bool} clfupd)
+@deftypefn {Method on @code{mglWindow}} @code{void} Setup (@code{bool} clfupd=@code{true}, @code{bool} showpos=@code{false})
+@deftypefnx {C function} @code{int} mgl_setup_window (@code{HMGL} gr, @code{bool} clfupd, @code{bool} showpos)
Enable/disable flags for:
@itemize @bullet
@item
-clearing canvas between drawing. You may switch it off for accumulate previous drawing (for example some points or parts of a picture).
+clearing plot before Update();
@item
showing the last mouse click position in the widget.
-@item
-clearing plot before Update().
@end itemize
@end deftypefn
Class is FLTK widget which display MathGL graphics (defined in @code{#include <mgl/fltk.h>}).
-@float
-@image{../fltk, 7cm}
-@caption{Example of FLTK window with MathGL plot.}
-@end float
+@fig{fltk, Example of FLTK window with MathGL plot.}
@deftypemethod Fl_MathGL @code{void} set_draw (@code{int} (*draw)(@code{HMGL} gr, @code{void *}p))
@deftypemethodx Fl_MathGL @code{void} set_draw (@code{int} (*draw)(@code{mglGraph *}gr))
Class is Qt widget which display MathGL graphics (defined in @code{#include <mgl/qt.h>}).
-@float
-@image{../qt, 7cm}
-@caption{Example of Qt window with MathGL plot.}
-@end float
+@fig{qt, Example of Qt window with MathGL plot.}
@deftypemethod QMathGL @code{void} setDraw (@code{mglDraw *}dr)
Sets drawing functions from a class inherited from @code{mglDraw}.
-============= TEST =============
-
-1. MGL testing system ???
-2. test pthread for windows
-3. Check export to MGLD/X3D.
-4. add XInitThreads() from #include <X11/Xlib.h> into all GUI
-5. Check MGLD in mglview
-6. check Hankel()
-7. check Chart() -- '#' style + missing face!!!
+http://ubuntuforums.org/showthread.php?t=1862084
+Device 0 (VID=0502 and PID=337d) is UNKNOWN.
============= NEW =============
-1.Export to X3D and VRML
+1. Add sample for window in python/octave (like pthread) -- Docs
+2. Add help about cmake into the "Installation and using" -- after build system will be ready
+3. Export to X3D
============= FOR V.2.1 ========
1. MPI_Send(), MPI_Recv()
2. Use Hershey as built-in font ?!!
3. Import/Export via GIF (as 3d data) ???
-4. Read DICOM files.
+4. Read DICOM files ???
5. Export to JavaScript (WebGL)
6. GTK and WX window/widgets
7. Labels at TriCont()
18. emulate fog in EPS/SVG
19. line segment losses in EPS ???
-20. ReadHDF5 -- add string argument for handling lowest dimension (like complex numbers): "sum" - sum, "arg" - arg, "0...9" read slice 0...9, "abs" - sqrt(sum []^2)
-21. Change if possible long to size_t (be very accurate!!!)
-22. Add mglDataC for complex data -- main diff is reading/saving data
+20. Add mglDataC for complex data -- main diff is reading/saving data
+21. MGL testing system ???
============= UDAV =============
6. Pool of threads for speeding up ???
7. Drops as mglPrim -- not accurate but smaller memory and faster
8. Text aspect ratio in OpenGL mode
-
-============= DOCS =============
-
-1. Write "Quick start" userguide
-2. FAQ about sizes of plot (parametrical+inverted, or Min*Max)
-3. FAQ about MinGW -- http://www.mingw.org/wiki/FAQ
-4. MGL docs -- text what formulas are applicable for scalars too.
-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:
- * MPI level -- Combine()
- * MathGL level -- pthread in mglData, ???
-12. Boxs() styles: '#' for wire, '@' for full box.
-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.
-16. Symbol '!' denote sharp colors even in 1d plots (like different colors for points)
-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.
-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. Cones() -- like Bars() but by Cone(). Support 'a' for above.
-27. Add Class diagram for MathGL core
-
-============= BUGS =============
-
-1. утилиты (mgl2png и пр.) вылетают, если в коментариях русские буквы
-
-========= Docs structure =======
-
-+ 1. Overview
-+ 1.1 What is MathGL?
-+ 1.2 Installation
-+ 1.3 Quick start
- 1.4 Changes from v.1.*
- 1.5 Utilities
- 1.6 Thanks
-
-+ 2. Examples
-+ 2.1 Basic usage (window; file; memory; QMathGL; Fl_MathGL; PyQt)
-----add sample for window in python/octave (like pthread)
-+ 2.2 Advanced usage (subplots; axis; curv.coor; text)
-+ 2.3 Data handling
-+ 2.4 Data plotting
-+ 2.5 1D data plotting
-+ 2.6 2D data plotting
-+ 2.7 3D data plotting
- 2.8 Dual data plotting
- 2.9 Hints
- 2.10 FAQ
-
-+ 3. General concepts (class-diagram)
-+ 3.1 Coordinate axes
-+ 3.2 Color styles
-+ 3.3 Line styles
-+ 3.4 Color scheme
-+ 3.5 Font styles
-+ 3.6 Textual formulas
-+ 3.7 Command options
-+ 3.8 Interfaces (c++/python; c/fortran; mgl)
-
-+ 4. MathGL core
-+ 4.1 Create and delete objects
-+ 4.2 Graphics setup
-+ 4.3 Axis settings
-+ 4.4 Transformation matrix
-+ 4.5 Export picture
-+ 4.6 Primitives drawing
-+ 4.7 Text printing
-+ 4.8 Axis and Colorbar
- 4.9 Legend
- 4.10 1D plotting
- 4.11 2D plotting
- 4.12 3D plotting
- 4.13 Dual plotting
- 4.14 Vector fields
- 4.15 Other plotting
- 4.16 Nonlinear fitting
- 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
-
- 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)
if(sel.isEmpty()) return;
wchar_t *txt=new wchar_t[sel.length()+1];
sel.toWCharArray(txt); txt[sel.length()]=0;
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mglData res=mglFormulaCalc(txt, &parser);
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
// result->setText(QString::fromWCharArray(txt));
delete []txt;
result->setText(QString::number(res.GetVal(0)));
bool dd=0;
if(rA->isChecked()) // auto sizes
{
- setlocale(LC_ALL, "C"); v->d.Read(file.toAscii().constData()); setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "C"); v->d.Read(file.toAscii().constData()); setlocale(LC_NUMERIC, "");
if(v->d.nx==1) { v->d.nx = v->d.ny; v->d.ny = v->d.nz; }
code=QString("#read %1 '%2'\n").arg(data).arg(file);
}
else if(rM->isChecked()) // manual sizes
{
int x=nx->text().toInt(), y=ny->text().toInt(), z=nz->text().toInt();
- setlocale(LC_ALL, "C"); v->d.Read(file.toAscii().constData(),x,y,z); setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "C"); v->d.Read(file.toAscii().constData(),x,y,z); setlocale(LC_NUMERIC, "");
code=QString("#read %1 '%2' %3 %4 %5\n").arg(data).arg(file).arg(x).arg(y).arg(z);
}
else if(r2->isChecked()) // matrix
{
- setlocale(LC_ALL, "C"); v->d.ReadMat(file.toAscii().constData()); setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "C"); v->d.ReadMat(file.toAscii().constData()); setlocale(LC_NUMERIC, "");
code=QString("#readmat %1 '%2'\n").arg(data).arg(file); dd=1;
}
else if(r3->isChecked()) // 3d-data
{
- setlocale(LC_ALL, "C"); v->d.ReadMat(file.toAscii().constData(),3); setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "C"); v->d.ReadMat(file.toAscii().constData(),3); setlocale(LC_NUMERIC, "");
code=QString("#readmat %1 '%2' 3\n").arg(data).arg(file); dd=2;
}
if(scr->lineEdit()->text().isEmpty() || scr->lineEdit()->text()==tr("default"))
#include <stdio.h>\r
#include <string.h>\r
#include <locale.h>\r
+#include <unistd.h>\r
#include "mgl/mgl.h"\r
void mgl_error_print(const char *Message, void *par);\r
void mgl_ask_gets(const wchar_t *quest, wchar_t *res);\r
//-----------------------------------------------------------------------------\r
-int main(int narg, char **arg)\r
+int main(int argc, char *argv[])\r
{\r
mglGraph gr;\r
mglParse p(true);\r
-\r
- long i,j=-1,k=-1;\r
- unsigned long n;\r
- for(i=1;i<narg;i++) // add arguments for the script\r
+ char ch, buf[2048], iname[256]="", oname[256]="";\r
+ std::vector<std::wstring> var;\r
+ \r
+ register long i,n;\r
+ while(1)\r
{\r
- if(arg[i][0]=='-' && arg[i][1]>='0' && arg[i][1]<='9')\r
- p.AddParam(arg[i][1]-'0',arg[i]+2);\r
- if(arg[i][0]=='-' && arg[i][1]=='L')\r
- setlocale(LC_CTYPE, arg[i]+2);\r
- if(arg[i][0]=='-' && (arg[i][1]=='h' || (arg[i][1]=='-' && arg[i][2]=='h')))\r
+ ch = getopt(argc, argv, "1:2:3:4:5:6:7:8:9:ho:L:C:A:");\r
+ if(ch>='1' && ch<='9') p.AddParam(ch-'0', optarg);\r
+ else if(ch=='L') setlocale(LC_CTYPE, optarg);\r
+ else if(ch=='A')\r
{\r
- printf("mglconv convert mgl script to bitmap png file.\n");\r
- printf("Current version is 2.%g\n",MGL_VER2);\r
- printf("Usage:\tmglconv scriptfile [outputfile parameter(s)]\n");\r
- printf("\tParameters have format \"-Nval\".\n");\r
- printf("\tHere N=0,1...9 is parameter ID and val is its value.\n");\r
- printf("\tOption -Lval set locale to val.\n");\r
+ std::wstring str;\r
+ for(i=0;optarg[i];i++) str.push_back(optarg[i]);\r
+ var.push_back(str);\r
}\r
- if(arg[i][0]!='-' && j<0) j=i;\r
- if(arg[i][0]!='-' && j>0) k=i;\r
+ else if(ch=='C')\r
+ {\r
+ double v1,v2,dv=1,v;\r
+ int res=sscanf(optarg,"%lg:%lg:%lg",&v1,&v2,&dv);\r
+ if(res<3) dv=1;\r
+ wchar_t num[64];\r
+ for(v=v1;v<=v2;v+=dv)\r
+ {\r
+ mglprintf(num,64,L"%g",v);\r
+ var.push_back(num);\r
+ }\r
+ }\r
+ else if(ch=='h' || (ch==-1 && optind>=argc))\r
+ {\r
+ printf("mglconv convert mgl script to bitmap png file.\nCurrent version is 2.%g\n",MGL_VER2);\r
+ printf("Usage:\tmglconv [parameter(s)] scriptfile\n");\r
+ printf(\r
+ "\t-1 str set str as argument $1 for script\n"\r
+ "\t... ...\n"\r
+ "\t-9 str set str as argument $9 for script\n"\r
+ "\t-L loc set locale to loc\n"\r
+ "\t-o name set output file name\n"\r
+ "\t- get script from standard input\n"\r
+ "\t-A val add animation value val\n"\r
+ "\t-C n1:n2:dn add animation value in range [n1,n2] with step dn\n"\r
+ "\t-C n1:n2 add animation value in range [n1,n2] with step 1\n"\r
+ "\t- get script from standard input\n"\r
+ "\t-h print this message\n" );\r
+ ch = 'h'; break;\r
+ }\r
+ else if(ch=='o') strcpy(oname, optarg);\r
+ else if(ch==-1 && optind<argc)\r
+ { strcpy(iname, argv[optind][0]=='-'?"":argv[optind]); break; }\r
}\r
+ if(ch=='h') return 0;\r
+ if(*oname==0) { strcpy(oname,*iname?iname:"out"); strcat(oname,".png"); }\r
+ \r
mgl_ask_func = mgl_ask_gets;\r
// prepare for animation\r
std::wstring str;\r
- FILE *fp = j>0?fopen(arg[j],"r"):stdin;\r
+ setlocale(LC_CTYPE, "");\r
+ FILE *fp = *iname?fopen(iname,"r"):stdin;\r
while(!feof(fp)) str.push_back(fgetwc(fp));\r
- if(j>0) fclose(fp);\r
- std::vector<std::wstring> var;\r
+ if(*iname) fclose(fp);\r
+\r
for(i=0;;) // collect exact values\r
{\r
n = str.find(L"##a ",i);\r
for(v=v1;v<=v2;v+=dv)\r
{ mglprintf(ss,64,L"%g",v); var.push_back(ss); }\r
}\r
- char buf[2048],fname[256];\r
- if(k>0) strcpy(fname,arg[k]);\r
- else\r
- { strcpy(fname,j>0?arg[j]:"out"); strcat(fname,".png"); }\r
- bool gif= !strcmp(fname+strlen(fname)-4,".gif");\r
+ bool gif = !strcmp(oname+strlen(oname)-4,".gif");\r
if(var.size()>1) // there is animation\r
{\r
- if(gif) gr.StartGIF(fname);\r
- for(i=0;i!=var.size()-1;i++)\r
+ if(gif) gr.StartGIF(oname);\r
+ for(i=0;i<var.size();i++)\r
{\r
gr.NewFrame();\r
+ printf("frame %d for $0 = \"%ls\"\n",i,var[i].c_str());\r
p.AddParam(0,var[i].c_str());\r
p.Execute(&gr,str.c_str());\r
- printf("%s\n",gr.Message());\r
+ if(gr.Message()[0]) printf("%s\n",gr.Message());\r
gr.EndFrame();\r
- sprintf(buf,"%s-%ld",fname,i);\r
+ sprintf(buf,"%s-%ld",oname,i);\r
if(!gif) gr.WriteFrame(buf);\r
}\r
if(gif) gr.CloseGIF();\r
{\r
p.Execute(&gr,str.c_str());\r
printf("%s\n",gr.Message());\r
- gr.WriteFrame(fname);\r
+ gr.WriteFrame(oname);\r
}\r
- printf("Write output to %s\n",fname);\r
+ printf("Write output to %s\n",oname);\r
return 0;\r
}\r
//-----------------------------------------------------------------------------\r
#include <stdio.h>
#include <string.h>
#include <locale.h>
+#include <unistd.h>
#include "mgl/window.h"
#include "mgl/parser.h"
//-----------------------------------------------------------------------------
return 0;
}
//-----------------------------------------------------------------------------
-int main(int narg, char **arg)
+int main(int argc, char **argv)
{
- long i,j=-1;
- for(i=1;i<narg;i++) // add arguments for the script
+ char ch, iname[256]="";
+
+ while(1)
{
- if(arg[i][0]=='-' && arg[i][1]>='0' && arg[i][1]<='9')
- p.AddParam(arg[i][1]-'0',arg[i]+2);
- if(arg[i][0]=='-' && arg[i][1]=='L')
- setlocale(LC_CTYPE, arg[i]+2);
- if(arg[i][0]=='-' && (arg[i][1]=='h' || (arg[i][1]=='-' && arg[i][2]=='h')))
+ ch = getopt(argc, argv, "1:2:3:4:5:6:7:8:9:ho:L:");
+ if(ch>='1' && ch<='9') p.AddParam(ch-'0', optarg);
+ else if(ch=='L') setlocale(LC_CTYPE, optarg);
+ else if(ch=='h' || (ch==-1 && optind>=argc))
{
- printf("mglview show MGL script and MGLD files in a window.\n");
- printf("Current version is 2.%g\n",MGL_VER2);
- printf("Usage:\tmgl2png scriptfile [outputfile parameter(s)]\n");
- printf("\tParameters have format \"-Nval\".\n");
- printf("\tHere N=0,1...9 is parameter ID and val is its value.\n");
- printf("\tOption -Lval set locale to val.\n");
+ printf("mglconv convert mgl script to bitmap png file.\nCurrent version is 2.%g\n",MGL_VER2);
+ printf("Usage:\tmglview [parameter(s)] scriptfile\n");
+ printf(
+ "\t-1 str set str as argument $1 for script\n"
+ "\t... ...\n"
+ "\t-9 str set str as argument $9 for script\n"
+ "\t-L loc set locale to loc\n"
+ "\t- get script from standard input\n"
+ "\t-h print this message\n" );
+ ch = 'h'; break;
}
- if(arg[i][0]!='-' && j<0) j=i;
+ else if(ch==-1 && optind<argc)
+ { strcpy(iname, argv[optind][0]=='-'?"":argv[optind]); break; }
}
+ if(ch=='h') return 0;
+
+ long i;
mgl_ask_func = mgl_ask_gets;
#if MGL_HAVE_QT
int kind=1; mgl_ask_func = mgl_ask_qt;
#else
int kind=0; mgl_ask_func = mgl_ask_fltk;
#endif
- bool mgld=(j>0 && arg[j][strlen(arg[j])]=='d');
+ bool mgld=(*iname && iname[strlen(iname)-1]=='d');
if(!mgld)
{
- FILE *fp = j>0?fopen(arg[j],"r"):stdin;
+ setlocale(LC_CTYPE, "");
+ FILE *fp = *iname?fopen(iname,"r"):stdin;
while(!feof(fp)) str.push_back(fgetwc(fp));
- if(j>0) fclose(fp);
+ if(*iname) fclose(fp);
}
- mglWindow gr(mgld?NULL:show, j>0?arg[j]:"mglview", kind);
+ mglWindow gr(mgld?NULL:show, *iname?iname:"mglview", kind);
if(mgld)
- { gr.ImportMGLD(arg[j]); gr.Update(); }
+ {
+ gr.Setup(false);
+ setlocale(LC_NUMERIC, "C");
+ gr.ImportMGLD(iname);
+ setlocale(LC_NUMERIC, "");
+ gr.Update();
+ }
gr.Run();
return 0;
}
gr->Alpha(flag&1); gr->Light(flag&2);
if(tet_val) tet = tet_val->value();
if(phi_val) phi = phi_val->value();
- gr->Zoom(x1,y1,x2,y2); gr->View(tet,phi); gr->Clf();
+ gr->Zoom(x1,y1,x2,y2); gr->View(tet,phi);
draw_func(gr, draw_par); // drawing itself
const char *buf = gr->Mess.c_str();
if(*buf) fl_message("%s",buf);
#include <stdio.h>
#include "mgl/qt.h"
//-----------------------------------------------------------------------------
+#if !defined(WIN32) && !defined(__APPLE__)
+#include <X11/Xlib.h>
+#endif
+//-----------------------------------------------------------------------------
#include "xpm/fileprint.xpm"
#include "xpm/copy.xpm"
#include "xpm/left_1.xpm"
if(gr->get(MGL_CLF_ON_UPD)) gr->DefaultPlotParam();
gr->Alpha(alpha); gr->Light(light);
if(!isHidden()) QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
- setlocale(LC_ALL, "C"); // NOTE: I'm not sure what I should selocale manually???
+ setlocale(LC_NUMERIC, "C"); // NOTE: I'm not sure what I should selocale manually???
draw_func(gr, draw_par);
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
if(!isHidden()) QApplication::restoreOverrideCursor();
emit refreshData();
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_bps(gr,setExtension(fname,"eps").toAscii(), appName.toAscii());
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_eps(gr,setExtension(fname,"eps").toAscii(), appName.toAscii());
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_svg(gr,setExtension(fname,"svg").toAscii(), appName.toAscii());
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_xyz(gr,setExtension(fname,"svg").toAscii(), appName.toAscii());
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_tex(gr,setExtension(fname,"svg").toAscii(), appName.toAscii());
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_off(gr,setExtension(fname,"svg").toAscii(), appName.toAscii(),0);
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_obj(gr,setExtension(fname,"svg").toAscii(), appName.toAscii(),0);
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_stl(gr,setExtension(fname,"svg").toAscii(), appName.toAscii());
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_x3d(gr,setExtension(fname,"svg").toAscii(), appName.toAscii());
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_tga(gr,setExtension(fname,"svg").toAscii(), appName.toAscii());
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0);
else
{
- setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
mgl_write_idtf(gr,setExtension(fname,"svg").toAscii(), appName.toAscii());
- setlocale(LC_ALL, "");
+ setlocale(LC_NUMERIC, "");
}
}
//-----------------------------------------------------------------------------
if(!qApp)
{
+#if !defined(WIN32) && !defined(__APPLE__)
+ // try to fix possible multi-threading errors
+ // must be placed before ANY window creation
+ XInitThreads();
+#endif
QApplication *a;
if(!argv)
{
//-----------------------------------------------------------------------------\r
mglCanvasW::mglCanvasW() : mglCanvas()\r
{\r
- Setup(true,false,true);\r
- LoadFunc=0; FuncPar=0; DrawFunc=0;\r
+ Setup(); LoadFunc=0; FuncPar=0; DrawFunc=0;\r
GG = 0; NumFig = 0; CurFig = -1;\r
// set(MGL_USEDRWDAT); // TODO: experimental feature -- test later\r
}\r
//-----------------------------------------------------------------------------\r
mglCanvasW::~mglCanvasW() { if(GG) free(GG); }\r
//-----------------------------------------------------------------------------\r
-void mglCanvasW::Clf(mglColor Back) { if(get(MGL_AUTO_CLF)) mglCanvas::Clf(Back); }\r
-//-----------------------------------------------------------------------------\r
void mglCanvasW::SetCurFig(int c) { CurFig=c; if(get(MGL_USEDRWDAT)) GetDrwDat(c); }\r
//-----------------------------------------------------------------------------\r
void mglCanvasW::ClearFrames()\r
{ mglCanvasW *g = dynamic_cast<mglCanvasW *>(gr); if(g) g->PrevFrame(); }\r
void mgl_wnd_animation(HMGL gr)\r
{ mglCanvasW *g = dynamic_cast<mglCanvasW *>(gr); if(g) g->Animation(); }\r
+void mgl_setup_window(HMGL gr, int clf_upd, int showpos)\r
+{ mglCanvasW *g = dynamic_cast<mglCanvasW *>(gr); if(g) g->Setup(clf_upd, showpos); }\r
//-----------------------------------------------------------------------------\r
void mgl_wnd_toggle_alpha_(uintptr_t *gr)\r
{ mglCanvasW *g = dynamic_cast<mglCanvasW *>((HMGL)(*gr));\r
void mgl_wnd_animation_(uintptr_t *gr)\r
{ mglCanvasW *g = dynamic_cast<mglCanvasW *>((HMGL)(*gr));\r
if(g) g->Animation(); }\r
+void mgl_setup_window_(uintptr_t *gr, int *clf_upd, int *showpos)\r
+{ mglCanvasW *g = dynamic_cast<mglCanvasW *>((HMGL)(*gr));\r
+ if(g) g->Setup(*clf_upd, *showpos); }\r
//-----------------------------------------------------------------------------\r
#if MGL_HAVE_FLTK==0\r
HMGL mgl_create_graph_fltk(int (*)(HMGL gr, void *p), const char *, void *)\r