From 9cc1769b846737e15e1dd8a35d56477eb96fe0c5 Mon Sep 17 00:00:00 2001 From: Dimitrios Eftaxiopoulos Date: Sun, 26 Feb 2012 12:39:05 +0200 Subject: [PATCH] Fix build failure releted to conflicting pointer types --- debian/changelog | 4 +- debian/changelog~ | 304 -- debian/control~ | 164 - debian/libmgl-fltk5.symbols | 6 +- debian/libmgl5.symbols | 3 +- debian/patches/mgl-mgl-eps-cpp.patch | 178 + debian/patches/mgl-mgl-export-cpp.patch | 30 + debian/patches/series | 2 + debian/patches/texinfo-Makefile.patch | 2 +- lang/numpy.i | 2 +- texinfo/Makefile.am | 3 +- texinfo/Makefile.in | 3 +- texinfo/mathgl_en.texi | 8 +- texinfo/mathgl_ru.texi | 8 +- texinfo/mgl_en.texi | 8 +- texinfo/mgl_ru.info-1 | 6077 +++++++++++++++++++++++ texinfo/mgl_ru.info-2 | 889 ++++ texinfo/mgl_ru.texi | 8 +- texinfo/png/Makefile.am | 1 - texinfo/png/Makefile.in | 1 - 20 files changed, 7204 insertions(+), 497 deletions(-) delete mode 100644 debian/changelog~ delete mode 100644 debian/control~ create mode 100644 debian/patches/mgl-mgl-eps-cpp.patch create mode 100644 debian/patches/mgl-mgl-export-cpp.patch create mode 100644 texinfo/mgl_ru.info-1 create mode 100644 texinfo/mgl_ru.info-2 diff --git a/debian/changelog b/debian/changelog index 5d40100..998c46e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,12 @@ mathgl (1.11.2-9) unstable; urgency=low + * Add patches that fix conflicting pointer type issues in files + mgl/mgl_eps.cpp and mgl/mgl_export.cpp (Closes: #661292). * Change dependency of python-mathgl package from python-numpy to python-numpy-abi9. * Update Debian Policy to 3.9.3. - -- Dimitrios Eftaxiopoulos Thu, 23 Feb 2012 12:00:00 +0200 + -- Dimitrios Eftaxiopoulos Sun, 26 Feb 2012 09:23:00 +0200 mathgl (1.11.2-8) unstable; urgency=low diff --git a/debian/changelog~ b/debian/changelog~ deleted file mode 100644 index 1e71caa..0000000 --- a/debian/changelog~ +++ /dev/null @@ -1,304 +0,0 @@ -mathgl (1.11.2-9) unstable; urgency=low - - * Change dependency of python-mathgl package from python-numpy to - python-numpy-abi9. - - -- Dimitrios Eftaxiopoulos Thu, 23 Feb 2012 12:00:00 +0200 - -mathgl (1.11.2-8) unstable; urgency=low - - * Team upload - * Build only against libhdf5-dev (transition 1.8.6 => 1.8.8) - - -- Sylvestre Ledru Wed, 18 Jan 2012 19:29:33 +0100 - -mathgl (1.11.2-7) unstable; urgency=low - - * Fix FTBFS for sparc64. - * Ammend symbols files for alpha. - * Make libmgl-dev package dependent on libmgl-*5 packages (Closes: #646923). - * Create new texinfo-png-Makefile.patch in the place of - createpngdirectory.patch. - - -- Dimitrios Eftaxiopoulos Mon, 2 Jan 2012 18:32:00 +0200 - -mathgl (1.11.2-6) unstable; urgency=low - - * Fix FTBFS for sparc (Closes: #642654). - - -- Dimitrios Eftaxiopoulos Mon, 26 Sep 2011 16:23:12 +0300 - -mathgl (1.11.2-5) unstable; urgency=low - - * Resolve differences for all non-optional symbols, in symbols files for ia64, - sparc and sh4 architectures (Closes: #642654). - - -- Dimitrios Eftaxiopoulos Mon, 26 Sep 2011 10:25:00 +0300 - -mathgl (1.11.2-4) unstable; urgency=low - - * Add python-numpy to Depnds of python-mathgl in debian/control and add - dh_numpy in binary-arch in debian/rules (Closes: #641793). - * Ammend symbols files for ia64, sparc and sh4 architectures (Closes: 642654). - - -- Dimitrios Eftaxiopoulos Sat, 24 Sep 2011 23:16:00 +0300 - -mathgl (1.11.2-3) unstable; urgency=low - - * Replace libfltk-dev with libfltk1.3-dev | libfltk-dev in debian/control - Build-Depends (Closes: #638834). - * Ammend symbols files for s390x architecture (Closes: #639492). - - -- Dimitrios Eftaxiopoulos Wed, 7 Sep 2011 06:04:00 +0300 - -mathgl (1.11.2-2) unstable; urgency=low - - * Add debian/source/options file in order to avoid the generation of unneeded debian- - changes patch, due to the creation of extra file config.log during build. - * Ammend symbols files. - - -- Dimitrios Eftaxiopoulos Thu, 18 Aug 2011 20:48:00 +0300 - -mathgl (1.11.2-1) unstable; urgency=low - - * Incorporate changes due to the last two NMU's. - * New upstream version. - - -- Dimitrios Eftaxiopoulos Tue, 28 Jun 2011 17:01:00 +0200 - -mathgl (1.11.1.1-2.2) unstable; urgency=low - - * Non-maintainer upload (closes: #610777). - * debian/libmgl-qt5.symbols: _ZN10QByteArrayD1Ev is needed on sparc and - ia64, so add it as optional. - * debian/libmgl-wx5.symbols: three destructors known to be undefined on - armel/armhf are also not defined on ia64 or sparc, so mark these as - optional also. Destructors of foreign classes are not part of the - library ABI, so it's fine to ignore these. - - -- Steve Langasek Sun, 19 Jun 2011 07:57:43 +0000 - -mathgl (1.11.1.1-2.1) unstable; urgency=low - - * Non-maintainer upload. - * Fix library symbols files (closes: #610777): - - debian/libmgl-qt5.symbols: drop _ZN10QByteArrayD2Ev, which is not - present on *any* architecture anymore. - - debian/libmgl-fltk5.symbols: _ZN9Fl_PixmapC2EPKPKc is not present on - ia64 or sparc and never has been. - - debian/libmgl5.symbols: - + _ZN7mglFuncD1Ev is present on all architectures, drop the - architecture list (fixing the 'kfeebsd' typo that caused a build - failure on kfreebsd-amd64). - + _ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEED2Ev, - _ZN8u3dLightD2Ev: symbols not seen on *any* archs, drop. - + Drop 18 symbols whose exclusion list included all 15 architectures - that have been tested. - + Other symbols that are template instantiations are now marked as - optional symbols instead of tagged with an arch list, since they are - not part of the ABI and will come and go based on the compiler - version used, *not* just on the architecture. - + If there are 8 or more architectures in the arch qualifier, invert - it. In some cases this reveals that certain symbols are actually - 64-bit specific - so infer that not-yet-tested 32-bit archs follow - the pattern. - - debian/*.symbols: any symbols marked for armel should also be marked - for armhf. - * debian/rules: clean the dependency_libs out of .la files at build - time, per Policy 10.2. Closes: #620629. - - -- Steve Langasek Sat, 18 Jun 2011 07:33:55 +0000 - -mathgl (1.11.1.1-3) unreleased; urgency=low - - * Further attempt to fix symbol breakages - - -- Dimitrios Eftaxiopoulos Sun, 29 May 2011 19:41:00 +0200 - -mathgl (1.11.1.1-2) unstable; urgency=low - - * Try to fix libmgl5 related symbols breakage on all arches - - -- Dimitrios Eftaxiopoulos Sun, 22 May 2011 20:50:00 +0200 - -mathgl (1.11.1.1-1) unstable; urgency=low - - * New upstream version - - -- Dimitrios Eftaxiopoulos Tue, 26 Apr 2011 01:15:00 +0200 - -mathgl (1.11.0.1-9) unreleased; urgency=low - - * Again try to fix build failure due to broken symbols for several architectures - - -- Dimitrios Eftaxiopoulos Sat, 2 Apr 2011 02:05:00 +0200 - -mathgl (1.11.0.1-8) unstable; urgency=low - - * Try to fix build failure due to broken symbols for several architectures - - -- Dimitrios Eftaxiopoulos Thu, 24 Mar 2011 23:56:00 +0200 - -mathgl (1.11.0.1-7) unstable; urgency=low - - * Create patch for the removal of the texinfo/mgl_ru.info-* files - * Update symbols files (Closes: #618235) - - -- Dimitrios Eftaxiopoulos Mon, 14 Mar 2011 00:10:00 +0200 - -mathgl (1.11.0.1-6) unstable; urgency=low - - * Try to fix build failure due to broken symbols for sparc64 - - -- Dimitrios Eftaxiopoulos Sat, 5 Mar 2011 21:27:00 +0200 - -mathgl (1.11.0.1-5) unstable; urgency=low - - * Try to fix build failure due to broken symbols for armel and s390 - - -- Dimitrios Eftaxiopoulos Fri, 25 Feb 2011 21:30:00 +0200 - -mathgl (1.11.0.1-4) unstable; urgency=low - - * Create mixed symbols files for amd64 and i386 with tagged symbols - (Closes: #610777) - - -- Dimitrios Eftaxiopoulos Sat, 19 Feb 2011 23:10:00 +0200 - -mathgl (1.11.0.1-3) unstable; urgency=low - - * Upload in unstable - * Change symbols files for pbuilder --distribution unstable (Closes: #610777) - - -- Dimitrios Eftaxiopoulos Sat, 12 Feb 2011 22:14:00 +0200 - -mathgl (1.11.0.1-2) experimental; urgency=low - - * Update symbols files for pbuilder --distribution experimental. - * Remove createpngdirectory.patch from series. - * Apply patch for FTBFS on i386 (Closes: #607539). - * Add Replaces tags for old mathgl-doc package in debian/control. - * Various improvements in the debian/rules file. - - -- Dimitrios Eftaxiopoulos Mon, 17 Jan 2011 21:43:00 +0200 - -mathgl (1.11.0.1-1) experimental; urgency=low - - * Correct debian/copyright file. - * Create proper patches for the changes in the source tree. - * Add new package for Russian documentation. - * New upstream release (Closes: #603004). - * Correct several spelling mistakes in manpages and in lang/numpy.i - * Create symbols files for libraries. - * Register documentation to doc-base. - - -- Dimitrios Eftaxiopoulos Sun, 12 Dec 2010 19:13:00 +0200 - -mathgl (1.10.2.1-2) unstable; urgency=low - - * Make .png pictures visible from the html documentation. - * Add python support (Closes: #541481). - - -- Dimitrios Eftaxiopoulos Sun, 11 Sep 2010 12:37:00 +0200 - -mathgl (1.10.2.1-1) unstable; urgency=low - - [ D Eftaxiopoulos ] - * Update to Debian Policy 3.9.1 - * Put myself and D. Haley to the maintainers list. - * Comment out parallel-build-png.patch in the debian/patches/series file - since it seems to apply to a texinfo/Makefile.am file that is not - included in the source tree. - * Append package quilt to the build-depends list for the source in the - debian/control file, in order to fix a lintian error. - * Reinstate debian/source/format file with content '3.0 (quilt)'. - * Fix Lintian warnings related to manpages. - - [ D Haley ] - * New upstream release 1.10.2.1 (Closes: #562743). - - [ Salvatore Bonaccorso ] - * New Maintainer (Closes: #564422). Set Maintainer to Debian Science - Maintainers . - * Convert to '3.0 (quilt)' package source format. Drop quilt framework for - packaging. - * debian/control: - - Change Vcs-Browser and Vcs-Git to the debian-science git repository. - - Change Section for source package to 'science' as per debian-science - group policy. - - Set DM-Upload-Allowed field to yes. - * Add myself to Uploaders. - - [ Sylvestre Ledru ] - * Missing dependency against automake added. - - -- Sylvestre Ledru Sun, 15 Aug 2010 21:45:47 +0200 - -mathgl (1.9-3) unstable; urgency=low - - * QA upload. - * Properly orphan the package (see #564422), set maintainer to QA. - * Bump Standards-Version to 3.8.4, no changes needed. - * Add debian/README.source, pointing to quilt doc. - * Bump build-deps on octave from 3.0 to 3.2 (Closes: #574025). - - -- Stefano Zacchiroli Fri, 26 Mar 2010 14:06:08 +0100 - -mathgl (1.9-2) unstable; urgency=low - - * Fix FTBFS. Closes: #545882. - * Update Standards-Version to 3.8.3. - - -- Bradley Smith Wed, 09 Sep 2009 22:44:44 +0100 - -mathgl (1.9-1) unstable; urgency=low - - * New upstream release. Closes: #535503. - * QT -> qt in package descriptions. Closes: #534425. - - -- Bradley Smith Sun, 19 Jul 2009 16:41:41 +0100 - -mathgl (1.8.1-6) unstable; urgency=low - - * Redo descriptions. - - -- Bradley Smith Tue, 09 Jun 2009 20:26:42 +0100 - -mathgl (1.8.1-5) unstable; urgency=low - - * Correct info-dir-section in texinfo/mathgl.texi. Closes: #528893. - - -- Bradley Smith Wed, 27 May 2009 17:52:50 +0100 - -mathgl (1.8.1-4) unstable; urgency=low - - * Correct libltdl-dev Build-Depend. Closes: #526426. - * Further improve descriptions. - - -- Bradley Smith Fri, 01 May 2009 12:59:05 +0100 - -mathgl (1.8.1-3) unstable; urgency=low - - * Tidy up descriptions. Closes: #521830, #521917. - * Update Standards-Version to 3.8.1. (No changes). - * Fix watch file. - - -- Bradley Smith Sat, 18 Apr 2009 17:42:59 +0100 - -mathgl (1.8.1-2) unstable; urgency=low - - * Fix parallel builds. Closes: #519738. - - -- Bradley Smith Thu, 19 Mar 2009 19:08:37 +0000 - -mathgl (1.8.1-1) unstable; urgency=low - - * New upstream release. Closes: #518769. - - -- Bradley Smith Sun, 08 Mar 2009 13:29:33 +0000 - -mathgl (1.8-1) unstable; urgency=low - - * Initial release. Closes: #510378. - - -- Bradley Smith Thu, 01 Jan 2009 11:27:32 +0000 diff --git a/debian/control~ b/debian/control~ deleted file mode 100644 index 4be9e4a..0000000 --- a/debian/control~ +++ /dev/null @@ -1,164 +0,0 @@ -Source: mathgl -Section: science -Priority: optional -Maintainer: Debian Science Maintainers -Uploaders: Dimitrios Eftaxiopoulos , D Haley -DM-Upload-Allowed: yes -Build-Depends: debhelper (>= 7.2.3~), libltdl-dev, libgsl0-dev, freeglut3-dev, - libgl1-mesa-dev | libgl-dev, libpng-dev, libhdf5-dev, - libjpeg-dev, libtiff-dev, libfltk1.3-dev | libfltk-dev, libqt4-dev, libwxgtk2.8-dev, swig, - texinfo, texi2html, texlive, texlive-generic-recommended, octave3.2-headers, - libgif-dev, autoconf, automake, python, python-dev, python-numpy, python-support, - libhdf4-dev, chrpath -Standards-Version: 3.9.2 -Homepage: http://mathgl.sourceforge.net/index.html -Vcs-Git: git://git.debian.org/debian-science/packages/mathgl.git -Vcs-Browser: http://git.debian.org/?p=debian-science/packages/mathgl.git - -Package: mathgl -Architecture: any -Section: libs -Depends: ${shlibs:Depends}, ${misc:Depends}, libmgl5 (= ${binary:Version}) -Description: library for scientific graphs. (utlities and examples) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package contains MathGL utilities and examples. - -Package: mathgl-doc-en -Architecture: all -Section: doc -Depends: dpkg (>= 1.15.4) | install-info, ${misc:Depends} -Replaces: mathgl-doc -Description: library for scientific graphs. (English documentation) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package contains the MathGL documentation in English. - -Package: mathgl-doc-ru -Architecture: all -Section: doc -Depends: dpkg (>= 1.15.4) | install-info, ${misc:Depends} -Replaces: mathgl-doc -Description: library for scientific graphs. (Russian documentation) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package contains the MathGL documentation in Russian. - -Package: libmgl5 -Architecture: any -Section: libs -Depends: ${shlibs:Depends}, ${misc:Depends}, libmgl-data -Description: library for scientific graphs. (main runtime library) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package contains the shared object files. - -Package: libmgl-data -Architecture: all -Section: misc -Depends: ${misc:Depends} -Description: library for scientific graphs. (data files) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package contains the MathGL data files. - -Package: libmgl-dev -Architecture: any -Section: libdevel -Depends: libmgl5 (= ${binary:Version}), ${misc:Depends}, - libmgl-fltk5 (= ${binary:Version}), libmgl-qt5 (= ${binary:Version}), - libmgl-wx5 (= ${binary:Version}), libmgl-glut5 (= ${binary:Version}), - libgsl0-dev, libpng-dev, libgl1-mesa-dev | libgl-dev -Description: library for scientific graphs. (development files) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package contains the development files. - -Package: libmgl-fltk5 -Architecture: any -Section: libs -Depends: ${shlibs:Depends}, ${misc:Depends}, libmgl5 (= ${binary:Version}) -Description: library for scientific graphs. (FLTK runtime library) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package contains the FLTK frontend. - -Package: libmgl-qt5 -Architecture: any -Section: libs -Depends: ${shlibs:Depends}, ${misc:Depends}, libmgl5 (= ${binary:Version}) -Description: library for scientific graphs. (Qt runtime library) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package contains the Qt4 frontend. - -Package: libmgl-wx5 -Architecture: any -Section: libs -Depends: ${shlibs:Depends}, ${misc:Depends}, libmgl5 (= ${binary:Version}) -Description: library for scientific graphs. (wxWidgets runtime library) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package contains the wxWidgets frontend. - -Package: libmgl-glut5 -Architecture: any -Section: libs -Depends: ${shlibs:Depends}, ${misc:Depends}, libmgl5 (= ${binary:Version}) -Description: library for scientific graphs. (GLUT runtime library) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package containst the GLUT frontend. - -Package: python-mathgl -Architecture: any -Section: python -Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-numpy-abi9 -Description: library for scientific graphs. (Python module) - A free cross-platform library of fast C++ routines for plotting data in up - to 3 dimensions. It can export plots to bitmaps and vector EPS, SVG, IDTF - files. There are simple window interfaces based on GLUT, FLTK and/or Qt. - MathGL can also be used in the console. There are interfaces to a set of - languages, such as, C, Fortran, Pascal, Forth, Python, Octave. - . - This package provides the Python module for mathgl. diff --git a/debian/libmgl-fltk5.symbols b/debian/libmgl-fltk5.symbols index 1ae3f5d..08391fc 100644 --- a/debian/libmgl-fltk5.symbols +++ b/debian/libmgl-fltk5.symbols @@ -60,9 +60,9 @@ libmgl-fltk.so.5 libmgl-fltk5 #MINVER# _ZN9Fl_MathGLD2Ev@Base 1.11 (arch=!powerpcspe)_ZN9Fl_PixmapC1EPKPKc@Base 1.11 _ZN9Fl_PixmapC2EPKPKc@Base 1.11 - _ZN9Fl_Widget12as_gl_windowEv@Base 1.11 - _ZN9Fl_Widget8as_groupEv@Base 1.11 - _ZN9Fl_Widget9as_windowEv@Base 1.11 + (optional)_ZN9Fl_Widget12as_gl_windowEv@Base 1.11 + (optional)_ZN9Fl_Widget8as_groupEv@Base 1.11 + (optional)_ZN9Fl_Widget9as_windowEv@Base 1.11 _ZTI12mglGraphFLTK@Base 1.11 _ZTI9Fl_MathGL@Base 1.11 _ZTS12mglGraphFLTK@Base 1.11 diff --git a/debian/libmgl5.symbols b/debian/libmgl5.symbols index 3e09928..f26b114 100644 --- a/debian/libmgl5.symbols +++ b/debian/libmgl5.symbols @@ -131,7 +131,8 @@ libmgl.so.5 libmgl5 #MINVER# _Z11mgl_fgetstrP8_IO_FILE@Base 1.11 _Z11mgl_fit__dfPK10gsl_vectorPvP10gsl_matrix@Base 1.11 _Z11mgl_init_raiPKfP6mgl_ap@Base 1.11 - _Z11mgl_read_gzPv@Base 1.11 + (optional)_Z11mgl_read_gzPv@Base 1.11 + _Z11mgl_read_gzP8gzFile_s@Base 1.11 _Z11mgl_spline3PfS_iifRf@Base 1.11 _Z11mgl_spline5PfS_iifRf@Base 1.11 _Z11mgl_strtrimPc@Base 1.11 diff --git a/debian/patches/mgl-mgl-eps-cpp.patch b/debian/patches/mgl-mgl-eps-cpp.patch new file mode 100644 index 0000000..2c10522 --- /dev/null +++ b/debian/patches/mgl-mgl-eps-cpp.patch @@ -0,0 +1,178 @@ +Fix conversion issues between distinct pointer types +--- a/mgl/mgl_eps.cpp ++++ b/mgl/mgl_eps.cpp +@@ -19,7 +19,7 @@ + ***************************************************************************/ + #include + #include +-#include ++#include + #include "mgl/mgl_eps.h" + #include "mgl/mgl_c.h" + #include "mgl/mgl_f.h" +@@ -85,7 +85,7 @@ + a.x[0]=p1[0]; a.y[0]=p1[1]; a.x[1]=p2[0]; a.y[1]=p2[1]; + a.zz[0]=p1[2]; a.zz[1]=p2[2]; + a.c[0]=(c1[0]+c2[0])/2; a.c[1]=(c1[1]+c2[1])/2; a.c[2]=(c1[2]+c2[2])/2; +-// a.c[0]=c1[0]; a.c[1]=c1[1]; a.c[2]=c1[2]; ++// a.c[0]=c1[0]; a.c[1]=c1[1]; a.c[2]=c1[2]; + a.style=all? 0xffff:PDef; a.s = pPos; + add_prim(a); + pPos = fmod(pPos+hypot(p2[0]-p1[0], p2[1]-p1[1])/pw/1.5, 16); +@@ -197,7 +197,7 @@ + { + mglPrim a(4); + a.s = fscl/PlotFactor; a.w = ftet; +- a.x[0] = (xPos - zoomx1*Width) /zoomx2; ++ a.x[0] = (xPos - zoomx1*Width) /zoomx2; + a.y[0] = (yPos - zoomy1*Height)/zoomy2; + a.x[1] = x; a.y[1] = y; + a.zz[1] = f/fnt->GetFact(s&3); +@@ -260,10 +260,10 @@ + } + //----------------------------------------------------------------------------- + void mglGraphPS::add_light(mreal *b, mreal n0,mreal n1, mreal n2) +-{ +- mreal n[3]={n0,n1,n2}; +- unsigned char r[4]; +- col2int(b,n,r); ++{ ++ mreal n[3]={n0,n1,n2}; ++ unsigned char r[4]; ++ col2int(b,n,r); + b[0]=r[0]/255.; b[1]=r[1]/255.; b[2]=r[2]/255.; b[3]=r[3]/255.; + } + //----------------------------------------------------------------------------- +@@ -303,9 +303,9 @@ + if(!Finished) Finish(); + time_t now; + time(&now); +- +- bool gz = fname[strlen(fname)-1]=='z'; +- void *fp = gz ? gzopen(fname,"wt") : fopen(fname,"wt"); ++ ++ bool gz = fname[strlen(fname)-1]=='z'; ++ void *fp = gz ? static_cast(gzopen(fname,"wt")) : fopen(fname,"wt"); + if(!fp) { SetWarn(mglWarnOpen,fname); return; } + mgl_printf(fp, gz, "%%!PS-Adobe-3.0 EPSF-3.0\n%%%%BoundingBox: 0 0 %d %d\n",Width,Height); + mgl_printf(fp, gz, "%%%%Creator: MathGL library\n%%%%Title: %s\n",descr ? descr : fname); +@@ -320,9 +320,9 @@ + mgl_printf(fp, gz, "/m_c {ss 0.3 mul 0 360 arc} def\n"); + mgl_printf(fp, gz, "/d0 {[] 0 setdash} def\n/sd {setdash} def\n"); + +- bool m_p=false,m_x=false,m_d=false,m_v=false,m_t=false, +- m_s=false,m_a=false,m_o=false,m_T=false, +- m_V=false,m_S=false,m_D=false,m_Y=false,m_l=false, ++ bool m_p=false,m_x=false,m_d=false,m_v=false,m_t=false, ++ m_s=false,m_a=false,m_o=false,m_T=false, ++ m_V=false,m_S=false,m_D=false,m_Y=false,m_l=false, + m_L=false,m_r=false,m_R=false,m_X=false,m_P=false; + register long i; + // add mark definition if present +@@ -336,11 +336,11 @@ + if(P[i].m=='S') m_S = true; if(P[i].m=='D') m_D = true; + if(P[i].m=='V') m_V = true; if(P[i].m=='T') m_T = true; + if(P[i].m=='<') m_l = true; if(P[i].m=='L') m_L = true; +- if(P[i].m=='>') m_r = true; if(P[i].m=='R') m_R = true; +- if(P[i].m=='Y') m_Y = true; ++ if(P[i].m=='>') m_r = true; if(P[i].m=='R') m_R = true; ++ if(P[i].m=='Y') m_Y = true; + if(P[i].m=='P') m_P = true; if(P[i].m=='X') m_X = true; +- } +- if(m_P) { m_p=true; m_s=true; } ++ } ++ if(m_P) { m_p=true; m_s=true; } + if(m_X) { m_x=true; m_s=true; } + if(m_p) mgl_printf(fp, gz, "/m_p {sm 0 rm s2 0 rl sm sm rm 0 s2 rl d0} def\n"); + 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"); +@@ -453,7 +453,7 @@ + } + for(i=0;i(gzopen(fname,"wt")) : fopen(fname,"wt"); + if(!fp) { SetWarn(mglWarnOpen,fname); return; } + mgl_printf(fp, gz, "\n"); + mgl_printf(fp, gz, "\n"); +@@ -576,10 +576,10 @@ + // const char *dash[]={"", "8 8","4 4","1 3","7 4 1 4","3 2 1 2"}; + mgl_printf(fp, gz, "1) mgl_printf(fp, gz, " stroke-width=\"%g\"", P[i].w); + memcpy(cp,P[i].c,3*sizeof(mreal)); +@@ -620,7 +620,7 @@ + + for(i=0;i"); +- if(gz) gzclose(fp); else fclose((FILE *)fp); ++ if(gz) gzclose((gzFile)fp); else fclose((FILE *)fp); + } + //----------------------------------------------------------------------------- + void mglGraphPS::Finish() +@@ -643,31 +643,31 @@ + #define imax(a,b) (a)>(b) ? (a) : (b) + #define imin(a,b) (a)<(b) ? (a) : (b) + void mglPrim::Draw(mglGraphPS *gr) +-{ +- mreal pp[12]={x[0],y[0],z, x[1],y[1],z, x[2],y[2],z, x[3],y[3],z}; +- gr->draw_prim(this, pp, c); +-} ++{ ++ mreal pp[12]={x[0],y[0],z, x[1],y[1],z, x[2],y[2],z, x[3],y[3],z}; ++ gr->draw_prim(this, pp, c); ++} + //----------------------------------------------------------------------------- +-void mglGraphPS::draw_prim(mglPrim *pr, mreal *pp, mreal *c) +-{ ++void mglGraphPS::draw_prim(mglPrim *pr, mreal *pp, mreal *c) ++{ + ObjId = pr->id; memcpy(CDef,c,4*sizeof(mreal)); +- bool ul=UseLight; UseLight=false; +- int m = pr->m, s = pr->style; +- switch(pr->type) +- { +- case 0: mglGraphAB::mark_plot(pp,pr->m); break; +- case 1: PDef = pr->style; pPos = pr->s; ++ bool ul=UseLight; UseLight=false; ++ int m = pr->m, s = pr->style; ++ switch(pr->type) ++ { ++ case 0: mglGraphAB::mark_plot(pp,pr->m); break; ++ case 1: PDef = pr->style; pPos = pr->s; + mglGraphAB::line_plot(pp,pp+3,c,c); break; + case 2: mglGraphAB::trig_plot(pp,pp+3,pp+6,c,c,c); break; + case 3: mglGraphAB::quad_plot(pp,pp+3,pp+6,pp+9,c,c,c,c); break; + case 4: + mreal pf=PlotFactor; Push(); +- SetPosScale(pp[0],pp[1],pp[2],pr->s*PlotFactor); RotateN(pr->w,0,0,1); ++ SetPosScale(pp[0],pp[1],pp[2],pr->s*PlotFactor); RotateN(pr->w,0,0,1); + mglGraphAB::Glyph(pr->x[1],pr->y[1],pr->zz[1]*fnt->GetFact(s&3),s,m,0); +- Pop(); PlotFactor=pf; ++ Pop(); PlotFactor=pf; + break; + } +- UseLight=ul; ++ UseLight=ul; + } + //----------------------------------------------------------------------------- + void mglGraphPS::pnt_plot(long x,long y, mreal, unsigned char c[4]) diff --git a/debian/patches/mgl-mgl-export-cpp.patch b/debian/patches/mgl-mgl-export-cpp.patch new file mode 100644 index 0000000..822937e --- /dev/null +++ b/debian/patches/mgl-mgl-export-cpp.patch @@ -0,0 +1,30 @@ +Fix conversion issues between distinct pointer types +--- a/mgl/mgl_export.cpp ++++ b/mgl/mgl_export.cpp +@@ -232,7 +232,7 @@ + va_start(lst,str); + vsprintf(buf,str,lst); + va_end(lst); +- if(gz) gzprintf(fp, "%s", buf); ++ if(gz) gzprintf((gzFile)fp, "%s", buf); + else fprintf((FILE *)fp, "%s", buf); + } + //--------------------------------------------------------------------------- +@@ -243,7 +243,7 @@ + register long i,j; + bool gz = fname[strlen(fname)-1]=='z'; + +- void *fp = gz ? gzopen(fname,"wt") : fopen(fname,"wt"); ++ void *fp = gz ? static_cast(gzopen(fname,"wt")) : fopen(fname,"wt"); + mgl_printf(fp, gz, "%%!PS-Adobe-3.0 EPSF-3.0\n%%%%BoundingBox: 0 0 %d %d\n",w,h); + mgl_printf(fp, gz, "%%%%Creator: MathGL library\n%%%%Title: %s\n", fname); + mgl_printf(fp, gz, "%%%%CreationDate: %s\n",ctime(&now)); +@@ -255,7 +255,7 @@ + mgl_printf(fp, gz, "%02x%02x%02x",p[j][3*i],p[j][3*i+1],p[j][3*i+2]); + } + mgl_printf(fp, gz, "\n\nshowpage\n%%%%EOF\n"); +- if(gz) gzclose(fp); else fclose((FILE *)fp); ++ if(gz) gzclose((gzFile)fp); else fclose((FILE *)fp); + return 0; + } + //----------------------------------------------------------------------------- diff --git a/debian/patches/series b/debian/patches/series index bb58b3d..1428abd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,6 @@ texinfo-png-Makefile.patch +mgl-mgl-eps-cpp.patch +mgl-mgl-export-cpp.patch dircategory-and-direntry-mathgl-en-texi.patch dircategory-and-direntry-mathgl-ru-texi.patch dircategory-and-direntry-mgl-ru-texi.patch diff --git a/debian/patches/texinfo-Makefile.patch b/debian/patches/texinfo-Makefile.patch index ce7821c..11f07cc 100644 --- a/debian/patches/texinfo-Makefile.patch +++ b/debian/patches/texinfo-Makefile.patch @@ -13,7 +13,7 @@ Fix removal of files texinfo/mgl_ru.info-* TEXI2PDF = texi2pdf --- a/texinfo/Makefile.in +++ b/texinfo/Makefile.in -@@ -296,7 +296,8 @@ +@@ -298,7 +298,8 @@ top_srcdir = @top_srcdir@ SUBDIRS = png . CLEANFILES = mathgl_en.info mathgl_en.info-1 mathgl_en.info-2 mathgl_en.info-3 mgl_en.info \ diff --git a/lang/numpy.i b/lang/numpy.i index 3757077..72fc4f9 100644 --- a/lang/numpy.i +++ b/lang/numpy.i @@ -111,7 +111,7 @@ if (PyModule_Check( py_obj)) return "module" ; if (PyInstance_Check(py_obj)) return "instance" ; - return "unknown type"; + return "unkown type"; } /* Given a NumPy typecode, return a string describing the type. diff --git a/texinfo/Makefile.am b/texinfo/Makefile.am index 82ec329..d35c1b3 100644 --- a/texinfo/Makefile.am +++ b/texinfo/Makefile.am @@ -1,8 +1,7 @@ SUBDIRS = png . CLEANFILES = mathgl_en.info mathgl_en.info-1 mathgl_en.info-2 mathgl_en.info-3 mgl_en.info \ -mathgl_ru.info mathgl_ru.info-1 mathgl_ru.info-2 mathgl_ru.info-3 mathgl_ru.info-4 mgl_ru.info \ -mgl_ru.info-* +mathgl_ru.info mathgl_ru.info-1 mathgl_ru.info-2 mathgl_ru.info-3 mathgl_ru.info-4 mgl_ru.info MAKEINFOHTML = texi2html TEXI2PDF = texi2pdf diff --git a/texinfo/Makefile.in b/texinfo/Makefile.in index 37bc413..a9cf8ed 100644 --- a/texinfo/Makefile.in +++ b/texinfo/Makefile.in @@ -298,8 +298,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = png . CLEANFILES = mathgl_en.info mathgl_en.info-1 mathgl_en.info-2 mathgl_en.info-3 mgl_en.info \ -mathgl_ru.info mathgl_ru.info-1 mathgl_ru.info-2 mathgl_ru.info-3 mathgl_ru.info-4 mgl_ru.info \ -mgl_ru.info-* +mathgl_ru.info mathgl_ru.info-1 mathgl_ru.info-2 mathgl_ru.info-3 mathgl_ru.info-4 mgl_ru.info MAKEINFOHTML = texi2html TEXI2PDF = texi2pdf diff --git a/texinfo/mathgl_en.texi b/texinfo/mathgl_en.texi index f48ac50..dce0911 100644 --- a/texinfo/mathgl_en.texi +++ b/texinfo/mathgl_en.texi @@ -25,10 +25,10 @@ supports it in developing GNU and promoting software freedom.'' @end quotation @end copying -@dircategory MathGL documentation system -@direntry -* MathGL: (mathgl). The library for scientific graphics. -@end direntry +@c @dircategory MathGL documentation system +@c @direntry +@c * MathGL: (mathgl). The library for scientific graphics. +@c @end direntry @titlepage @title MathGL diff --git a/texinfo/mathgl_ru.texi b/texinfo/mathgl_ru.texi index 0e98a07..ea267fb 100644 --- a/texinfo/mathgl_ru.texi +++ b/texinfo/mathgl_ru.texi @@ -27,10 +27,10 @@ supports it in developing GNU and promoting software freedom.'' @end quotation @end copying -@dircategory MathGL documentation system -@direntry -* MathGL: (mathgl). The library for scientific graphics. -@end direntry +@c @dircategory MathGL documentation system +@c @direntry +@c * MathGL: (mathgl). The library for scientific graphics. +@c @end direntry @titlepage @title MathGL diff --git a/texinfo/mgl_en.texi b/texinfo/mgl_en.texi index 68d7c34..66c5f81 100644 --- a/texinfo/mgl_en.texi +++ b/texinfo/mgl_en.texi @@ -25,10 +25,10 @@ supports it in developing GNU and promoting software freedom.'' @end quotation @end copying -@dircategory MathGL documentation system -@direntry -* MathGL: (mathgl). The library for scientific graphics. -@end direntry +@c @dircategory MathGL documentation system +@c @direntry +@c * MathGL: (mathgl). The library for scientific graphics. +@c @end direntry @titlepage @title MGL script language diff --git a/texinfo/mgl_ru.info-1 b/texinfo/mgl_ru.info-1 new file mode 100644 index 0000000..15034fc --- /dev/null +++ b/texinfo/mgl_ru.info-1 @@ -0,0 +1,6077 @@ +This is mgl_ru.info, produced by makeinfo version 4.13 from mgl_ru.texi. + +Это документация для MathGL (версии 1.11) - библиотеки классов и +функций для построения научной графики. Пожалуйста сообщайте о любых +ошибках в этом руководстве на . + + Copyright (C) 2009 Алексей Балакин. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, with the Front-Cover Texts + being "A GNU Manual," and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + "GNU Free Documentation License." + + (a) The FSF's Back-Cover Text is: "You have the freedom to copy + and modify this GNU manual. Buying copies from the FSF supports + it in developing GNU and promoting software freedom." + +INFO-DIR-SECTION MathGL documentation system +START-INFO-DIR-ENTRY +* MathGL: (mathgl). The library for scientific graphics. +END-INFO-DIR-ENTRY + + +File: mgl_ru.info, Node: Top, Next: MGL interface, Up: (dir) + +Язык MGL +************ + +Это документация для языка MGL (версии 1.11). Пожалуйста сообщайте о +любых ошибках в этом руководстве на . +Дополнительную информацию о MGL и MathGL можно найти на домашней +странице проекта `http://mathgl.sourceforge.net/'. + + Copyright (C) 2010 Алексей Балакин. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, with the Front-Cover Texts + being "A GNU Manual," and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + "GNU Free Documentation License." + + (a) The FSF's Back-Cover Text is: "You have the freedom to copy + and modify this GNU manual. Buying copies from the FSF supports + it in developing GNU and promoting software freedom." + +* Menu: + +* MGL interface:: +* Examples:: +* Samples:: +* Copying This Manual:: +* Index:: + + +File: mgl_ru.info, Node: MGL interface, Next: Examples, Up: Top + +1 Язык MGL +************** + +MathGL имеет встроенный скриптовый язык MGL для обработки и отображения +данных. Скрипты MGL можно использовать как независимо (программами +UDAV, mgl2png, mgl2eps, mgl2svg и пр., *note Utilities::) так и +вызовами библиотеки. + + Язык MGL достаточно простой. Каждая строка - отдельная команда. +Первое слово - имя команды, а все остальные ее аргументы. Команда может +иметь до 1000 аргументов (по крайней мере сейчас). Слова разделяются +одно от другого пробелом или символом табуляции. Различий между верхним +и нижним индексом нет, т.е. переменные A и A идентичны. Символ `#' +начинает комментарий - все символы после него игнорируются до конца +строки. Исключением является случай, когда `#' входит в строку. Опции +команды указываются после символа `;' (*note Command options::). Символ +`:' начинает новую команду (подобно переводу строки) если он расположен +не внутри скобок или строки. + + Если строка содержит ссылки на внешние параметры (`$0', `$1' ... +`$9') или макроопределения (`$a', `$b' ... `$z'), то текущие значения +параметров/макроопределений подставляются в строку вместо ссылки до +выполнением команды. Это позволяет использовать один и тот же скрипт +при различных входных параметрах командной строки или вводить +макроопределения по ходу исполнения команд скрипта. + + Аргументы команды могут быть строками, переменными или числами. + * Строка - произвольный набор символов между метками `''. + + * Обычно переменная имеет имя, состоящее из букв и чисел (должно + начинаться с буквы и не быть длиннее 64 символов). В качестве + переменной можно использовать временные массивы, включающие в себя: + * срезы ("подмассивы") массивов данных (подобно команде *note + subdata::). Например, `a(1)' или `a(1,:)' или `a(1,:,:)' - + вторая строка массива A, `a(:,2)' или `a(:,2,:)' - третий + столбец, `a(:,:,0)' - первый срез и т.д. Также можно выделить + часть массива с m-го по n-ый элемент `a(m:n,:,:)' или просто + `a(m:n)'. + + * произвольные комбинации столбцов данных (например, + `a('n*w^2/exp(t)')'), если столбцы данных были именованы + командой *note idset:: или в файле данных (в строке + начинающейся с `##'). + + * произвольное выражение из существующих переменных и констант. + Например, `sqrt(dat(:,5)+1)' даст временный массив данных с + элементами равными `tmp[i,j] = sqrt(dat[i,5,j]+1)'. + + * массивы с элементами заданными в квадратных скобках [], + разделенные `,'. При этом внутри выражения не должно быть + пробелов! Например, `[1,2,3]' даст временный массив из 3 + элементов {1, 2, 3}; `[[11,12],[21,22]]' даст матрицу 2*2 и + т.д. Элементами такой конструкции могут быть и массивы если + их размерности одинаковые, например `[v1,v2,...,vn]'. + + * результат команд построения новых данных (*note Make another + data::), если они заключены в фигурные скобки {}. Например, + `{sum dat 'x'}' даст временный массив, который есть результат + суммирования DAT вдоль 'x'. Это такой же массив как и TMP, + полученный командой `sum tmp dat 'x''. При этом можно + использовать вложенные конструкции, например `{sum {max dat + 'z'} 'x'}'. + Временные массивы не могут стоять в качестве первого аргумента + команд, создающих массивы (например, `new', `read', `hist' и т.д.). + + * К скалярным переменным, кроме собственно чисел, относятся: + специальные переменные `nan=#QNAN, pi=3.1415926..., on=1, off=0, + :=-1', переменные с суффиксами (*note Suffixes::), переменные + определенные командой *note define::. Также массивы размером 1x1x1 + считаются скалярами (например, `pi/dat.nx'). + Перед первым использованием все переменные должны быть определены с +помощью команд, создающих массивы (*note new::, *note var::, *note +list::, *note copy::, *note read::, *note hist::, *note sum:: и др., +*note Data create:: и *note Make another data::). + + Команды могут иметь несколько наборов аргументов (например, `plot +ydat' и `plot xdat ydat'). Все аргументы команды для выбранного набора +должны быть указаны, однако часть из них могут иметь значения по +умолчанию. Такие аргументы в описании команд будут помещены в +квадратные скобки [], например `plot ydat ['stl'='' zval=nan]'. При +этом запись `[arg1 arg2 arg3 ...]' подразумевает `[arg1 [arg2 [arg3 +...]]]', т.е. опускать можно только аргументы с конца, если вы согласны +с их значениями по умолчанию. Например, `plot ydat '' 1' или `plot ydat +''' правильно, а `plot ydat 1' не правильно (аргумент `'stl'' пропущен). + + Все команды MGL можно разделить на несколько групп. В дальнейшем +будет использованы следующие обозначения при описании команд: имя +команды выделено жирным, строки заключены в одинарные кавычки ", +переменные выделены курсивом, числа (скаляры) выделены моноширинным +шрифтом. Необязательные аргументы будут помещены в квадратные скобки [] +и показаны их значения по умолчанию. Подробную информацию о цвете и +стиле линий (*note Line styles::), цветовых схемах (*note Color +scheme::), стиле текста и символах TeX (*note Font styles::), текстовых +формулах (*note Textual formulas::) можно найти в соответствующих +разделах. + +* Menu: + + +* General concepts:: +* Graphics setup :: +* Axis settings :: +* Transformation matrix :: +* Export to file :: +* Primitives drawing :: +* Text printing :: +* Axis and Colorbar :: +* Legend :: +* 1D plotting :: +* 2D plotting :: +* 3D plotting :: +* Dual plotting :: +* Vector fields :: +* Other plotting :: +* Nonlinear fitting :: +* Data create :: +* Data filling :: +* Rearrange data :: +* File I/O :: +* Make another data :: +* Change data :: +* Operators :: +* Program flow :: +* Command options :: +* Suffixes:: +* Utilities:: + + +File: mgl_ru.info, Node: General concepts, Prev: Utilities, Up: MGL interface + +1.1 Основные принципы +===================================== + +Возможности библиотеки MathGL довольно богаты - число только основных +типов графиков превышает 50 видов. Кроме того, есть функции для +обработки данных, настройки вида графика и пр. и пр. Тем не менее, я +старался придерживаться единого стиля в порядке аргументов функций и +способе их "настройки". В основном все ниже сказанное относится к +функциям рисования различных графиков. + + Всего основных концепций (базисных идей) четыре: + 1. *Все настройки графиков (стиль линий, цветовые схемы поверхностей, + стиль и цвет текста) задаются строками.* Это обеспечивает: + удобство для пользователя - короткую строку легче читать и здесь + тяжелее ошибиться, чем в большом списке параметров; переносимость + - строки выглядят одинаково на всех платформах и не надо + заботиться о типе и числе аргументов. + + 2. *Все функции имеют "упрощенный" и "продвинутый" варианты.* Сделано + опять из-за удобства. В "упрощенном" варианте для построения + графика нужны только один-два массив(а) данных, которые + автоматически равнораспределяются в заданном диапазоне осей + координат. В "продвинутой" версии можно не только указать явно + диапазон построения графика, но и задать его параметрически. + Последнее позволяет легко строить довольно сложные кривые и + поверхности. В обоих вариантах функций порядок аргументов + стандартен: сначала идут массивы данных, потом необязательный + строковый параметр стиля графика, а далее - второстепенные + необязательные параметры для более точной настройки графика. + + 3. *Все элементы рисунков векторные.* Изначально библиотека MathGL + была ориентированна на работу с научными данными, которые по своей + природе векторные (линии, грани, матрицы и т.д.). Поэтому + векторность используется во всех рисунках! Причем иногда даже в + ущерб производительности (например, при выводе шрифтов). Помимо + всего прочего, векторность позволяет легко масштабировать рисунок + - измените размер картинки в 2 раза, и рисунок пропорционально + растянется. + + 4. *Новые графики не удаляют уже нарисованное.* Этот, в чем-то + неожиданный, подход позволяет создавать огромное количество + "комбинированных" графиков. Например, поверхность с наложенными + линиями уровня строится двумя последовательными вызовами функций + рисования поверхности и линий уровня (в любом порядке). И + совершенно не надо писать специальную функцию (как в Matlab и + некоторых других программах) для рисования этого графика. Примеров + таких графиков можно привести множество (см. раздел *note Hints:: + и сайт программы `http://mathgl.sf.net/index.html'). + + Кроме основных концепций я хотел бы остановиться на нескольких, как +оказалось, нетривиальных моментах - способе указания положения графика, +осей координат и строковых параметров линий, поверхностей, текста. + +* Menu: + +* Coordinate axes:: +* Line styles:: +* Color scheme:: +* Font styles:: +* Textual formulas:: + + +File: mgl_ru.info, Node: Coordinate axes, Next: Line styles, Up: General concepts + +1.1.1 Оси координат +------------------------------- + +Представление системы координат в MathGL состоит из двух частей. +Вначале координаты нормируются в интервал MINxMAX (*note Axis +settings::). Если флаг CUT установлен, то точки вне интервала +отбрасываются, в противном случае, они проецируются на ограничивающий +параллелепипед (*note Cutting::). Кроме того, отбрасываются точки +внутри границ, определенных переменными CUTMINxCUTMAX и точки, для +которых значение функции `CutOff'() не равно нулю. После этого формулы +перехода в криволинейную систему координат `SetFunc()'применяются к +каждой точке. Наконец, точка данных отображается с помощью одной из +графических функций. + + Величины MAX, MIN можно изменять вручную. Однако, после этого +необходимо вызвать функцию `RecalcBorder()' для настройки графика. +Более удобный и безопасный путь состоит в вызове функций `Axis(), +SetRanges()' и др. В последнем случае функция `RecalcBorder()' +вызывается автоматически. Размеры осей можно задавать и автоматически +по минимальному и максимальному значениям массива данных. Для этого +предназначены функции `XRange(), YRange(), ZRange()'. Второй не +обязательный аргумент указывает, заменять ли новые значения диапазона +изменения оси координат (по умолчанию) или только расширить уже +существующий диапазон. + + Точка пересечения осей координат задается переменной ORG и действует +на последующие вызовы функций рисования осей координат и сетки. По +умолчанию, если точка пересечения осей координат попадает вне диапазона +осей координат, то она проецируется на границу области. Изменить такое +поведение можно, задав AUTOORG=`false'. В случае, если одно из значений +ORG равно NAN, то соответствующее значение будет выбрано автоматически. + + Кроме привычных осей _x, y, z_ есть еще одна ось - цветовая шкала - +ось _c_. Она используется при окрашивании поверхностей и задает границы +изменения функции при окрашивании. При вызове `Axis()' ее границы +автоматически устанавливаются равными Min.z и Max.z. Возможно и ручное +изменение границ цветового интервала посредством вызова функции +`CAxis()' или изменение границ по заданному массиву `CRange()'. +Используйте `Colorbar()' для отображения цветовой шкалы. + + Вид меток по осям определяется функцией `SetTicks()' (*note Axis +settings::). Она имеет 3 аргумента: первый D задает шаг меток (если +положительны) или их число (если отрицательны) или логарифмические +метки (если равны нулю); второ NS задает число "подметок"; последний +определяет начальную точку для меток (по умолчанию это точка +пересечения осей). Функция SETTUNETICKS включает/выключает выделение +общего множителя (большого или малого факторов в диапазоне) для меток +осей координат. Наконец, если стандартный вид меток не устраивает +пользователя, то их шаблон можно задать явно (можно использовать и ТеХ +символы), воспользовавшись функциями `SetXTT(), SetYTT(). SetZTT(). +SetCTT()'. Кроме того, в качестве меток можно вывести произвольный +текст использовав функцию `SetTicksVal()'. + + +File: mgl_ru.info, Node: Line styles, Next: Color scheme, Prev: Coordinate axes, Up: General concepts + +1.1.2 Стиль линий +--------------------------- + +Стиль линии задается строкой, которая может содержать символ цвета +(`wkrgbcymhRGBCYMHWlenupqLENUPQ'), тип пунктира (`-|;:ji' или пробел), +ширину линии (`0123456789') и тип маркера (`o+xsd.^v' и модификатор +`#'). Если пропущен цвет или тип пунктира, то используется значение по +умолчанию с последним указанным цветом или значение из палитры (для +*note 1D plotting::). По умолчанию палитры содержит следующие цвета: +темно серый `H', синий `b', зеленый `g', красный `r', голубой `c', +пурпурный `m', yellow `y', серый `h', сине-зеленый `l', небесно-синий +`n', оранжевый `q', желто-зеленый `e', сине-фиолетовый `u', фиолетовый +`p'. + + Символы цвета те же, что и в классе mglColor (*note mglColor +class::): `k' - черный, `r' - красный, `R' - темно красный, `g' - +зеленый, `G' - темно зеленый, `b' - синий, `B' - темно синий, `c' - +голубой, `C' - темно голубой, `m' - пурпурный, `M' - темно пурпурный, +`y' - желтый, `Y' - темно желтый (золотой), `h' - серый, `H' - темно +серый, `w' - белый, `W' - светло серый, `l' - сине-зеленый, `L' - темно +сине-зеленый, `e' - желто-зеленый, `E' - темно желто-зеленый, `n' - +небесно-синий, `N' - темно небесно-синий, `u' - сине-фиолетовый, `U' - +темно сине-фиолетовый, `p' - фиолетовый, `P' - темно фиолетовый, `q' - +оранжевый, `Q' - темно оранжевый (коричневый). + + Тип пунктира: пробел - нет линии (для рисования только маркеров), +`-' - сплошная линия (################), `|' - длинный пунктир +(########________), `;' - пунктир (####____####____), `=' - короткий +пунктир (##__##__##__##__), `:' - точки (#___#___#___#___), `j' - +пунктир с точками (#######____#____), `i' - мелкий пунктир с точками +(###__#__###__#__). + + Типы маркеров: `o' - окружность, `+' - крест, `x' - косой крест, `s' +- квадрат, `d' - ромб, `.' - точка, `^' - треугольник вверх, `v' - +треугольник вниз, `<' - треугольник влево, `>' - треугольник вправо, +`#*' - знак Y, `#+' - крест в квадрате, `#x' - косой крест в квадрате, +`#.' - точка в окружности. Если в строке присутствует символ `#', то +используются символы с заполнением. + +[image src="../png/sample5.png"] + +Стили линий и маркеров. + + На конце и в начале линии можно выводить специальный символ +(стрелку), если в строке указать один из символов: `A' - стрелка +наружу, `V' - стрелка внутрь, `I' - поперечная черта, `K' - стрелка с +чертой, `T' - треугольник, `S' - квадрат, `D' - ромб, `O' - круг, `_' - +нет стрелки (по умолчанию). При этом действует следующее правило: +первый символ определяет стрелку на конце линии, второй символ - +стрелку в начале линии. Например, `r-A' - красная сплошная линия со +стрелкой на конце, `b|AI' - синий пунктир со стрелкой на конце и чертой +вначале, `_O' - линия с текущим стилем и кружком вначале. Эти стили +действуют и при построении графиков (например, *note 1D plotting::). + +[image src="../png/sampled.png"] + +Стили стрелок. + + +File: mgl_ru.info, Node: Color scheme, Next: Font styles, Prev: Line styles, Up: General concepts + +1.1.3 Цветовая схема +--------------------------------- + +Цветовая схема используется для определения цвета поверхностей, линий +уровня и пр. Цветовая схема задается строкой _s_, которая содержит +символы цвета (*note Line styles::) или символы `d#:|'. Символ `d' +указывает на определение цвета в зависимости от положения точки в +пространстве, а не по амплитуде данных. Символ `#' переключает +рисование поверхности на сетчатое (для трехмерных поверхностей) или +включает рисование сетки на поверхности. Символ `|' отключает +интерполяцию цвета в цветовой схеме. Это может быть полезно для +"резких" цветов, например, при рисовании матриц. Если в строке +встречается символ `:', то он принудительно заканчивает разбор строки +для стиля поверхности. После этого символа могут идти описание стиля +текста или оси вращения кривой/линий уровня. Цветовая схема может +содержать до 32 значений цвета. + + В цветовой схеме можно использовать тональные ("подсвеченные") цвета +(_не в стиле линий!_). Тональный цвет задается двумя символами: первый +- обычный цвет, второй - его яркость цифрой. Цифра может быть в +диапазоне `1'...`9'. При этом `5' соответствует нормальному цвету, `1' +- очень темная версия цвета (почти черный), `9' - очень светлая версия +цвета (почти белый). Например цветовая схема может быть `b2b7wr7r2'. + +[image src="../png/colors.png"] + +Цвета и их идентификаторы. + + При определении цвета по _амплитуде_ (наиболее часто используется) +окончательный цвет определяется путем линейной интерполяции массива +цветов. Массив цветов формируется из цветов, указанных в строке +спецификации. Аргумент - амплитуда, нормированная между CMIN - CMAX +(*note Axis settings::). Например, строка из 4 символов `bcyr' +соответствует изменению цвета от синего (минимальное значение) через +голубой и желтый (промежуточные значения) к красному (максимальное +значение). Строка `kw' соответствует изменению цвета от черного +(минимальное значение) к белому (максимальное значение). Строка из +одного символа (например, `g') соответствует однотонному цвету (в +данному случае зеленому). + + Есть несколько полезных цветовых схем. Строка `kw' дает обычную +серую (черно-белую) схему, когда большие значения светлее. Строка `wk' +представляет обратную серую схему, когда большие значения темнее. +Строки `kRryw', `kGgw', `kBbcw' представляют собой хорошо известные +схемы _hot_, _summer_ и _winter_. Строки `BbwrR' и `bBkRr' позволяют +рисовать двухцветные фигуры на белом или черном фоне, когда +отрицательные значения показаны синим цветом, а положительные - +красным. Строка `BbcyrR' дает цветовую схему, близкую к хорошо +известной схеме _jet_. + +[image src="../png/color_schemes.png"] + +Наиболее популярные цветовые схемы. + + При определении цвета по _положению точки в пространстве_ +окончательный цвет определяется по формуле c=x*c[1] + y*c[2] + z*c[3]. +Здесь c[1], c[2], c[3] - первые три цвета в цветовом массиве; x, y, z - +координаты точки, нормированные на MINxMAX. Такой тип определения цвета +полезен, например, при построении поверхностей уровня, когда цвет дает +представление о положении точки в пространстве. + + +File: mgl_ru.info, Node: Font styles, Next: Textual formulas, Prev: Color scheme, Up: General concepts + +1.1.4 Стиль текста +----------------------------- + +Стиль текста задается строкой, которая может содержать несколько +символов: тип шрифта (`ribwou') и/или выравнивания (`LRC'), а также +цвет текста `wkrgbcymhRGBCYMHW' (*note Line styles::) после символа +`:'. Например, `biC:b' соответствует жирному курсиву с выравниванием по +центру синего цвета. + + Начертания шрифта: `r' - прямой шрифт, `i' - курсив, `b' - жирный. +По умолчанию используется прямой шрифт. Типы выравнивания текста: `L' - +по левому краю (по умолчанию), `C' - по центру, `R' - по правому краю. +Дополнительные эффекты шрифта: `w' - контурный, `o' - надчеркнутый, `u' +- подчеркнутый. + + Синтаксический разбор LaTeX-их команд по умолчанию включен. Это +команды смены стиля текста (например, \b для жирного текста): \a или +\overline - надчеркивание, \b или \textbf - жирный, \i или \textit - +курсив, \r или \textrm - прямой (отменяет стили жирного и курсива), \u +или \underline - подчеркнутый, \w или \wire - контурный, \big - +большего размера, @ - меньшего размера. Нижний и верхний индексы +задаются символами `_' и `^'. При этом изменение стиля применяется +только к следующему символу или к символам в фигурных скобках {}, +которые понимаются как единый блок. Например, сравните строки `sin +(x^{2^3})' и `sin (x^2^3)'. Можно также менять цвет текста внутри +строки с помощью команд #? или \color?, где `?' - символ цвета (*note +Line styles::). Например, слова `Blue' и `red' будут окрашены в +соответствующий цвет в строке `#b{Blue} and \colorr{red} text'. +Большинство функций понимает символ новой строки `\n' и позволяет +выводить много строчный текст. Наконец, можно использовать символы с +произвольным UTF кодом с помощью команды `\utf0x????'. Например, +`\utf0x3b1' даст символ \alpha. + + Распознаются также большинство символов TeX и AMSTeX, команды смены +стиля текста (\textrm, \textbf, \textit, \textsc, \overline, +\underline), акценты (\hat, \tilde, \dot, \ddot, \acute, \check, +\grave, \bar, \breve) и корни (\sqrt, \sqrt3, \sqrt4). Полный список +содержит около 2000 символов. Отмечу, что первый пробел (пробел, +табуляция и пр.) после команды игнорируется, а все остальные пробелы +печатаются обычным образом. Например, следующие строки дают одинаковый +результат \tilde a: `\tilde{a}'; `\tilde a'; `\tilde{}a'. + + В частности, распознаются греческие буквы: \alpha - \alpha, \beta - +\beta, \gamma - \gamma, \delta - \delta, \epsilon - \epsilon, \eta - +\eta, \iota - \iota, \chi - \chi, \kappa - \kappa, \lambda - \lambda, +\mu - \mu, \nu - \nu, o - \o, \omega - \omega, \phi - \phi, \pi - \pi, +\psi - \psi, \rho - \rho, \sigma - \sigma, \theta - \theta, \tau - +\tau, \upsilon - \upsilon, \xi - \xi, \zeta - \zeta, \varsigma - +\varsigma, \varepsilon - \varepsilon, \vartheta - \vartheta, \varphi - +\varphi, A - \Alpha, B - \Beta, \Gamma - \Gamma, \Delta - \Delta, E - +\Epsilon, H - \Eta, I - \Iota, C - \Chi, K - \Kappa, \Lambda - \Lambda, +M - \Mu, N - \Nu, O - \O, \Omega - \Omega, \Phi - \Phi, \Pi - \Pi, \Psi +- \Psi, R - \Rho, \Sigma - \Sigma, \Theta - \Theta, T - \Tau, \Upsilon +- \Upsilon, \Xi - \Xi, Z - \Zeta. + + Еще примеры наиболее общеупотребительных TeX-их символов: \angle - +\angle, \aleph - \aleph, \cdot - \cdot, \clubsuit - \clubsuit, \cup - +\cup, \cap - \cap, \diamondsuit - \diamondsuit, \diamond - \diamond, +\div - \div, \downarrow - \downarrow, \dag - \dag, \ddag - \ddag, +\equiv - \equiv, \exists - \exists, \frown - \frown, \flat - \flat, \ge +- \ge, \geq - \geq, \gets - \gets, \heartsuit - \heartsuit, \infty - +\infty, \in - \in, \int - \int, \Im - \Im, \langle - \langle, \le - +\le, \leq - \leq, \leftarrow - \leftarrow, \mp - \mp, \nabla - \nabla, +\ne - \ne, \neq - \neq, \natural - \natural, \oint - \oint, \odot - +\odot, \oplus - \oplus, \partial - \partial, \parallel - \parallel, +\perp - \perp, \pm - \pm, \propto - \propto, \prod - \prod, \Re - \Re, +\rightarrow - \rightarrow, \rangle - \rangle, \spadesuit - \spadesuit, +\sim - \sim, \smile - \smile, \subset - \subset, \supset - \supset, +\surd - \sqrt or \surd, \S - \S, \sharp - \sharp, \sum - \sum, \times - +\times, \to - \to, \uparrow - \uparrow, \wp - \wp and so on. + + Размер текста может быть задан явно (если SIZE>0) или относительно +базового размера шрифта для рисунка |SIZE|*FONTSIZE при SIZE<0. +Значение SIZE=0 указывает, что соответствующая строка выводиться не +будет. Базовый размер шрифта измеряется во внутренних единицах. +Специальные функции `SetFontSizePT(), SetFontSizeCM(), SetFontSizeIN()' +позволяют задавать его в более "привычных" единицах. + + +File: mgl_ru.info, Node: Textual formulas, Prev: Font styles, Up: General concepts + +1.1.5 Текстовые формулы +--------------------------------------- + +MathGL имеет быстрый парсер текстовых формул , понимающий большое число +функций и операций. Базовые операции: `+' - сложение, `-' - вычитание, +`*' - умножение, `/' - деление, `^' - возведение в целосичленную +степень. Также есть логические операции: `<' - истина если if x' +- истина если x>y, `=' - истина если x=y, `&' - истина если x и y оба +не равны нулю, `|' - истина если x или y не нуль. Логические операции +имеют наинизший приоритет и возвращают 1 если истина или 0 если ложно. + + Базовые функции: `sqrt(x)' - квадратный корень из X, `pow(x,y)' - X +в степени Y, `ln(x)' - натуральный логарифм X, `lg(x)' - десятичный +логарифм X, `log(a,x)' - логарифм по основанию A от X, `abs(x)' - +модуль X, `sign(x)' - знак X, `mod(x,y)' - остаток от деления x на y, +`step(x)' - ступенчатая функция, `int(x)' - целая часть X, `rnd' - +случайное число, `pi' - число \pi=3.1415926... + + Тригонометрические функции: `sin(x)', `cos(x)', `tan(x)' (или +`tg(x)'). Обратные тригонометрические функции: `asin(x)', `acos(x)', +`atan(x)'. Гиперболические функции: `sinh(x)' (или `sh(x)'), `cosh(x)' +(или `ch(x)'), `tanh(x)' (или `th(x)'). Обратные гиперболические +функции: `asinh(x)', `acosh(x)', `atanh(x)'. + + Специальные функции: `gamma(x)' - гамма функция \Gamma(x) = +\int_0^\infty dt t^{x-1} \exp(-t) , `psi(x)' - дигамма функция \psi(x) += \Gamma’(x)/\Gamma(x) для x!=0, `ai(x)' - Эйри функция +Ai(x), `bi(x)' - Эйри функция Bi(x), `cl(x)' - функция Клаузена, +`li2(x)' (или `dilog(x)') - дилогарифм Li_2(x) = - \Re \int_0^x ds +\log(1-s)/s, `sinc(x)' - функция sinc(x) = \sin(\pi x) / (\pi x) для +любых x, `zeta(x)' - зета функция Римана \zeta(s) = \sum_{k=1}^\infty +k^{-s} для s!=1, `eta(x)' - эта функция \eta(s) = (1-2^{1-s}) \zeta(s) +для произвольного s, `lp(l,x)' - полином Лежандра P_l(x), (|x|<=1, +l>=0), `w0(x)', `w1(x)' - функции Ламберта W. Функции W(x) определены +как решение уравнения W \exp(W) = x. + + Экспоненциальные интегралы: `ci(x)' - cos-интеграл Ci(x) = \int_0^x +dt \cos(t)/t, `si(x)' - sin-интеграл Si(x) = \int_0^x dt \sin(t)/t, +`erf(x)' - функция ошибки erf(x) = (2/\sqrt(\pi)) \int_0^x dt +\exp(-t^2), `ei(x)' - интеграл Ei(x) := - PV(\int_{-x}^\infty dt +\exp(-t)/t) (где PV обозначает главное значение), `e1(x)' - интеграл +E_1(x) := Re \int_1^\infty dt \exp(-xt)/t , `e2(x)' - интеграл E_2(x) +:= Re \int_1^\infty dt \exp(-xt)/t^2, `ei3(x)' - интеграл Ei_3(x) = +\int_0^x dt \exp(-t^3) для x>=0. + + Функции Бесселя: `j(nu,x)' - функция Бесселя первого рода, `y(nu,x)' +- функция Бесселя второго рода, `i(nu,x)' - модифицированная функция +Бесселя первого рода, `k(nu,x)' - модифицированная функция Бесселя +второго рода. + + Эллиптические интегралы: `ee(k)' - полный эллиптический интеграл +E(k) = E(\pi/2, k), `ek(k)' - полный эллиптический интеграл K(k) = +F(\pi/2, k), `e(phi,k)' - эллиптический интеграл E(\phi,k) = +\int_0^\phi dt \sqrt((1 - k^2 \sin^2(t))), `f(phi,k)' - эллиптический +интеграл F(\phi,k) = \int_0^\phi dt 1/\sqrt((1 - k^2 \sin^2(t))). + + Функции Якоби: `sn(u,m)', `cn(u,m)', `dn(u,m)', `sc(u,m)', +`sd(u,m)', `ns(u,m)', `cs(u,m)', `cd(u,m)', `nc(u,m)', `ds(u,m)', +`dc(u,m)', `nd(u,m)'. + + Некоторые из функций могут быть недоступны если флаг NO_GSL был +определен при компиляции библиотеки MathGL. + + При разборе формул нет различия между верхним и нижним регистром. +Если аргумент лежит вне области определения функции, то возвращается +NaN. + + +File: mgl_ru.info, Node: Graphics setup, Next: Axis settings, Prev: General concepts, Up: MGL interface + +1.2 Настройка графика +===================================== + +Команды в этой группе влияют на вид всего рисунка. Соответственно они +должны располагаться _перед_ вызовом функций непосредственно рисующих +графики. + +* Menu: + +* Transparency :: +* Lighting :: +* Fog :: +* Default sizes :: +* Zooming :: +* Cutting :: +* Other settings :: + + +File: mgl_ru.info, Node: Transparency, Next: Lighting, Up: Graphics setup + +1.2.1 Прозрачность +------------------------------ + +Эти команды настраивают тип и степень прозрачности поверхностей. +Главной является функция *note alpha::, которая включает/выключает +прозрачность для всех графиков, созданных после вызова *note alpha::. +Функция *note alphadef:: устанавливает величину alpha-канала по +умолчанию. Прозрачность можно выключить для отдельного графика с +помощью *note transparent::. Наконец, функция *note transptype:: задает +тип прозрачности. См. раздел *note Transparent surface sample::, для +примеров кода и графика. + + -- Команда MGL: alpha `[val=on]' + Включает/выключает прозрачность для _всего_ рисунка. По умолчанию + прозрачность выключена. Используйте `transparent off' для + конкретного графика для выключения прозрачности. + + -- Команда MGL: alphadef `val' + Задает значение прозрачности по умолчанию для всех графиков. + Начальное значение 0.5. + + -- Команда MGL: transparent `val' + Временно включает/возвращает прозрачность графиков. + + -- Команда MGL: transptype `val' + Задает тип прозрачности. Обычная прозрачность (`0') - "закрытые" + объекты видны меньше чем закрывающие. "Стеклянная" прозрачность + (`1') - закрытые и закрывающие объекты единообразно ослабляют + интенсивность света (по RGB каналам). "Ламповая" прозрачность + (`2') - закрытые и закрывающие объекты являются источниками + дополнительного освещения (рекомендую установить `alphadef 0.3' + или меньше в этом случае). *Note Normal transparency::, *note + Glass-like transparency::, *note Lamp-like transparency::. + + +File: mgl_ru.info, Node: Lighting, Next: Fog, Prev: Transparency, Up: Graphics setup + +1.2.2 Освещение +------------------------ + +Эти функции настраивают освещение графика. Главная функция *note +light:: включает/выключает освещение графиков построенных после ее +вызова. MathGL поддерживает до 10 независимых источников света. +Положение, цвет, яркость каждого источника света можно задавать по +отдельности. По умолчанию включен только первый (с порядковым номером +`0') источник света белого цвета, расположенный сверху. + + -- Команда MGL: light `[val=on]' + Включает/выключает освещение графика. По умолчанию освещение + выключено. + + -- Команда MGL: light `n val' + Включает/выключает N-ый источник света. + + -- Команда MGL: light `n xpos ypos zpos' ['col'='w' `br=0.5'] + Добавляет источник света с номером N в положение {XPOS, YPOS, + ZPOS} с цветом COL и яркостью BR, которая должна быть в диапазоне + [0,1]. + + -- Команда MGL: ambient `val' + Задает яркость рассеянного освещения. Значение должно быть в + диапазоне [0,1]. + + +File: mgl_ru.info, Node: Fog, Next: Default sizes, Prev: Lighting, Up: Graphics setup + +1.2.3 Туман +---------------- + + -- Команда MGL: fog `val [dz=0.25]' + Имитирует туман на графике. Туман начинается на относительном + расстоянии DZ от точки обзора и его плотность растет + экспоненциально вглубь по закону ~1-exp(-d*z). Здесь _z_ - + нормализованная на 1 глубина графика. Если D=`0' то туман + отсутствует. См. раздел *note Surface in fog sample::, для + примеров кода и графика. + + +File: mgl_ru.info, Node: Default sizes, Next: Zooming, Prev: Fog, Up: Graphics setup + +1.2.4 Базовые размеры +----------------------------------- + +Эти команды задают величины большинства параметров графика, включая +размеры маркеров, стрелок, толщину линий и т.д. Как и любые другие +настройки, они подействуют только на графики созданные после изменения +настроек. + + -- Команда MGL: barwidth `val' + Относительный размер прямоугольников в `bars, barh, boxplot'. + Значение по умолчанию `0.7'. + + -- Команда MGL: marksize `val' + Размер маркеров для *note 1D plotting::. Значение по умолчанию `1'. + + -- Команда MGL: arrowsize `val' + Размер стрелок для *note 1D plotting::, линий и кривых (*note + Primitives drawing::). Значение по умолчанию `1'. + + -- Команда MGL: linewidth `val' + Базовая толщина линий. Значения <1 игнорируются. Для значений >1 + реальная толщина получается перемножением указанной ширины линии + на данное значение. Увеличение ширины линии актуально для больших + растровых рисунков. Значение по умолчанию `1'. + + -- Команда MGL: ticklen `val' [`stt=1'] + Относительная длина меток осей координат. Значение по умолчанию + `0.1'. Параметр STT>0 задает относительную длину подметок, которые + в `sqrt(1+stt)' раз меньше. + + -- Команда MGL: tickstl 'stl' ['sub'="] + Стиль меток (STL) и подметок (SUB) осей координат. Если `stl=''', + то используется стиль по умолчанию (`k' или `w' в зависимости от + типа прозрачности). Если `sub=''', то используется стиль меток + (т.е. STL). + + +File: mgl_ru.info, Node: Zooming, Next: Cutting, Prev: Default sizes, Up: Graphics setup + +1.2.5 Масштабирование +------------------------------------ + +Эти команды управляют масштабированием всего рисунка (*note zoom::) или +отдельной картинки (*note plotfactor::). Обычно эти функции +используются для удаления пустого места вокруг графиков. + + -- Команда MGL: plotfactor `val' + Масштаб картинки (значение должно быть больше 1). Не рекомендуется + устанавливать значения меньше 1.5. Это аналог *note zoom::, но + применяется только к конкретной картинке, заданной *note inplot::. + Используйте ноль для включения автоматического масштабирования. + + -- Команда MGL: zoom `x1 y1 x2 y2' + Масштабирует весь рисунок. После вызова функции текущий график + будет очищен и в дальнейшем рисунок будет содержать только область + [x1,x2]*[y1,y2] от исходного рисунка. Координаты X1, X2, Y1, Y2 + меняются в диапазоне от 0 до 1. Внимание! эти настройки не могут + быть переписаны никакими другими функциями. Используйте `zoom 0 0 + 1 1' для перехода в масштаб по умолчанию. + + +File: mgl_ru.info, Node: Cutting, Next: Other settings, Prev: Zooming, Up: Graphics setup + +1.2.6 Обрезание +------------------------ + +Эти команды задают условия когда точка будет исключена (вырезана) из +рисования. Замечу, что все точки со значением(-ями) `nan' по одной из +координат или амплитуде автоматически исключаются из рисования. + + -- Команда MGL: cut `val' + Задает обрезание точек за пределами осей координат. Если `on' то + такие точки исключаются из рисования (это по умолчанию) иначе они + проецируются на ограничивающий прямоугольник. + + -- Команда MGL: cut `x1 y1 z1 x2 y2 z2' + Задает границы параллелепипеда внутри которого точки не рисуются. + Если границы одинаковы (переменные равны), то параллелепипеда + считается пустым. См. раздел *note CutMinMax sample::, для + примеров кода и графика. + + -- Команда MGL: cut 'cond' + Задает условие обрезания по формуле COND. Это условие исключает + точки из рисования если результат вычисления формулы не равен + нулю. Установите аргумент `''' для выключения условия обрезания. + См. раздел *note CutOff sample::, для примеров кода и графика. + + +File: mgl_ru.info, Node: Other settings, Prev: Cutting, Up: Graphics setup + +1.2.7 Прочие настройки +------------------------------------- + + -- Команда MGL: font 'fnt' [`val=6'] + Задает стиль и размер шрифта (*note Text printing::). Вначале + используется `rC' - прямой шрифт с выравниванием по центру. По + умолчанию размер подписей оси координат в 1.4 раза больше. + + -- Команда MGL: rotatetext `val' + Включает/выключает вращение меток и подписей осей координат вдоль + оси. Начальное значение `on'. + + -- Команда MGL: palette 'colors' + Задает палитру как последовательность цветов. Значение по + умолчанию `"Hbgrcmyhlnqeup"', что соответствует цветам: темно + серый `H', синий `b', зеленый `g', красный `r', голубой `c', + малиновый `m', желтый `y', серый `h', сине-зеленый `l', + небесно-голубой `n', оранжевый `q', желто-зеленый `e', + сине-фиолетовый `u', фиолетовый `p'. Палитра в основном + используется в 1D графиках (*note 1D plotting::) для кривых с + неопределенным стилем линии. + + -- Команда MGL: meshnum `num' + Задает ориентировочное число линий в *note mesh::, *note fall::, + *note grid::, число стрелок (штрихов) в *note vect::, *note dew:: + и число ячеек в *note cloud::. По умолчанию (=0) рисуются все + линии, стрелки, ячейки. + + -- Команда MGL: axialdir 'dir' + Задает ось вращения для *note axial::, *note torus::. По умолчанию + это 'z'. + + +File: mgl_ru.info, Node: Axis settings, Next: Transformation matrix, Prev: Graphics setup, Up: MGL interface + +1.3 Параметры осей координат +================================================== + +Этот большой набор команд определяет вид осей и меток координат. Перед +построением для каждой точки выполняются 3 преобразования: сначала +определяется возможность рисования точки (*note Cutting::), далее +применяются формулы перехода к криволинейным координатам и наконец +точка отображается. + + -- Команда MGL: axis `x1 y1 x2 y2' + -- Команда MGL: axis `x1 y1 z1 x2 y2 z2' + -- Команда MGL: ranges `x1 x2 y1 y2 [z1=0 z2=0]' + Задает диапазон изменения координат. Если минимальное и + максимальное значение координаты равны, то они игнорируются по + данному направлению. Также устанавливает размер цветовой шкалы, + аналогично команде `caxis z1 z2'. Начальные диапазоны равны [-1, + 1]. + + -- Команда MGL: axis 'fx' 'fy' ['fz'=" 'fa'="] + Задает формулы перехода к криволинейным координатам. Каждая строка + является математическим выражением, зависящим от старых координат + `x', `y', `z' и `a' или `c' для цветовой шкалы. Например, для + цилиндрических координат будет `axis 'x*cos(y)' 'x*sin(y)' 'z''. + Для удаления формул соответствующий параметр должен быть пустым + `'''. Использование формул преобразования слегка замедляет + программу, т.е.. `axis '' '' ''' быстрее чем `axis '1*x' '1*y' + '1*z''. Параметр FA задает аналогичную формулу для цветовой шкалы. + *Note Textual formulas::. + + -- Команда MGL: axis `how' + Устанавливает одну из предопределенных систем криволинейных + координат в зависимости от параметра HOW: `0' - декартова система + (нет преобразования координат, наиболее быстрая); `1' - полярные + координаты x_n=x*cos(y),y_n=x*sin(y), z_n=z; `2' - сферические + координаты x_n=x*sin(y)*cos(z), y_n=x*sin(y)*sin(z), z_n=x*cos(y); + `3' - параболические координаты x_n=x*y, y_n=(x*x-y*y)/2, z_n=z; + `4' - Paraboloidal coordinates x_n=(x*x-y*y)*cos(z)/2, + y_n=(x*x-y*y)*sin(z)/2, z_n=x*y; `5' - Oblate coordinates + x_n=cosh(x)*cos(y)*cos(z), y_n=cosh(x)*cos(y)*sin(z), + z_n=sinh(x)*sin(y); `6' - Prolate coordinates + x_n=sinh(x)*sin(y)*cos(z), y_n=sinh(x)*sin(y)*sin(z), + z_n=cosh(x)*cos(y); `7' - эллиптические координаты + x_n=cosh(x)*cos(y), y_n=sinh(x)*sin(y), z_n=z; `8' - тороидальные + координаты 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)); + `9' - бисферические координаты 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)); + `10' - биполярные координаты x_n=sinh(x)/(cosh(x)-cos(y)), + y_n=sin(y)/(cosh(x)-cos(y)), z_n=z. + + -- Команда MGL: caxis `z1 z2' + Задает масштаб цветовой шкалы (c-координаты). Эти значения + используются для определения цвета поверхностей и прочих 2D и 3D + графиков. Начальный диапазон равен [-1, 1]. + + -- Команда MGL: origin `x0 y0 [z0=nan]' + Задает центр пересечения осей координат. Если одно из значений + равно `nan', то выбрается оптимальное положение осей координат по + этому направлению. + + -- Команда MGL: ternary `val' + Задает рисование треугольных (Ternary) осей координат. Это + специальный тип графика для 3 зависимых координат (компонент) A, + B, C таких, что A+B+C=1. MathGL использует только 2 независимые + координаты A=x и B=y поскольку их достаточно для построения всех + графиков. При этом третья координата z является независимым + параметром для построения линий уровня, поверхностей и т.д. См. + раздел *note Ternary plot sample::, для примеров кода и графика. + + -- Команда MGL: xrange dat [`add=off fact=0'] + -- Команда MGL: yrange dat [`add=off fact=0'] + -- Команда MGL: zrange dat [`add=off fact=0'] + -- Команда MGL: crange dat [`add=off fact=0'] + Задает диапазон изменения x-,y-,z-,c- координат как минимальное и + максимальное значение массива DAT. Параметр ADD указывает + добавлять новый диапазон к существующему или заменять его. + Параметр FACT дополнительно расширяет диапазон на величину + (MAX-MIN)*FACT. + + -- Команда MGL: xrange `x1 x2' + -- Команда MGL: yrange `x1 x2' + -- Команда MGL: zrange `x1 x2' + -- Команда MGL: crange `x1 x2' + Задает диапазон изменения x-,y-,z-,c- координат. См. также *note + axis::. + + -- Команда MGL: xtick `val [sub=0 org=nan]' + -- Команда MGL: ytick `val [sub=0 org=nan]' + -- Команда MGL: ztick `val [sub=0 org=nan]' + -- Команда MGL: ctick `val' + Задает шаг меток осей VAL, число подметок NS и начальное положение + меток ORG. Переменная VAL задает шаг меток (если положительна) или + их число на оси (если отрицательна). Нулевое значение задает + логарифмические метки. Если ORG=`NAN', то используется значение из + *note origin::. + + -- Команда MGL: xtick 'templ' + -- Команда MGL: ytick 'templ' + -- Команда MGL: ztick 'templ' + -- Команда MGL: ctick 'templ' + Задает шаблоны для меток вдоль x-,y-,z-оси или colorbar. Шаблон + может содержать и символы TeX. Если XTT, YTT, ZTT, CTT=`''', то + используется шаблон по умолчанию (в простейшем случае `%.2g'). + Установка шаблона выключает автоматическое улучшение вида меток. + + -- Команда MGL: xtick `val1' 'lbl1' [`val2' 'lbl2' ...] + -- Команда MGL: ytick `val1' 'lbl1' [`val2' 'lbl2' ...] + -- Команда MGL: ztick `val1' 'lbl1' [`val2' 'lbl2' ...] + Задает явное положение VAL и подписи LBL для меток вдоль оси. + Метки могут содержать и символы TeX. + + -- Команда MGL: adjust ['dir'='xyzc'] + Автоматически задает шаг меток осей, число подметок и начальное + положение меток для осей координат DIR в виде наиболее удобном для + человека. + + +File: mgl_ru.info, Node: Transformation matrix, Next: Export to file, Prev: Axis settings, Up: MGL interface + +1.4 Матрица преобразования +=============================================== + +Эти команды контролируют где и как график будет расположен. Существует +определенный порядок вызова этих функций для лучшего вида графика. +Вначале должны вызываться команды *note subplot:: или *note inplot:: +для указания местоположения вывода. После них - команды вращения *note +rotate:: и сжатия *note aspect::. И наконец любые другие функции для +рисования графика. Вместо вращения графика можно вызвать команды *note +columnplot:: для расположения графиков в столбец одного над другим или +*note stickplot:: для расположения в линейку. + + -- Команда MGL: subplot `nx ny m [dx=0 dy=0]' + Помещает последующий вывод в M-ую ячейку сетки размером NX*NY от + всего рисунка. Функция сбрасывает матрицу трансформации (повороты + и сжатие графика) и должна вызываться первой для создания + "подграфика". С эстетической точки зрения не рекомендуется + вызывать эту функцию с различными (или не кратными) размерами + сетки. Ячейка может быть дополнительно сдвинута относительно + своего обычного положения на относительный размер DX, DY. + + -- Команда MGL: subplot `nx ny m' 'style' + Аналогично предыдущему, но место для осей/colorbar резервируется + только если строка STYLE содержит: `L' или `<' - с левого края, + `R' или `>' - с правого края, `A' или `^' - с верхнего края, `U' + или `_' - с нижнего края. + + -- Команда MGL: inplot `x1 x2 y1 y2 [rel=off]' + Помещает последующий вывод в прямоугольную область [X1, X2]*[Y1, + Y2] (исходный размер [0,1]*[0,1]). Эта функция позволяет поместить + график в произвольную область рисунка. Если параметр REL=`on', то + используется позиция относительно текщего *note subplot:: (или + *note inplot:: с REL=`off'). Функция сбрасывает матрицу + трансформации (повороты и сжатие графика) и должна вызываться + первой для создания "подграфика". + + -- Команда MGL: columnplot `num ind [d=0]' + Помещает последующий вывод в IND-ую строку столбца из NUM строк. + Положение столбца выбирается относительно последнего вызова *note + subplot:: (или *note inplot:: с REL=`off'). Параметр D задает + дополнительный зазор между строк. См. раздел *note ColumnPlot + sample::, для примеров кода и графика. + + -- Команда MGL: stickplot `num ind tet phi' + Помещает последующий вывод в IND-ую ячейку "бруска" из NUM ячеек. + При этом сам брусок повернут на углы TET, PHI. Положение + выбирается относительно последнего вызова *note subplot:: (или + *note inplot:: с REL=`off'). См. раздел *note StickPlot sample::, + для примеров кода и графика. + + -- Команда MGL: rotate `tetz tetx [tety=0]' + Вращает систему координат относительно осей {x, z, y} + последовательно на углы TETX, TETZ, TETY. + + -- Команда MGL: rotate `tet x y z' + Вращает систему координат относительно вектора {X, Y, Z} на угол + TET. + + -- Команда MGL: aspect `ax ay [az=1]' + Устанавливает соотношение размеров осей в отношении AX:AY:AZ. Для + лучшего вида следует вызывать после функции *note rotate::. + + -- Команда MGL: perspective `val' + Добавляет (включает) перспективу для графика. Параметр val ~ + 1/z_{eff} \in [0,1). По умолчанию (`val=0') перспектива отключена. + + +File: mgl_ru.info, Node: Export to file, Next: Primitives drawing, Prev: Transformation matrix, Up: MGL interface + +1.5 Экспорт в файл +============================== + + -- Команда MGL: write 'fname' [`solid=off'] + Экспортирует текущий кадр в файл 'fname' (тип определяется по + расширению). Параметр SOLID задает вывод картинки на текущем фоне + (обычно белом) или полупрозрачной. Если 'fname'=", то используется + имя `frame####.jpg', где `####' - текущий номер кадра. + + -- Команда MGL: setsize `w h' + Изменяет размер картинки в пикселях. Функция должна вызываться + *перед* любыми функциями построения потому что полностью очищает + содержимое рисунка. В некоторых программах исполнение этой команды + может запрещено. + + +File: mgl_ru.info, Node: Primitives drawing, Next: Text printing, Prev: Export to file, Up: MGL interface + +1.6 Рисование примитивов +=========================================== + +Эти команды рисуют рисуют простые объекты типа линий, точек, сфер, +капель, конусов, и т.д. + + -- Команда MGL: clf + Очищает рисунок и заполняет его цветом по умолчанию (обычно белым). + + -- Команда MGL: ball `x y' ['col'='r'] + -- Команда MGL: ball `x y z' ['col'='r'] + Рисует точку (шарик) с координатами {X, Y, Z} и цветом COL. + + -- Команда MGL: line `x1 y1 x2 y2' ['stl'="] + -- Команда MGL: line `x1 y1 z1 x2 y2 z2' ['stl'="] + Рисует геодезическую линию (декартовых координатах - прямую) из + точки {X1,Y1,Z1} в {X2,Y2,Z2} использую стиль линии STL. Кривая + рисуется даже если часть ее лежит вне диапазона осей координат. + + -- Команда MGL: curve `x1 y1 dx1 dy1 x2 y2 dx2 dy2' ['stl'="] + -- Команда MGL: curve `x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2' + ['stl'="] + Рисует кривую Безье из точки {X1,Y1,Z1} в {X2,Y2,Z2} использую + стиль линии STL. Касательные в точках пропорциональны + {DX1,DY1,DZ1}, {DX2,DY2,DZ2}. Кривая рисуется даже если часть ее + лежит вне диапазона осей координат. + + -- Команда MGL: facex `x0 y0 z0 wy wz' ['stl'=" `d1=0 d2=0'] + -- Команда MGL: facey `x0 y0 z0 wx wz' ['stl'=" `d1=0 d2=0'] + -- Команда MGL: facez `x0 y0 z0 wx wy' ['stl'=" `d1=0 d2=0'] + Рисует закрашенный прямоугольник (грань) перпендикулярно оси + [x,y,z] в точке {X0, Y0, Z0} цветом STL и шириной WX, WY, WZ вдоль + соответствующего направления. При этом цвет может быть один для + всей грани, или различным для разных вершин если указаны все 4 + цвета (полезно для градиента цвета, например `wwrr'). Параметры + D1!=0, D2!=0 задают дополнительный сдвиг последней точки (т.е. + рисуют четырехугольник). Грань будет нарисована даже если часть ее + лежит вне диапазона осей координат. + + -- Команда MGL: sphere `x0 y0 r' ['col'='r'] + -- Команда MGL: sphere `x0 y0 z0 r' ['col'='r'] + Рисует сферу радиуса R с центром в точке {X, Y, Z} цветом STL. + + -- Команда MGL: drop `x0 y0 dx dy r' ['col'='b' `sh=1 asp=1'] + -- Команда MGL: drop `x0 y0 z0 dx dy dz r' ['col'='b' `sh=1 asp=1'] + Рисует каплю радиуса R в точке {X0,Y0,Z0} вытянутую вдоль + направления {DX,DY,DZ} цветом COL. Параметр SH определяет степень + вытянутости: `0' - сфера, `1' - классическая капля. Параметр ASP + определяет относительную ширину капли (аналог "эллиптичности" для + сферы). См. раздел *note Drops sample::, для примеров кода и + графика. + + -- Команда MGL: cone `x1 y1 z1 x2 y2 z2 r1' [`r2=-1' 'stl'=" + `edge=off'] + Рисует трубу (или усеченный конус если EDGE=`off') между точками + {X1,Y1,Z1}, {X2,Y2,Z2} с радиусами на концах R1, R2. Если R2<0, то + полагается R2=R1. Цвет конуса задается строкой STL. + + -- Команда MGL: rect `x1 y1 x2 y2' ['st'="] + -- Команда MGL: rect `x1 y1 z1 x2 y2 z2' ['st'="] + Рисует закрашенный прямоугольник (грань) с противоположными + вершинами в точках {X1,Y1,Z1}, {X2,Y2,Z2} цветом STL. При этом + цвет может быть один для всей грани, или различным для разных + вершин если указаны все 4 цвета (полезно для градиента цвета, + например `wwrr'). Грань будет нарисована даже если часть ее лежит + вне диапазона осей координат. + + +File: mgl_ru.info, Node: Text printing, Next: Axis and Colorbar, Prev: Primitives drawing, Up: MGL interface + +1.7 Вывод текста +=========================== + +Команды для вывода текста позволяют вывести строку текста в +произвольном месте рисунка, в произвольном направлении и вдоль +произвольной кривой. Можно использовать произвольное начертание шрифта +и многие ТеХ-ие команды (детальнее *note Font styles::). Аргумент SIZE +определяет размер текста: размер шрифта если положителен или +относительный размер (=-SIZE*FONTSIZE) если отрицателен. + + Параметры шрифта задаются строкой, которая может содержать символы +стиля (`rbiwou') и/или выравнивания (`LRC'). Также строка может +содержать символы цвета `wkrgbcymhRGBCYMHW' (*note Line styles::) после +символа `:'. Стили шрифта: `r' - прямой, `i' - курсив, `b' - жирный, +`w' - контурный, `o' - надчеркнутый, `u' - подчеркнутый. По умолчанию +используется прямой шрифт. Типы выравнивания: `L' - по левому краю (по +умолчанию), `C' - по центру, `R' - по правому краю. Например, строка +`iC:b' соответствует курсиву синего цвета с выравниванием по центру. По +умолчанию используются параметры, определенные командой *note font::. + + Если строка содержит символы `aA', то текст выводится в абсолютных +координатах (полагаются в диапазоне [0,1]). При этом используются +координаты относительно рисунка (если указано `A') или относительно +последнего *note subplot::/*note inplot:: (если указано `a'). + + -- Команда MGL: text `x y' 'text' ['fnt'=" `size=-1.4'] + -- Команда MGL: text `x y z' 'text' ['fnt'=" `size=-1.4'] + Выводит строку TEXT от точки {X,Y,Z} шрифтом FNT и размером SIZE. + + -- Команда MGL: text `x y dx dy' 'text' [`size=-1.4'] + -- Команда MGL: text `x y z dx dy dz' 'text' [`size=-1.4'] + Выводит строку TEXT от точки {X,Y,Z} вдоль направления {DX,DY,DZ} + шрифтом FNT и размером SIZE. + + -- Команда MGL: text ydat 'text' ['fnt'=" `size=-1 zval=nan'] + -- Команда MGL: text xdat ydat 'text' ['fnt'=" `size=-1 zval=nan'] + -- Команда MGL: text xdat ydat zdat 'text' ['fnt'=" `size=-1'] + Выводит строку TEXT вдоль кривой {XDAT[i], YDAT[i], ZDAT[i]} + шрифтом FONT. Строка FONT может содержать символы: `t' для вывода + текста под кривой (по умолчанию), или `T' для вывода текста над + кривой. Если массив XDAT не указан, то используется массив со + значениями равно распределенными вдоль оси x. Если массив ZDAT не + указан, то используется ZDAT[i] = ZVAL. См. раздел *note Text + sample::, для примеров кода и графика. + + -- Команда MGL: title 'text' ['fnt'=" `size=-2'] + Выводит строку TEXT как заголовок (сверху рисунка). Может + использоваться в любом месте (даже внутри *note subplot::). + + -- Команда MGL: fgets `x y' 'fname' [`n=0' 'fnt'=" `size=-1.4'] + -- Команда MGL: fgets `x y z' 'fname' [`n=0' 'fnt'=" `size=-1.4'] + Выводит N-ую строку файла FNAME от точки {X,Y,Z} шрифтом FNT и + размером SIZE. + + +File: mgl_ru.info, Node: Axis and Colorbar, Next: Legend, Prev: Text printing, Up: MGL interface + +1.8 Оси и Colorbar +====================== + +Эти команды рисуют объекты для "измерения" типа осей координат, +цветовой таблицы (colorbar), сетку по осям, обрамляющий параллелепипед +и подписи по осям координат. См. также *note Axis settings::. + + -- Команда MGL: axis ['dir'='xyz' `adjust=off'] + Рисует оси координат и метки на них (*note Axis settings::) в + направлениях, указанных строкой DIR. Если строка содержит символ + `_', то подписи меток отображаться не будут. Шрифт подписей + определяется командой *note font::. Метки будут "подогнаны" если + ADJUST=`on' (с помощью вызова `adjust 'dir''). + + -- Команда MGL: colorbar ['sch'=" `pos=0'] + Рисует полосу соответствия цвета и числовых значений (colorbar) + для цветовой схемы SCH (используется текущая для `sch=''') с краю + от графика. Параметр POS задает местоположение: `0' - справа (по + умолчанию), `1' - слева, `2' - сверху, `3' - снизу. Если строка + SCH содержит `<>^_', то параметр POS определяется как: `pos=0' для + `>' (справа), `pos=1' для `<' (слева), `pos=2' для `^' (сверху), + `pos=3' для `_' (снизу). Если строка содержит `A', то используются + абсолютные координаты (относительно рисунка). См. раздел *note + Dens sample::, для примеров кода и графика. + + -- Команда MGL: colorbar vdat ['sch'=" `pos=0'] + Аналогично предыдущему, но для цветовой схемы без сглаживания с + заданными значениями VDAT. См. раздел *note ContD sample::, для + примеров кода и графика. + + -- Команда MGL: colorbar 'sch' `pos x y w h' + Аналогично первому, но в произвольном месте графика {X, Y} + (полагаются в диапазоне [0,1]). Параметры W, H задают + относительную ширину и высоту colorbar. + + -- Команда MGL: grid ['dir'='xyz' 'pen'='B'] + Рисует линии сетки в направлениях перпендикулярным DIR. Шаг сетки + такой же как у меток осей координат. Стиль линий задается + параметром PEN (по умолчанию - сплошная темно синяя линия `B-'). + + -- Команда MGL: box ['stl'='k' `ticks=on'] + Рисует ограничивающий параллелепипед цветом 'stl'. При `ticks=on' + рисуются метки в соответствии с текущими настройками осей + координат *note axis::. + + -- Команда MGL: xlabel 'text' [`pos=0 size=-1.4 shift=0'] + -- Команда MGL: ylabel 'text' [`pos=0 size=-1.4 shift=0'] + -- Команда MGL: zlabel 'text' [`pos=0 size=-1.4 shift=0'] + -- Команда MGL: tlabel 'text' [`pos=0 size=-1.4 shift=0'] + Выводит подпись TEXT для x-,y-,z-,t-оси (где `t' - "тернарная" ось + t=1-x-y). Параметр POS задает положение подписи: при POS=0 - по + центру оси, при POS>0 - около максимальных значений, при POS<0 - + около минимальных значений. Параметр SIZE задает размер шрифта (по + умолчанию в 1.4 раза больше чем у меток). *Note Text printing::. + + +File: mgl_ru.info, Node: Legend, Next: 1D plotting, Prev: Axis and Colorbar, Up: MGL interface + +1.9 Легенда +================== + +Эти команды обеспечивают рисование легенды графика (полезно для *note +1D plotting::). Запись в легенде состоит из двух строк: одна для стиля +линии и маркеров, другая с текстом описания (с включенным разбором +TeX-их команд), накапливаемые во внутренние массивы с помощью команды +*note addlegend:: или опции *note legend::. Положение легенды можно +задать автоматически или вручную. Параметры FONT и SIZE задают стиль и +размер шрифта. Параметр LLEN задает относительную ширину примера линии. +Ели стиль линии пустой, то соответствующий текст печатается без +отступа. Если строка FONT содержит символ `A', то координаты легенды +считаются относительно картинки (а не текущего subplot). См. раздел +*note Legend sample::, для примеров кода и графика. + + -- Команда MGL: legend [`pos=3' 'fnt'='rL' `size=-1 llen=0.1'] + Рисует легенду из накопленных записей шрифтом FNT размером SIZE. + Параметр POS задает положение легенды: `0' - в нижнем левом углу, + `1' - нижнем правом углу, `2' - верхнем левом углу, `3' - верхнем + правом углу (по умолчанию). + + -- Команда MGL: legend `x y' ['fnt'='rL' `size=-1 llen=0.1'] + Рисует легенду из накопленных записей шрифтом FONT размером SIZE. + Положение легенды задается параметрами X, Y, которые полагаются + нормированными в диапазоне [0,1]. + + -- Команда MGL: addlegend 'text' 'stl' + Добавляет описание TEXT кривой со стилем STL (*note Line styles::) + во внутренний массив записей легенды. Максимальное число записей + 100. + + -- Команда MGL: clearlegend + Очищает внутренний массив записей легенды. + + -- Команда MGL: legendbox `val' + Включает/выключает рисование прямоугольника вокруг легенды. По + умолчанию (=`on') прямоугольник рисуется. + + -- Команда MGL: legendmarks `val' + Задает число маркеров в легенде. По умолчанию используется 1 + маркер. + + +File: mgl_ru.info, Node: 1D plotting, Next: 2D plotting, Prev: Legend, Up: MGL interface + +1.10 1D графики +====================== + +Эти команды строят графики для одномерных (1D) массивов. Одномерными +считаются массивы, зависящие только от одного параметра (индекса) +подобно кривой в параметрической форме {x(i),y(i),z(i)}, i=1...n. Есть +5 основных типов 1D графиков: линия (*note plot::), линия с заполнением +(*note area::), ступеньки (*note step::), прямоугольники (*note bars::, +*note barh::) и вертикальные линии (*note stem::). Все эти типы +графиков имеют похожий интерфейс. Есть версии для рисования в +пространстве и на плоскости. В последнем случае имеется возможность +использования только одного массива. Стиль линии и маркеров указывается +строковой переменной. Если она равна `'''. Кроме того, есть еще +несколько типов графиков для одномерных массивов, имеющих другой +интерфейс и вид: поверхность вращения кривой (*note torus::), диаграмма +(*note chart::), размер ошибки (*note error::), маркеры переменного +размера (*note mark::), трубками (*note tube::) и т.д. См. раздел *note +1D plot sample::, для примеров кода и графика. + + График рисуется для каждой строки если один из массивов матрица. +Размер по 1-ой координате *должен быть одинаков* для всех массивов +`xdat.nx=ydat.nx=zdat.nx'. Если массив XDAT не указан, то используется +массив со значениями равно распределенными вдоль оси x. Если массив +ZDAT не указан, то используется ZDAT[i] = ZVAL. Строка STL задает цвет +и стиль линии и маркеров (*note Line styles::). По умолчанию (`stl=''') +рисуется сплошная линия с текущим цветом из палитры. + + -- Команда MGL: plot ydat ['stl'=" `zval=nan'] + -- Команда MGL: plot xdat ydat ['stl'=" `zval=nan'] + -- Команда MGL: plot xdat ydat zdat ['stl'="] + Рисует ломанную линию между точками {X[i], Y[i], Z[i]}. См. также + *note area::, *note step::, *note stem::, *note tube::, *note + mark::, *note error::, *note belt::, *note tens::. См. раздел + *note Plot sample::, для примеров кода и графика. + + -- Команда MGL: radar adat ['stl'=" `r=-1'] + Рисует radar chart, представляющий собой ломанную с вершинами на + радиальных линиях (типа ломанной в полярных координатах). График + рисуется для каждой строки если один из массивов матрица. Параметр + R задает дополнительный сдвиг данных (т.е. используется A+R вместо + A). Если `r<0', то `r=max(0, -min(a)'. Если STL содержит символ + `#', то также рисуется "сетка" (радиальные линии и круг для R). + См. также *note plot::. См. раздел *note Radar sample::, для + примеров кода и графика. + + -- Команда MGL: tens ydat cdat ['stl'=" `zval=nan'] + -- Команда MGL: tens xdat ydat cdat ['stl'=" `zval=nan'] + -- Команда MGL: tens xdat ydat zdat cdat ['stl'="] + Рисует ломанную линию по точкам {X[i], Y[i], Z[i]} с цветом, + определяемым массивом C[i] (типа графика натяжений). См. также + *note plot::, *note mesh::, *note fall::. См. раздел *note Tens + sample::, для примеров кода и графика. + + -- Команда MGL: area ydat ['stl'=" `zval=nan'] + -- Команда MGL: area xdat ydat ['stl'=" `zval=nan'] + -- Команда MGL: area xdat ydat zdat ['stl'="] + Рисует ломанную линию по точками {XDAT[i], YDAT[i], ZDAT[i]} и + закрашивает ее вниз до плоскости осей координат. Можно + использовать градиентное закрашивание если число указанных цветов + в STL равно удвоенному числу кривых для построения. Если строка + содержит символ `a', то линии рисуются одна поверх другой (с + суммированием) - того же эффекта можно достичь вызовом `cumsum + ydat 'y'' перед построением графика. См. также *note plot::, *note + bars::, *note stem::, *note region::. См. раздел *note Area + sample::, для примеров кода и графика. + + -- Команда MGL: region fdat gdat ['stl'=" `inside=off'] + -- Команда MGL: region xdat fdat gdat ['stl'=" `inside=off'] + Закрашивает область между 2 кривыми {XDAT[i], FDAT[i]} и {XDAT[i], + GDAT[i]}. При `inside=off' закрашивается только область y12. Размеры массивов по 2-му + индексу TR, G1, G2 и размер по 3-му индексу массива ADAT должны + быть одинаковы. См. также *note surf3::. + + +File: mgl_ru.info, Node: Dual plotting, Next: Vector fields, Prev: 3D plotting, Up: MGL interface + +1.13 Парные графики +================================ + +Эти команды строят графики для двух связанных массивов. Есть несколько +основных типов 3D графиков: поверхность и поверхность уровня с окраской +по второму массиву (*note surfc::, *note surf3c::), поверхность и +поверхность уровня с прозрачностью по второму массиву (*note surfa::, +*note surf3a::), плитки переменного размера (*note tiles::), диаграмма +точечного отображения (*note map::), STFA диаграмма (*note stfa::). В +командах *note surf3a:: и *note surf3c:: значения уровней можно +задавать автоматически и вручную. Каждый тип графика имеет похожий +интерфейс. Есть версия для рисования одного массива с автоматическими +координатами и версия для параметрически заданного массива. + + Строка SCH задает цветовую схему (*note Color scheme::). Предыдущая +цветовая схема используется по умолчанию. Массивы X, Y, Z могут быть +векторами (не 3d массивами как A). Если массивы XDAT, YDAT, ZDAT не +указаны, то используются массивы со значениями равно распределенными +вдоль осей x, y, z. + + -- Команда MGL: surfc zdat cdat ['sch'="] + -- Команда MGL: surfc xdat ydat zdat cdat ['sch'="] + Рисует параметрически заданную поверхность {XDAT[i,j], YDAT[i,j], + ZDAT[i,j]} с цветом, заданным массивом CDAT[i,j]. Если SCH + содержит `#', то на поверхности рисуется сетка. См. также *note + surf::, *note surfa::, *note surf3c::. См. раздел *note SurfC + sample::, для примеров кода и графика. + + -- Команда MGL: surf3c adat cdat `val' ['sch'="] + -- Команда MGL: surf3c xdat ydat zdat adat cdat `val' ['sch'="] + Рисует поверхность уровня для 3d массива, заданного параметрически + ADAT[i,j,k](XDAT[i,j,k], YDAT[i,j,k], ZDAT[i,j,k]) при + A(x,y,z)=VAL. Аналогично *note surf3::, но цвет задается массивом + CDAT. Если SCH содержит `#', то рисуется сетчатая поверхность. См. + также *note surf3::, *note surfc::, *note surf3a::. См. раздел + *note Surf3C sample::, для примеров кода и графика. + + -- Команда MGL: surf3c adat cdat ['sch'=" `num=5'] + -- Команда MGL: surf3c xdat ydat zdat adat cdat ['sch'=" `num=5'] + Рисует NUM поверхностей уровня равномерно распределенных в + интервале цветовой шкалы (см. *note caxis::). + + -- Команда MGL: surfa zdat cdat ['sch'="] + -- Команда MGL: surfa xdat ydat zdat cdat ['sch'="] + Рисует параметрически заданную поверхность {XDAT[i,j], YDAT[i,j], + ZDAT[i,j]} с прозрачностью, заданным массивом CDAT[i,j]. Если SCH + содержит `#', то на поверхности рисуется сетка. См. также *note + surf::, *note surfc::, *note surf3a::. См. раздел *note SurfA + sample::, для примеров кода и графика. + + -- Команда MGL: surf3a adat cdat `val' ['sch'="] + -- Команда MGL: surf3a xdat ydat zdat adat cdat `val' ['sch'="] + Рисует поверхность уровня для 3d массива, заданного параметрически + ADAT[i,j,k](XDAT[i,j,k], YDAT[i,j,k], ZDAT[i,j,k]) при + A(x,y,z)=VAL. Аналогично *note surf3::, но прозрачность задается + массивом CDAT. Если SCH содержит `#', то рисуется сетчатая + поверхность. См. также *note surf3::, *note surfa::, *note + surf3c::. См. раздел *note Surf3A sample::, для примеров кода и + графика. + + -- Команда MGL: surf3a adat cdat ['sch'=" `num=5'] + -- Команда MGL: surf3a xdat ydat zdat adat cdat ['sch'=" `num=5'] + Рисует NUM поверхностей уровня равномерно распределенных в + интервале цветовой шкалы (см. *note caxis::). + + -- Команда MGL: tiles zdat rdat ['sch'="] + -- Команда MGL: tiles xdat ydat zdat rdat ['sch'="] + Рисует плитки для параметрически заданной поверхности {XDAT[i,j], + YDAT[i,j], ZDAT[i,j]}. Аналогично *note tile::, но размер плиток + задается массивов RDAT. Это создает эффект "прозрачности" при + экспорте в файлы EPS. См. также *note surfa::, *note tile::. См. + раздел *note TileS sample::, для примеров кода и графика. + + -- Команда MGL: map udat vdat ['sch'=" `pnts=on'] + -- Команда MGL: map xdat ydat udat vdat ['sch'=" `pnts=on'] + Визуализирует точечное отображение для матриц {UDAT, VDAT } + параметрически зависящих от координат XDAT, YDAT. Исходное + положение ячейки задает ее цвет. Высота пропорциональна якобиану + Jacobian(udat,vdat). График является аналогом диаграммы Арнольда. + Если `pnts=off', то рисуются грани, иначе цветные точки рисуются в + узлах матриц (полезно для "запутанного" отображения). См. раздел + *note Map sample::, для примеров кода и графика. + + -- Команда MGL: stfa re im `dn' ['sch'=" `pnts=on'] + -- Команда MGL: stfa xdat ydat re im `dn' ['sch'=" `pnts=on'] + Рисует спектрограмму комплексного массива RE+i*`im' для Фурье + размером DN точек. Параметр DN - любое четное число. Например в 1D + случае, результатом будет график плотности от массива + res[i,j]=|\sum_d^dn exp(I*j*d)*(re[i*dn+d]+I*im[i*dn+d])|/dn + размером {int(nx/dn), dn, ny}. Массивы RE, IM параметрически + зависят от координат XDAT, YDAT. См. раздел *note STFA sample::, + для примеров кода и графика. + + +File: mgl_ru.info, Node: Vector fields, Next: Other plotting, Prev: Dual plotting, Up: MGL interface + +1.14 Векторные поля +================================ + +Эти функции рисуют графики для 2D и 3D векторных полей. Есть несколько +типов графиков: просто векторное поле (*note vect::), вектора вдоль +траектории (*note traj::), векторное поле каплями (*note dew::), нити +тока (*note flow::), трубки тока (*note pipe::). Каждый тип графика +имеет похожий интерфейс. Есть версия для рисования одного массива с +автоматическими координатами и версия для параметрически заданного +массива. + + Строка SCH задает цветовую схему (*note Color scheme::). Предыдущая +цветовая схема используется по умолчанию. Все размеры массивов AX и AY +должны быть одинаковы. Младшие размерности массивов X, Y и AX должны +быть одинаковы. Массивы X и Y могут быть векторами (не матрицами как +AX). График строится для каждого z среза AX, AY для 2D случаев. + + -- Команда MGL: traj xdat ydat udat vdat ['sch'=" `zval=nan len=0'] + -- Команда MGL: traj xdat ydat zdat udat vdat wdat ['sch'=" `len=0'] + Рисует вектора {UDAT, VDAT, WDAT} вдоль кривой {XDAT, YDAT, ZDAT}. + Длина векторов пропорциональна \sqrt{udat^2+vdat^2+wdat^2}. Строка + PEN задает цвет (*note Line styles::). По умолчанию (`pen='''). + Параметр LEN задает фактор длины векторов (если не нуль) или + выбирать длину пропорционально расстоянию между точками кривой + (если LEN=0). См. также *note vect::. См. раздел *note Traj + sample::, для примеров кода и графика. + + -- Команда MGL: vect udat vdat ['sch'=" `zval=nan flag=0'] + -- Команда MGL: vect xdat ydat udat vdat ['sch'=" `zval=nan flag=0'] + Рисует векторное поле {UDAT, VDAT} параметрически зависящее от + координат XDAT, YDAT на плоскости при Z=ZVAL. Длина и цвет + векторов пропорциональна \sqrt{ax^2+ay^2}. Число рисуемых векторов + зависит от *note meshnum::. Параметр FLAG побитовый флаг для + настройки вид векторов: `1' - двуцветный вектор, `2' - одинаковая + длина векторов, `4' - рисует стрелку в точку сетки, `8' - рисует + стрелку с серединой в точке сетки, `16' - рисует штрихи вместо + стрелок. См. также *note flow::, *note dew::, *note vectc::. См. + раздел *note Vect sample::, для примеров кода и графика. + + -- Команда MGL: vect udat vdat wdat ['sch'=" `flag=0'] + -- Команда MGL: vect xdat ydat zdat udat vdat wdat ['sch'=" `flag=0'] + Это 3D версия графика. Здесь массивы UDAT, VDAT, WDAT должны быть + 3d массивами, а длина и цвет пропорциональны + \sqrt{udat^2+vdat^2+wdat^2}. См. раздел *note Vect 3D sample::, + для примеров кода и графика. + + -- Команда MGL: vectc udat vdat ['sch'=" `zval=nan'] + -- Команда MGL: vectc xdat ydat udat vdat ['sch'=" `zval=nan'] + Аналогично *note vect:: c `flag=2+16=18'. См. раздел *note VectC + sample::, для примеров кода и графика. + + -- Команда MGL: vectc udat vdat wdat ['sch'="] + -- Команда MGL: vectc xdat ydat zdat udat vdat wdat ['sch'="] + Это 3D версия графика. Здесь массивы UDAT, VDAT, WDAT должны быть + 3d массивами, а длина и цвет пропорциональны + \sqrt{udat^2+vdat^2+wdat^2}. См. раздел *note VectC 3D sample::, + для примеров кода и графика. + + -- Команда MGL: vectl udat vdat ['sch'=" `zval=nan'] + -- Команда MGL: vectl xdat ydat udat vdat ['sch'=" `zval=nan'] + Аналогично *note vect:: c `flag=1+16=17'. См. раздел *note VectL + sample::, для примеров кода и графика. + + -- Команда MGL: vectl udat vdat wdat ['sch'="] + -- Команда MGL: vectl xdat ydat zdat udat vdat wdat ['sch'="] + Это 3D версия графика. Здесь массивы UDAT, VDAT, WDAT должны быть + 3d массивами, а длина и цвет пропорциональны + \sqrt{udat^2+vdat^2+wdat^2}. См. раздел *note VectL 3D sample::, + для примеров кода и графика. + + -- Команда MGL: dew udat vdat ['sch'=" `zval=nan'] + -- Команда MGL: dew xdat ydat udat vdat ['sch'=" `zval=nan'] + Рисует капли для векторного поля {UDAT, VDAT}, параметрически + зависящего от координат XDAT, YDAT при Z=ZVAL. Замечу, что график + требует много памяти и процессорного времени для своего создания! + Цвет капель пропорционален \sqrt{ax^2+ay^2}. Число капель + определяется *note meshnum::. См. также *note vect::. См. раздел + *note Dew sample::, для примеров кода и графика. + + -- Команда MGL: flow udat vdat ['sch'=" `num=5 zval=nan'] + -- Команда MGL: flow xdat ydat udat vdat ['sch'=" `num=5 zval=nan'] + Рисует нити тока для векторного поля {UDAT, VDAT}, параметрически + зависящего от координат XDAT, YDAT на плоскости при z = ZVAL. + Число нитей пропорционально NUM. При NUM>0 нитей могут стартовать + и изнутри сетки, в противном случае только с краев. Цвет нитей + пропорционален \sqrt{udat^2+vdat^2}. Теплые цвета соответствуют + нормальному току (типа стока). Холодные цвета соответствуют + обратному току (типа источника). См. также *note pipe::, *note + vect::. См. раздел *note Flow sample::, для примеров кода и + графика. + + -- Команда MGL: flow udat vdat wdat ['sch'=" `num=3'] + -- Команда MGL: flow xdat ydat zdat udat vdat wdat ['sch'=" `num=3'] + Это 3D версия графика. Здесь массивы UDAT, VDAT, WDAT должны быть + 3d массивами, а цвет пропорционален \sqrt{udat^2+vdat^2+wdat^2}. + См. раздел *note Flow 3D sample::, для примеров кода и графика. + + -- Команда MGL: flow `x0 y0' udat vdat ['sch'=" `zval=nan'] + -- Команда MGL: flow `x0 y0' xdat ydat udat vdat ['sch'=" `zval=nan'] + Рисует нить тока из точки {X0, Y0} для векторного поля {UDAT, + VDAT}, параметрически зависящего от координат XDAT, YDAT на + плоскости при z = ZVAL. Цвет нити пропорционален + \sqrt{udat^2+vdat^2}. Теплые цвета соответствуют нормальному току + (типа стока). Холодные цвета соответствуют обратному току (типа + источника). + + -- Команда MGL: flow `x0 y0 z0' udat vdat wdat ['sch'="] + -- Команда MGL: flow `x0 y0 z0' xdat ydat zdat udat vdat wdat ['sch'="] + Это 3D версия графика. Здесь массивы UDAT, VDAT, WDAT должны быть + 3d массивами, а цвет пропорционален \sqrt{udat^2+vdat^2+wdat^2}. + + -- Команда MGL: pipe udat vdat ['sch'=" `r0=0.05 num=5 zval=nan'] + -- Команда MGL: pipe xdat ydat udat vdat ['sch'=" `r0=0.05 num=5 + zval=nan'] + Рисует трубки тока для векторного поля {UDAT, VDAT}, + параметрически зависящего от координат XDAT, YDAT на плоскости при + z = ZVAL. Число трубок пропорционально NUM. При NUM>0 нитей могут + стартовать и изнутри сетки, в противном случае только с краев. + Цвет и радиус трубок пропорционален \sqrt{udat^2+vdat^2}. Теплые + цвета соответствуют нормальному току (типа стока). Холодные цвета + соответствуют обратному току (типа источника). Параметр R0 задает + радиус трубок. При R0<0 радиус трубок обратно пропорционален их + амплитуде. См. также *note flow::, *note vect::. См. раздел *note + Pipe sample::, для примеров кода и графика. + + -- Команда MGL: pipe udat vdat wdat ['sch'=" `r0=0.05 num=3'] + -- Команда MGL: pipe xdat ydat zdat udat vdat wdat ['sch'=" `r0=0.05 + num=3'] + Это 3D версия графика. Здесь массивы UDAT, VDAT, WDAT должны быть + 3d массивами, а цвет пропорционален \sqrt{udat^2+vdat^2+wdat^2}. + См. раздел *note Pipe 3D sample::, для примеров кода и графика. + + +File: mgl_ru.info, Node: Other plotting, Next: Nonlinear fitting, Prev: Vector fields, Up: MGL interface + +1.15 Прочие графики +================================ + +Это команды, не относящиеся к какой-то специальной категории. Сюда +входят функции построения графиков по текстовым формулам (*note +fplot::, *note fsurf::), рисования поверхностей из треугольников (*note +triplot::), произвольных точек в пространстве (*note dots::) и +реконструкции по ним поверхности (*note crust::), графики плотности и +линии уровня на плоскостях, перпендикулярных осям x, y или z +(dens[xyz], cont[xyz], contf[xyz]). Каждый тип графика имеет похожий +интерфейс. Есть версия для рисования одного массива с автоматическими +координатами и версия для параметрически заданного массива. Строка SCH +задает цветовую схему (*note Color scheme::). Предыдущая цветовая схема +используется по умолчанию. + + -- Команда MGL: densx dat ['sch'=" `val=nan'] + -- Команда MGL: densy dat ['sch'=" `val=nan'] + -- Команда MGL: densz dat ['sch'=" `val=nan'] + Рисуют график плотности на x, y или z плоскостях. Если DAT - 3d + массив, то выполняется интерполяция к заданному срезу VAL. Функции + полезны для создания проекций 3D массивов на оси координат. См. + также `cont[xyz], contf[xyz]', *note dens::. См. раздел *note Dens + projection sample::, для примеров кода и графика. + + -- Команда MGL: contx dat ['sch'=" `val=nan num=7'] + -- Команда MGL: conty dat ['sch'=" `val=nan num=7'] + -- Команда MGL: contz dat ['sch'=" `val=nan num=7'] + Рисуют линии уровня на x, y или z плоскостях. Если DAT - 3d + массив, то выполняется интерполяция к заданному срезу VAL. Функции + полезны для создания проекций 3D массивов на оси координат. См. + также `dens[xyz], contf[xyz]', *note cont::. См. раздел *note Cont + projection sample::, для примеров кода и графика. + + -- Команда MGL: contfx dat ['sch'=" `val=nan num=7'] + -- Команда MGL: contfy dat ['sch'=" `val=nan num=7'] + -- Команда MGL: contfz dat ['sch'=" `val=nan num=7'] + Рисуют закрашенные контуры уровня на x, y или z плоскостях. Если + DAT - 3d массив, то выполняется интерполяция к заданному срезу + VAL. Функции полезны для создания проекций 3D массивов на оси + координат. См. также `dens[xyz], cont[xyz]', *note contf::. + + -- Команда MGL: dots xdat ydat zdat ['sch'="] + -- Команда MGL: dots xdat ydat zdat adat ['sch'="] + Рисует произвольно расположенные точки {XDAT[i], YDAT[i], + ZDAT[i]}. Если определен массив ADAT[i], то он задает прозрачность + точек. См. также *note crust::, *note mark::, *note plot::. См. + раздел *note Dots sample::, для примеров кода и графика. + + -- Команда MGL: crust xdat ydat zdat ['sch'="] + Реконструирует и рисует поверхность по произвольно расположенным + точкам {XDAT[i], YDAT[i], ZDAT[i]}. Если строка содержит `#', то + рисуется сетчатая поверхность. См. также *note dots::, *note + triplot::. См. раздел *note Crust sample::, для примеров кода и + графика. + + -- Команда MGL: triplot idat xdat ydat ['sch'=" `zval=nan'] + -- Команда MGL: triplot idat xdat ydat zdat ['sch'="] + -- Команда MGL: triplot idat xdat ydat zdat cdat ['sch'="] + Рисует поверхность из треугольников. Вершины треугольников + задаются индексами IDAT в массиве точек {XDAT[i], YDAT[i], + ZDAT[i]}. Если строка содержит `#', то рисуется сетчатая + поверхность. Размер по 1-му индексу массива IDAT должен быть 3 или + больше. Массивы XDAT, YDAT, ZDAT должны иметь одинаковые размеры. + Массив CDAT задает цвет треугольников (если IDAT.ny=CDAT.nx) или + цвет вершин (если XDAT.nx=CDAT.nx). См. также *note dots::, *note + crust::, *note quadplot::, *note tricont::. + + -- Команда MGL: tricont vdat idat xdat ydat zdat cdat ['sch'=" + `zval=nan'] + -- Команда MGL: tricont vdat idat xdat ydat zdat ['sch'=" `zval=nan'] + -- Команда MGL: tricont idat xdat ydat zdat ['sch'=" `num=7 zval=nan'] + Рисует линии уровня поверхности из треугольников при Z = ZVAL (или + для z=VDAT[k] если `zval==NAN'). Вершины треугольников задаются + индексами IDAT в массиве точек {XDAT[i], YDAT[i], ZDAT[i]}. Размер + по 1-му индексу массива IDAT должен быть 3 или больше. Массивы + XDAT, YDAT, ZDAT должны иметь одинаковые размеры. Массив CDAT + (если указан) задает цвет треугольников (если IDAT.ny=CDAT.nx) или + цвет вершин (если XDAT.nx=CDAT.nx). См. также *note triplot::, + *note cont::. + + -- Команда MGL: quadplot idat xdat ydat ['sch'=" `zval=nan'] + -- Команда MGL: quadplot idat xdat ydat zdat ['sch'="] + -- Команда MGL: quadplot idat xdat ydat zdat cdat ['sch'="] + Рисует поверхность из четырехугольников. Вершины треугольников + задаются индексами IDAT в массиве точек {XDAT[i], YDAT[i], + ZDAT[i]}. Если строка содержит `#', то рисуется сетчатая + поверхность. Размер по 1-му индексу массива IDAT должен быть 4 или + больше. Массивы XDAT, YDAT, ZDAT должны иметь одинаковые размеры. + Массив CDAT задает цвет четырехугольников (если IDAT.ny=CDAT.nx) + или цвет вершин (если XDAT.nx=CDAT.nx). См. также *note triplot::. + + -- Команда MGL: fplot 'y(x)' ['pen'=" `zval=nan num=100'] + Рисует функцию `y(x)' в плоскости z=ZVAL с координатой `x' в + диапазоне x-оси координат. Параметр NUM задает минимальное число + точек по координате для графика. См. также *note plot::. + + -- Команда MGL: fplot 'x(t)' 'y(t)' 'z(t)' ['pen'=" `num=100'] + Рисует параметрическую кривую {`x(t)', `y(t)', `z(t)'}, где + координата `t' меняется в диапазоне [0, 1]. Параметр NUM задает + минимальное число точек по координате для графика. См. также *note + plot::. + + -- Команда MGL: fsurf 'z(x,y)' ['sch'=" `num=100'] + Рисует поверхность `z(x,y)' с координатами `x', `y' в диапазоне + x-,y-осей координат. Параметр NUM задает минимальное число точек + по координатам для графика. См. также *note surf::. + + -- Команда MGL: fsurf 'x(u,v)' 'y(u,v)' 'z(u,v)' ['sch'=" `num=100'] + Рисует параметрическую поверхность {`x(u,v)', `y(u,v)', `z(u,v)'}, + где координаты `u', `v' меняются в диапазоне [0, 1]. Параметр NUM + задает минимальное число точек по координатам для графика. См. + также *note surf::. + + +File: mgl_ru.info, Node: Nonlinear fitting, Next: Data create, Prev: Other plotting, Up: MGL interface + +1.16 Nonlinear fitting +====================== + +Эти команды подбирают параметры функций для наилучшей аппроксимации +данных, т.е. минимизируют сумму \sum_i (f(x_i, y_i, z_i) - +a_i)^2/s_i^2. При этом аппроксимирующая функция `f' может зависеть от +одного аргумента `x' (1D случай), от двух аргументов `x,y' (2D случай) +или от трех аргументов `x,y,z' (3D случай). Функция `f' также может +зависеть от параметров. Список параметров задается строкой VAR +(например, `abcd'). Обычно пользователь должен предоставить начальные +значения параметров в переменной INI. Однако, при его отсутствии +используются нулевые значения. + + Команды *note fit:: и *note fits:: не рисуют полученные массивы. Они +заполняют массив FIT по формуле `f' с найденными коэффициентами. При +этом, координаты `x,y,z' равно распределены в вдоль осей координат. +Число точек в FIT выбирается максимальным из размера массива FIT и 100. +Формулу с найденными коэффициентами можно вывести с помощью команды +*note putsfit::. См. раздел *note Fitting sample::, для примеров кода и +графика. + + Размерность массивов должны быть не меньше, чем число указанных +массивов XDAT, YDAT, ZDAT. Также подбор коэффициентов будет +осуществляться только вдоль указанных направлений (например, вдоль x и +y если указаны только XDAT и YDAT). Если массив XDAT не указан, то +используется массив со значениями равно распределенными вдоль оси x. + + -- Команда MGL: fits adat sdat 'func' 'var' [ini=0] + -- Команда MGL: fits xdat adat sdat 'func' 'var' [ini=0] + -- Команда MGL: fits xdat ydat adat sdat 'func' 'var' [ini=0] + -- Команда MGL: fits xdat ydat zdat adat sdat 'func' 'var' [ini=0] + "Подгоняют" формулу вдоль x-, y- и z-направлений для массива + заданного параметрически A[i,j,k](X[i,j,k], Y[i,j,k], Z[i,j,k]) с + весовыми коэффициентами SDAT[i,j,k]. + + -- Команда MGL: fit adat 'func' 'var' [ini=0] + -- Команда MGL: fit xdat adat 'func' 'var' [ini=0] + -- Команда MGL: fit xdat ydat adat 'func' 'var' [ini=0] + -- Команда MGL: fit xdat ydat zdat adat 'func' 'var' [ini=0] + "Подгоняют" формулу вдоль x-, y- и z-направлений для массива + заданного параметрически A[i,j,k](X[i,j,k], Y[i,j,k], Z[i,j,k]) с + весовыми коэффициентами равными 1. + + -- Команда MGL: putsfit `x y' ['pre'=" 'fnt'=" `size=-1'] + Печатает последнюю подобранную формулу с найденными коэффициентами + в точке {X, Y}. Строка PRE будет напечатана перед формулой. Все + другие параметры такие же как в *note Text printing::. + + +File: mgl_ru.info, Node: Data create, Next: Data filling, Prev: Nonlinear fitting, Up: MGL interface + +1.17 Создание данных +================================== + + -- Команда MGL: new dat [`nx=1 ny=1 nz=1'] + Создает/пересоздает массив с именем DAT данных указанного размера + и заполняет его нулями. Ничего не делает при NX, NY, NZ + отрицательных или равных нулю. + + -- Команда MGL: var dat `num v1 [v2=nan]' + Создает одномерный массив с именем DAT размером `num' и заполняет + его равномерно в диапазоне [V1, V2]. Если V2=`nan', то + используется V2=V1. + + -- Команда MGL: list dat `v1 ...' + Создает массив с именем DAT и заполняет его числовыми значениями + аргументов `v1 ...'. Команда может создавать 1d- и 2d-массивы. Для + создания 2d-массивов требуется указать разделитель строк данных + `|'. Размер массива будет [максимальное число чисел в строке * + число строк]. Например, команда `list 1 | 2 3' создаст массив [1 + 0; 2 3]. Отмечу, что максимальное число аргументов 1000. + + -- Команда MGL: list dat d1 ... + Создает массив с именем DAT и заполняет его числами из массивов + `d1 ...'. Команда может создавать 2d- и 3d-массивы (если аргументы + 2d массивы). Младшие размерности всех массивов в аргументах должны + быть равны размерности D1. Отмечу, что максимальное число + аргументов 1000. + + -- Команда MGL: copy dat dat2 ['eq'=" `on_axis=on'] + -- Команда MGL: copy dat `val' + Создает массив с именем DAT и копирует в него данные из массива + DAT2. При этом, если указан параметр EQ, то данные будут изменены + по формуле аналогично команде *note fill:: (для `on_axis=on') или + *note modify:: (для `on_axis=off'). + + -- Команда MGL: idset dat 'ids' + Устанавливает символьные обозначения для колонок данных. Строка + должна содержать символы 'a'...'z' один на колонку (без пробелов). + + -- Команда MGL: info dat [`detail=off'] + Выводит информацию о массиве (размер, максимальное/минимальное + значение, моменты и пр.). При `detail=off' показывается только + краткая информация. + + -- Команда MGL: info 'text' + Выводит текст TEXT как информацию (предупреждение). + + +File: mgl_ru.info, Node: Data filling, Next: Rearrange data, Prev: Data create, Up: MGL interface + +1.18 Заполнение данных +====================================== + + -- Команда MGL: fill dat v1 v2 ['dir'='x'] + Заполняет значениями равно распределенными в диапазоне [V1, V2] в + направлении DIR={`x',`y',`z'}. + + -- Команда MGL: fill dat 'eq' [vdat=0 wdat=0] + Заполняет значениями вычисленными по формуле EQ. Формула + представляет собой произвольное выражение, зависящее от переменных + `x', `y', `z', `u', `v', `w'. Координаты `x', `y', `z' полагаются + меняющимися в диапазоне осей координат (в отличие от *note + modify::). Переменная `u' - значения исходного массива, переменные + `v', `w' - значения массивов VDAT, WDAT. Последние могут быть + опущены. + + -- Команда MGL: modify dat 'eq' [`dim=0'] + -- Команда MGL: modify dat 'eq' vdat [wdat=0] + Заполняет значениями вычисленными по формуле EQ. Формула + представляет собой произвольное выражение, зависящее от переменных + `x', `y', `z', `u', `v', `w'. Координаты `x', `y', `z' полагаются + меняющимися в диапазоне [0,1] (в отличие от *note fill::). + Переменная `u' - значения исходного массива, переменные `v', `w' - + значения массивов VDAT, WDAT. Последние могут быть опущены. Если + указан DIM>0, то изменяются только слои >=DIM. + + -- MGL command: put dat `val [i=: j=: k=:]' + Присваивает значения (под-)массива DAT[I, J, K] = VAL. Индексы I, + J, K равные `:' задают значениия VAL для всего диапазона + соответствующего направления(ий). Например, `put dat val : 0 :' + задает DAT[i,0,j]=VAL для i=0...(DAT.nx-1), j=0...(DAT.nz-1). + + -- MGL command: put dat vdat [`i=: j=: k=:'] + Копирует значения из массива VDAT в диапазон значений массива DAT. + Индексы I, J, K равные `:' задают диапазон изменения значений в + соответствующих направление(ях). Младшие размерности массива VDAT + должны быть больше выбранного диапазона массива DAT. Например, + `put dat v : 0 :' присвоит DAT[i,0,j]=VDAT.ny>DAT.nz ? VDAT[i,j] : + VDAT[i], где i=0...(DAT.nx-1), j=0...(DAT.nz-1) и условие + vdat.nx>=dat.nx выполнено. + + +File: mgl_ru.info, Node: Rearrange data, Next: File I/O, Prev: Data filling, Up: MGL interface + +1.19 Изменение размеров данных +===================================================== + + -- Команда MGL: rearrange dat `mx [my=0 mz=0]' + Изменяет размерность данных без изменения самого массива данных, + так что результирующий массив MX*MY*MZ < nx*ny*nz. Если один из + параметров MY или MZ ноль, то он будет выбран оптимальным образом. + Например, если MY=0, то будет MY=nx*ny*nz/MX и MZ=1. + + -- Команда MGL: extend dat `n1 [n2=0]' + Увеличивает размер данных путем вставки (|N1|+1) новых срезов + после (для N1>0) или перед (для N1<0) существующими данными. Можно + добавить сразу 2 размерности для 1d массива, используя второй + параметр N2. Данные в новые срезы будут скопированы из + существующих. Например, для N1>0 новый массив будет a_ij^new = + a_i^old where j=0...N1. Соответственно, для N1<0 новый массив + будет a_ij^new = a_j^old, где i=0...|N1|. + + -- Команда MGL: transpose dat ['dim'='yxz'] + Транспонирует (меняет порядок размерностей) массив данных. Новый + порядок размерностей задается строкой DIM. + + -- Команда MGL: squeeze dat `rx [ry=1 rz=1 sm=off]' + Уменьшает размер данных путем удаления элементов с индексами не + кратными RX, RY, RZ соответственно. Параметр SMOOTH задает + использовать сглаживания (т.е. out[i]=\sum_{j=i,i+r} a[j]/r) или + нет (т.е. out[i]=a[j*r]). + + -- Команда MGL: crop dat `n1 n2' 'dir' + Обрезает границы данных при IN2 (при N2>0) или + I>`n[xyz]'-N2 (при N2<=0) вдоль направления DIR. + + -- Команда MGL: delete dat + Удаляет массив DAT и освобождает использованную память. Может быть + полезно для больших неиспользуемых массивов. + + -- Команда MGL: delete dat 'dir' `[pos=off num=0]' + Удаляет NUM срезов вдоль направления DIR с позиции POS. + + -- Команда MGL: insert dat 'dir' `[pos=off num=0]' + Вставляет NUM срезов вдоль направления DIR с позиции POS и + заполняет их нулями. + + +File: mgl_ru.info, Node: File I/O, Next: Make another data, Prev: Rearrange data, Up: MGL interface + +1.20 Чтение/сохранение данных +=================================================== + + -- Команда MGL: read dat 'fname' + Читает данные из текстового файла с разделителями символом + пробела/табуляции с автоматическим определением размера массива. + Двойной перевод строки начинает новый срез данных (по направлению + z). + + -- Команда MGL: read dat 'fname' `mx [my=1 mz=1]' + Читает данные из текстового файла с заданными размерами. Ничего не + делается если параметры MX, MY или MZ равны нулю или отрицательны. + + -- Команда MGL: readmat dat 'fname' [`dim=2'] + Читает данные из текстового файла с размерами, указанными в первых + DIM числах файла. При этом переменная DIM задает размерность (1d, + 2d, 3d) данных. + + -- Команда MGL: readall dat 'templ' `v1 v2 [dv=1 slice=off]' + Объединяет данные из нескольких текстовых файлов. Имена файлов + определяются вызовом функции `sprintf(fname,templ,val);', где VAL + меняется от V1 до V2 с шагом DV. Данные загружаются один за другим + в один и тот же срез данных (при SLICE=`off') или срез-за-срезом + (при SLICE=`on'). + + -- Команда MGL: readall dat 'templ' `[slice=off]' + Объединяет данные из нескольких текстовых файлов, чьи имена + удовлетворяют шаблону TEMPL (например, TEMPL=`"t_*.dat"'). Данные + загружаются один за другим в один и тот же срез данных (при + SLICE=`off') или срез-за-срезом (при SLICE=`on'). + + -- Команда MGL: save dat 'fname' + Сохраняет массив данных в текстовый файл. + + -- Команда MGL: readhdf dat 'fname' 'dname' + Читает массив с именем DNAME из HDF5 или HDF4 файла FNAME. + + -- Команда MGL: savehdf dat 'fname' 'dname' + Сохраняет массив под именем DNAME в HDF5 или HDF4 файл FNAME. + + -- Команда MGL: import dat 'fname' 'sch' [`v1=0 v2=1'] + Читает данные из растрового файла. RGB значения пикселов + преобразуются в число в диапазоне [V1, V2] используя цветовую + схему SCH (*note Color scheme::). + + -- Команда MGL: export dat 'fname' 'sch' [`v1=0 v2=0'] + Сохраняет данные в растровый файл. Числовые значения, + нормированные в диапазон [V1, V2], преобразуются в RGB значения + пикселов, используя цветовую схему SCH (*note Color scheme::). + Если V1>=V2, то значения V1, V2 определяются автоматически как + минимальное и максимальное значение данных. + + +File: mgl_ru.info, Node: Make another data, Next: Change data, Prev: File I/O, Up: MGL interface + +1.21 Создание новых данных +============================================= + + -- Команда MGL: combine res adat bdat + Возвращает в массиве данных RES прямое произведение массивов + (наподобие, res[i,j] = adat[i]*bdat[j] и т.д.). + + -- Команда MGL: evaluate res dat idat [`norm=on'] + -- Команда MGL: evaluate res dat idat jdat [`norm=on'] + -- Команда MGL: evaluate res dat idat jdat kdat [`norm=on'] + Возвращает массив данных RES, полученный в результате интерполяции + исходного массива в точках других массивов (например, + res[i,j]=dat[idat[i,j],jdat[i,j]]). Размеры массивов IDAT, JDAT, + KDAT должны совпадать. Координаты в IDAT, JDAT, KDAT полагаются + нормированными в диапазон [0,1] (при NORM=`on') или в диапазоны + [0,nx], [0,ny], [0,nz] соответственно. + + -- Команда MGL: hist res dat `num v1 v2 [nsub=0]' + -- Команда MGL: hist res dat wdat `num v1 v2 [nsub=0]' + Возвращает распределение (гистограмму) RES из NUM точек от + значений массива DAT в диапазоне [V1, V2]. Массив WDAT задает веса + элементов (все веса равны 1 если WDAT не указан). Параметр NSUB + задает число дополнительных точек интерполяции (для сглаживания + получившейся гистограммы). + + -- Команда MGL: hist res xdat adat + -- Команда MGL: hist res xdat ydat adat + -- Команда MGL: hist res xdat ydat zdat adat + Возвращает распределение (гистограмму) RES от значений массива + ADAT, параметрически зависящего от координат {XDAT,YDAT,ZDAT} в + диапазоне осей координат. Массив ADAT играет роль веса точки. + Число точек в результате RES - максимум из размера RES и 100. + + -- Команда MGL: momentum res dat 'how' ['dir'='z'] + Возвращает в массиве данных RES момент (1d массив) данных DAT + вдоль направления DIR. Строка HOW определяет тип момента. Момент + определяется как res_k = \sum_ij how(x_i,y_j,z_k) dat_ij/ \sum_ij + a_ij если DIR=`z' и т.д. Координаты `x', `y', `z' - индексы + массива в диапазоне [0,1]. + + -- Команда MGL: sum res dat 'dir' + Возвращает в массиве данных RES результат суммирования DAT вдоль + направления(ий) DIR. + + -- Команда MGL: max res dat 'dir' + Возвращает в массиве данных RES максимальное значение DAT вдоль + направления(ий) DIR. Gets array which is the maximal data values + in given direction or direction(s). + + -- Команда MGL: min res dat 'dir' + Возвращает в массиве данных RES минимальное значение DAT вдоль + направления(ий) DIR. + + -- Команда MGL: resize res dat `mx [my=1 mz=1]' + Возвращает массив данных RES размером MX, MY, MZ со значениями + полученными интерполяцией значений массива DAT. + + -- Команда MGL: subdata res dat `xx [yy=: zz=:]' + Возвращает в RES подмассив массива данных DAT с фиксированными + значениями индексов с положительными значениями. Например, + `subdata a b : 2' выделяет третью строку (индексы начинаются с + нуля), `subdata a b 4 :' выделяет 5-ую колонку, `subdata a b : : + 3' выделяет 4-ый срез и т.д. + + -- Команда MGL: trace res dat + Возвращает массив REF диагональных элементов DAT[i,i] (для 2D + данных) или DAT[i,i,i] (для 3D данных) где i=0...nx-1. В 1D случае + возвращается сам массив данных DAT. Размеры массива данных должен + быть DAT.ny, DAT.nz >= DAT.nx или DAT.ny, DAT.nz = 1. + + -- Команда MGL: transform dat 'type' real imag + Выполняет интегральное преобразование комплексных данных REAL, + IMAG в выбранном направлении и возвращает модуль результата в RES. + Порядок и тип преобразований задается строкой TYPE: первый символ + для x-направления, второй для y-направления, третий для + z-направления. Возможные символы: `f' - прямое преобразование + Фурье, `i' - обратное преобразование Фурье, `s' - синус + преобразование, `c' - косинус преобразование, `h' - преобразование + Ханкеля, `n' или ` ' - нет преобразования. + + -- Команда MGL: transforma dat 'type' ampl phase + Аналогично предыдущему с заданными амплитудой AMPL и фазой PHASE + комплексных чисел. + + -- Команда MGL: stfad res real imag `dn' ['dir'='x'] + Выполняет оконное преобразование Фурье длиной DN для комплексных + данных REAL, IMAG и возвращает модуль результата в RES. Например, + для DIR=`x' результат будет иметь размер {int(nx/dn), dn, ny} и + будет равен res[i,j,k]=|\sum_d^dn + exp(I*j*d)*(real[i*dn+d,k]+I*imag[i*dn+d,k])|/dn. + + -- Команда MGL: pde res 'ham' ini_re ini_im [`dz=0.1 k0=100'] + Решает уравнение в частных производных du/dz = + i*k0*HAM(p,q,x,y,z,|u|)[u], где p=-i/k0*d/dx, q=-i/k0*d/dy - + псевдо-дифференциальные операторы. Параметры INI_RE, INI_IM задают + начальное распределение поля. Координаты в уравнении и в решении + полагаются в диапазоне осей координат. Замечу, что внутри этот + диапазон увеличивается в 3/2 раза для уменьшения отражения от + границ расчетного интервала. Параметр DZ задает шаг по + эволюционной координате z. В данный момент использован упрощенный + алгоритм, когда все "смешанные" члена (типа `x*p'->x*d/dx) + исключаются. Например, в 2D случае это функции типа ham = f(p,z) + + g(x,z,u). При этом допускаются коммутирующие комбинации (типа + `x*q'->x*d/dy). Переменная `u' используется для обозначения + амплитуды поля |u|. Это позволяет решать нелинейные задачи - + например, нелинейное уравнение Шредингера `ham='p^2+q^2-u^2''. + Также можно указать мнимую часть для поглощения (типа `ham = + 'p^2+i*x*(x>0)''), но только если зависимость от `i' линейная, + т.е. ham = hre+i*him. См. раздел *note PDE sample::, для примеров + кода и графика. + + -- Команда MGL: ray res 'ham' `x0 y0 z0 p0 q0 v0 [dt=0.1 tmax=10]' + Решает систему геометрооптических уравнений d_r_/dt = d HAM/d_p_, + d_p_/dt = -d HAM/d_r_. Это гамильтоновы уравнения для траектории + частицы в 3D случае. Гамильтониан HAM может зависеть от координат + `x', `y', `z', импульсов `p'=px, `q'=py, `v'=pz и времени `t': ham + = H(x,y,z,p,q,v,t). Начальная точка (при `t=0') задается + переменными {X0, Y0, Z0, P0, Q0, V0}. Параметры DT и TMAX задают + шаг и максимальное время интегрирования. Результат RES - массив + {x,y,z,p,q,v,t} с размером {7 * int(TMAX/DT+1) }. См. раздел *note + Beam tracing sample::, для примеров кода и графика. + + -- Команда MGL: qo2d res 'ham' ini_re ini_im ray [`r=1 k0=100' xx=0 + yy=0] + Решает уравнение в частных производных du/dt = + i*k0*HAM(p,q,x,y,|u|)[u] в сопровождающей системе координат, где + p=-i/k0*d/dx, q=-i/k0*d/dy - псевдо-дифференциальные операторы. + Параметры INI_RE, INI_IM задают начальное распределение поля. + Параметр RAY задает опорный луч для сопровождающей системы + координат. Можно использовать луч найденный с помощью `ray'. + Опорный луч должен быть достаточно гладкий, чтобы система + координат была однозначной и для исключения ошибок интегрирования. + Если массивы XX и YY указаны, то в них записываются декартовы + координаты для каждой точки найденного решения. См. также *note + pde::. См. раздел *note Beam tracing sample::, для примеров кода и + графика. + + -- Команда MGL: jacobian res xdat ydat [zdat=0] + Вычисляет якобиан преобразования {i,j,k} в {XDAT,YDAT,ZDAT}, где + координаты {i,j,k} полагаются нормированными в интервал [0,1]. + Якобиан находится по формуле det||dr_\alpha/d\xi_\beta||, где + r={XDAT,YDAT,ZDAT} и \xi={i,j,k}. Все размерности всех массивов + должны быть одинаковы. Данные должны быть трехмерными если указаны + все 3 массива {XDAT,YDAT,ZDAT} или двумерными если только 2 + массива {XDAT,YDAT}. + + +File: mgl_ru.info, Node: Change data, Next: Operators, Prev: Make another data, Up: MGL interface + +1.22 Изменение данных +==================================== + +Эти команды изменяют данные вдоль заданного направления(ий) типа +например дифференцирования, интегрирования и т.д. Направление +указывается строкой DIR, которая может содержать символы `x', `y' и/или +`z', вдоль которых изменения будут применены. + + -- Команда MGL: cumsum dat 'dir' + Суммирует с накоплением в выбранном направлении(ях). + + -- Команда MGL: integrate dat 'dir' + Выполняет интегрирование (подобно суммированию с накоплением) в + выбранном направлении(ях). + + -- Команда MGL: diff dat 'dir' + Выполняет дифференцирование в выбранном направлении(ях). + + -- Команда MGL: diff dat xdat ydat [zdat=0] + Выполняет дифференцирование данных DAT, параметрически зависящих + от координат, в направлении XDAT с YDAT, ZDAT=constant. Параметр + ZDAT может быть опущен, что соответствует 2D случаю. Используются + следующие формулы (2D случай): da/dx = + (a_j*y_i-a_i*y_j)/(x_j*y_i-x_i*y_j), где a_i=da/di, a_j=da/dj + обозначает дифференцирование вдоль 1-ой и 2-ой размерности. + Похожие формулы используются и в 3D случае. Порядок аргументов + можно менять - например, если данные a(i,j) зависят от координат + {x(i,j), y(i,j)}, то обычная производная по `x' будет равна `diff + a x y', а обычная производная по `y' будет равна `diff a y x'. + + -- Команда MGL: diff2 dat 'dir' + Выполняет двойное дифференцирование (как в операторе Лапласа) в + выбранном направлении(ях). + + -- Команда MGL: sinfft dat 'dir' + Выполняет синус преобразование в выбранном направлении(ях). Синус + преобразование есть \sum a_i \sin(k i). + + -- Команда MGL: cosfft dat 'dir' + Выполняет косинус преобразование в выбранном направлении(ях). + Синус преобразование есть \sum a_i \cos(k i). + + -- Команда MGL: hankel dat 'dir' + Выполняет преобразование Ханкеля в выбранном направлении(ях). + Преобразование Ханкеля есть \sum a_i J_0(k i). + + -- Команда MGL: swap dat 'dir' + Меняет местами левую и правую части данных в выбранном + направлении(ях). Полезно для отображения результата FFT. + + -- Команда MGL: roll dat 'dir' num + Сдвигает данные на NUM ячеек в выбранном направлении(ях). + Соответствует замене индекса на I->(I+NUM)%N. + + -- Команда MGL: mirror dat 'dir' + Отражает данные в выбранном направлении(ях). Соответствует замене + индекса на I->N-I. + + -- Команда MGL: sew dat ['dir'='xyz' `da=2*pi'] + Удаляет скачки данных (например, скачки фазы после обратных + тригонометрических функций) с периодом DA в выбранном + направлении(ях). + + -- Команда MGL: smooth data `type' ['dir'='xyz'] + Сглаживает данные в выбранном направлении(ях) методом TYPE. Сейчас + поддерживаются 4 метода: `0' ничего не делает, `1' линейное + усреднение по 3 точкам, `2' линейное усреднение по 5 точкам, `3' + квадратичное усреднение по 5 точкам. + + -- Команда MGL: envelop dat ['dir'='x'] + Находит огибающую данных в выбранном направлении. Только одно + направление может быть выбрано за раз. + + -- Команда MGL: normsl dat `v1 v2' ['dir'='z' `keep=on sym=off'] + Нормирует данные срез-за-срезом в выбранном направлении DIR в + интервал [V1,V2]. Если SYM=`on', то используется симметричный + интервал [-max(|v1|,|v2|), max(|v1|,|v2|)]. Если KEEP=`on', то + максимальное значение k-го среза ограничено величиной \sqrt{\sum + a_ij(k)/\sum a_ij(0)}. + + -- Команда MGL: norm dat `v1 v2 [sym=off dim=0]' + Нормирует данные в интервал [V1,V2]. Если SYM=`on', то + используется симметричный интервал [-max(|v1|,|v2|), + max(|v1|,|v2|)]. Изменения применяются только к срезам >=DIM. + + +File: mgl_ru.info, Node: Operators, Next: Program flow, Prev: Change data, Up: MGL interface + +1.23 Операторы +======================= + + -- Команда MGL: multo dat dat2 + Поэлементно умножает массив DAT на DAT2. + + -- Команда MGL: multo dat `val' + Умножает каждый элемент на число. + + -- Команда MGL: divto dat dat2 + Поэлементно делит массив DAT на DAT2. + + -- Команда MGL: divto dat `val' + Делит каждый элемент на число. + + -- Команда MGL: addto dat dat2 + Поэлементно прибавляет DAT2 к массиву DAT. + + -- Команда MGL: addto dat `val' + Прибавляет число к каждому элементу. + + -- Команда MGL: subto dat dat2 + Поэлементно вычитает DAT2 из массива DAT. + + -- Команда MGL: subto dat `val' + Вычитает число из каждого элемента. + + +File: mgl_ru.info, Node: Program flow, Next: Command options, Prev: Operators, Up: MGL interface + +1.24 Программирование +===================================== + +Эти команды управляют порядком выполнения других команд (условия, +циклы, подпрограммы), (пере-)определяют аргументы скрипта и пр. + + -- Команда MGL: chdir 'path' + Переходит в папку PATH. + + -- Команда MGL: define $N smth + Задает N-ый аргумент скрипта равным SMTH. Отмечу, что SMTH + используется как есть (с символами `'' если присутствуют). + Выполняется только подстановка других макроопределений $0...$9, + $a...$z. Здесь N это цифра (0...9) или буква (a...z). + + -- Команда MGL: define name smth + Определяет константу (скаляр) с именем `name' и числовым значением + `smth'. Позднее она может быть использована как обычное число. + + -- Команда MGL: defchr $N smth + Задает N-ый аргумент скрипта равным символу с UTF кодом SMTH. + Здесь N это цифра (0...9) или буква (a...z). + + -- Команда MGL: defnum $N smth + Задает N-ый аргумент скрипта равным числовому значению SMTH. Здесь + N это цифра (0...9) или буква (a...z). + + -- Команда MGL: defpal $N smth + Задает N-ый аргумент скрипта равным символу палитры с индексом, + найденным из SMTH. Здесь N это цифра (0...9) или буква (a...z). + + -- Команда MGL: call 'fname' [ARG1 ARG2 ... ARG9] + Переходит к выполнению (вызывает) подпрограммы FNAME (или внешнего + скрипта, если функция не была найдена). Опциональные аргументы + передаются в подпрограмму. См. также *note func::. + + -- Команда MGL: func 'fname' [narg=0] + Определяет подпрограмму с именем FNAME и задает число требуемых + аргументов. Аргументы будут помещены в параметры скрипта $1, $2, + ... $9. Отмечу, что выполнение основной программы должно быть + остановлено до начала определений подпрограмм. См. также *note + stop::, *note return::. + + -- Команда MGL: return + Возвращается из подпрограммы. + + -- Команда MGL: if dat 'cond' + Начинает блок команд, выполняемый если каждый элемент DAT + удовлетворяет условию COND. + + -- Команда MGL: if `val' + Начинает блок команд, выполняемый если `val' не ноль. + + -- Команда MGL: elseif dat 'cond' + Начинает блок команд, выполняемый если предыдущий `if' или + `elseif' не был выполнен и каждый элемент DAT удовлетворяет + условию COND. + + -- Команда MGL: elseif `val' + Начинает блок команд, выполняемый если предыдущий `if' или + `elseif' не был выполнен и `val' не ноль. + + -- Команда MGL: else + Начинает блок команд, выполняемый если предыдущий `if' или + `elseif' не был выполнен. + + -- Команда MGL: endif + Заканчивает определение блока `if/elseif/else'. + + -- Команда MGL: for $N `v1 v2 [dv=1]' + Начинает блок команд, выполняемый в цикле с $N-ым аргументом + изменяющимся от V1 до V2 с шагом DV. Здесь N это цифра (0...9) или + буква (a...z). + + -- Команда MGL: for $N dat + Начинает блок команд, выполняемый в цикле с $N-ым аргументом + пробегающим значения массива DAT. Здесь N это цифра (0...9) или + буква (a...z). + + -- Команда MGL: next + Заканчивает блок цикла `for'. + + -- Команда MGL: once `val' + Определяет код (между `once on' и `once off') который будет + выполнен только один раз. Полезно для работы с большими данными в + программах типа UDAV. + + -- Команда MGL: stop + Останавливает выполнение скрипта. + + +File: mgl_ru.info, Node: Command options, Next: Suffixes, Prev: Program flow, Up: MGL interface + +1.25 Опции команд +============================ + +Опции команд позволяют легко настроить вид отдельного графика не меняя +глобальных настроек для все рисунка. Опции указываются после команды. +Каждая опция отделяется от предыдущей символом `;'. Опции работают так, +что запоминают текущие настройки рисунка, применяют собственные +настройки, выполняют команду и возвращают глобальные настройки обратно. +Поэтому использование опций для команд обработки данных или настройки +графика бесполезно. + + Наиболее часто используемые опции - `xrange, yrange, zrange', +устанавливающие границы изменения осей координат (и тем самым +автоматических массивов). Например, команда `plot y; xrange 0.1 0.9' +построит кривую с x-координатой равно распределенной в интервале 0.1 +... 0.9, а не вдоль текущей оси x. + + Полный список опций: + + -- Опция MGL: alpha `val' + -- Опция MGL: alphadef `val' + Задает величину прозрачности поверхности. Значение должно быть в + диапазоне [0, 1]. См. также *note alphadef:: + + -- Опция MGL: ambient `val' + Задает яркость фонового освещения. Значение должно быть в + диапазоне [0, 1]. См. также *note ambient:: + + -- Опция MGL: crange `val1 val2' + Задает границы цветовой шкалы. См. также *note crange:: + + -- Опция MGL: xrange `val1 val2' + Задает границы изменения координаты x. См. также *note xrange:: + + -- Опция MGL: yrange `val1 val2' + Задает границы изменения координаты y. См. также *note yrange:: + + -- Опция MGL: zrange `val1 val2' + Задает границы изменения координаты z. См. также *note zrange:: + + -- Опция MGL: cut `val' + Задает обрезание точек за пределами осей координат. См. также + *note cut:: + + -- Опция MGL: fontsize `val' + Задает размер текста. См. также *note font:: + + -- Опция MGL: marksize `val' + Задает размер маркеров. См. также *note marksize:: + + -- Опция MGL: meshnum `val' + Задает ориентировочное число линий, стрелок, ячеек и пр. См. также + *note meshnum:: + + -- Опция MGL: legend 'txt' + Добавляет строку 'txt' во внутренний массив записей легенды. Стиль + линии и маркера аргумента последней вызванной команды построения + *note 1D plotting::. См. также *note legend:: + + +File: mgl_ru.info, Node: Suffixes, Next: Utilities, Prev: Command options, Up: MGL interface + +1.26 Суффиксы переменных +========================================== + +Суффиксы позволяют быстро получить числовую характеристику (размер, +максимальное или минимальное значение, сумму элементов и т.д.) массива +данных и использовать ее как число (скаляр) в аргументах. Суффиксы +начинаются с точки `.' сразу после (без пробелов) имени переменной и +временного массива. Например, `a.nx' даст размер массива A по оси х, +`b(1).max' даст максимальное значение второй строки массива B, +`(c(:,0)^2).sum' даст сумму квадратов элементов первой колонки массива +C и т.д. + + Полный список суффиксов: +*nx, ny, nz* + Размер массива в направлении x, y, z соответственно. + +*max* + Максимальное значение массива. + +*min* + Минимальное значение массива. + +*sum* + Сумма элементов массива. + +*a* + Первый элемент массива (элемент с индексами 0,0,0). + +*fst* + Первое не нулевое значение массива. + +*lst* + Последнее не нулевое значение массива. + +*mx, my, mz* + Положение максимума в направлении x, y, z соответственно. + +*ax, ay, az, aa* + Положение центра масс в направлении x, y, z соответственно или + среднее значение массива. + +*wx, wy, wz, wa* + Ширина в направлении x, y, z соответственно или дисперсия + элементов массива. + +*sx, sy, sz, sa* + Асимметрия в направлении x, y, z соответственно или элементов + массива. + +*kx, ky, kz, ka* + Эксцесс в направлении x, y, z соответственно или элементов массива. + + +File: mgl_ru.info, Node: Utilities, Prev: Suffixes, Up: MGL interface + +1.27 Утилиты для MGL +============================== + +MathGL содержит несколько программ для работы со скриптами MGL. Есть +утилита для сохранения в растровое (`mgl2png', `mgl2gif') или векторное +(`mgl2eps', `mgl2svg') изображения. Программа `mglview' показывает +результат выполнения скрипта MGL и позволяет вращать и настраивать +график. Также можно транслировать MGL скрипт в C++ файл с помощью +программы `mgl2cpp'. + + Все эти программы имеют схожий набор аргументов. Первым идет имя +скрипта, а вторым идет имя выходного файлы (может быть опущено), +последние аргументы - опции скрипта и программы. К опциям относятся +параметры скрипта (это `$0, $1, ... $9') и настройки локали. Параметры +скрипта имеют формат `-Nval', где N=0,1...9 - номер параметра, val - +его значние. Например, опция `-1test' заменит `$1' на `test' в скрипте. +Опция -Lval устанавливает локаль в значение val. Например, `-Lutf8' +будет использовать UTF-8 в скрипте. + + Также можно создавать анимированные изображения GIF или набор JPEG +файлов с именами `frameNNNN.jpg' (где `NNNN' - номер кадра). Для этого +в скрипте надо указать параметры анимации для каждого кадра (строками с +коментариями `##a val' или опциями `-Aval') или в цикле (строкой с +комментарием `##с v1 v2 [dv]' или опцию `-Cn1:n2'), которые будут +подставлены в качестве параметра `$0' при последовательном вызове +скрипта. Для сохранения кадров в JPEG просто добавьте команду `write +''' в конце скрипта. + + +File: mgl_ru.info, Node: Examples, Next: Samples, Prev: MGL interface, Up: Top + +2 MathGL examples +***************** + +This chapter contain information about basic and advanced MathGL, hints +and samples for all types of graphics. I recommend you read first 2 +sections one after another and at least look on "Hints" section. Also I +recommend you to look at *note General concepts::. Sample code for some +of these examples can be found in `http://mathgl.sf.net/pictures.html' +and in *note Samples::. + +* Menu: + +* Basic usage:: +* Advanced usage:: +* Data handling:: +* Data plotting:: +* Hints:: + + +File: mgl_ru.info, Node: Basic usage, Next: Advanced usage, Up: Examples + +2.1 Basic usage +=============== + +MGL script can be used by several manners. Each has positive and +negative sides: + * _The using of MGL in UDAV._ + + Positive side is the possibility to view the plot at once and to + modify it, rotate, zoom or switch on transparency or lighting) by + hand or by mouse. Negative sides are: the need of X-terminal. + + * _Direct writing to file in bitmap or vector format without + creation of graphical window._ + + Positive aspects are: batch processing of similar data set, for + example, a set of resulting data files for different calculation + parameters), running from the console program, including the + cluster calculation), fast and automated drawing, saving pictures + for further analysis, or demonstration). Negative sides are: the + usage of the external program for picture viewing. Also, the data + plotting is non-visual. So, you have to imagine the picture, view + angles, lighting and so on) before the plotting. I recommend to + use graphical window for determining the optimal parameters of + plotting on the base of some typical data set. And later use these + parameters for batch processing in console program. + + In this case you can use a set of programs: `mgl2png', `mgl2gif', + `mgl2eps', `mgl2svg' or `mglview' for viewing. + + The simplest script is +box # draw bounding box +axis # draw axis +fplot 'x^3' # draw some function + + Just type it in UDAV and press F5. Also you can save it in text file +`test.mgl' and type in the console `mgl2png test.mgl' what produce file +`test.mgl.png' with resulting picture. + + +File: mgl_ru.info, Node: Advanced usage, Next: Data handling, Prev: Basic usage, Up: Examples + +2.2 Advanced usage +================== + +Now I show several non-obvious features of MGL: several subplots in a +single picture, curvilinear coordinates, text printing and so on. +Generally you may miss this section at first reading, but I don't +recommend it. + +* Menu: + +* Subplots:: +* Axis and grids:: +* Curvilinear coordinates:: +* Text printing example:: + + +File: mgl_ru.info, Node: Subplots, Next: Axis and grids, Up: Advanced usage + +2.2.1 Subplots +-------------- + +Let me demonstrate possibilities of axes transformation. MathGL has the +following functions: `SubPlot', `InPlot', `Aspect' and `Rotate', *note +Transformation matrix::). The order of their calling is strictly +determined. First, one changes the position of axes in image area, +functions `SubPlot' and `InPlot'). After that one may rotate the plot, +function `Rotate'). Finally, one may change aspects of axes, function +`Aspect'). The following code illustrates the aforesaid it: +subplot 2 2 0:box +text -1 1.1 'Just box' 'L' +inplot 0.2 0.5 0.7 1:box +text 0 1.2 'Inplot example' + +subplot 2 2 1 +rotate 60 40:aspect 1 1 1 +box:text 1 1 1.5 'rotate only' 'R' + +subplot 2 2 2 +rotate 60 40:aspect 1 1 2 +box:text 0 0 2 'aspect and rotate' + +subplot 2 2 3 +rotate 60 40:aspect 1 2 2 +box:text 0 0 1.5 'Aspect in other direction' + Here I used function `text' for printing the text in arbitrary +position of picture, *note Text printing::). Text coordinates and size +are connected with axes. However, text coordinates may be everywhere, +including the outside the bounding box. I shall show its features later +in *Note Text printing example::. + + Note that several commands can be placed in a string if they are +separated by `:' symbol. + +[image src="../png/sample1.png"] + +Example of several subplots on the single picture. + + +File: mgl_ru.info, Node: Axis and grids, Next: Curvilinear coordinates, Prev: Subplots, Up: Advanced usage + +2.2.2 Axis and grids +-------------------- + +MathGL library can draw not only the bounding box but also the axes, +grids, labels and so on. The limits of axes and their origin (the point +of intersection) are determined by function `axis'. Also you can use +`xrange, yrange, zrange' functions (*note Axis settings::). Ticks on +axis are specified by functions `xtick, ytick, ztick, ttick'. First +argument the direction for each change will be applied. Second argument +gives the step between ticks (if positive) or gives the number of ticks +on the axis (if negative) or set to use logarithmic ticks (if zero). +Third argument gives numbers of sub-ticks between ticks (default is +zero). Last argument define the initial ticks position. + + Function `Axis' draws axes. Its textual string shows in which +directions the axis or axes will be drawn (by default `'xyz'', function +draws axes in all directions). Function `Grid' draws grid +perpendicularly to specified directions. Example of axes and grid +drawing is: +subplot 2 2 0 +xtick 0.4 3 # sets tick step to 0.5 +ytick 0.4 3 # and draws 3 subticks +box # should be after the ticks change +axis 'xy': grid +text 0 1.3 1 'axis and grid' + +xtick -5: ytick -5 # restore back +subplot 2 2 1:rotate 60 40 +origin 0 0 0 +axis +xlabel 'x' 1 +ylabel 'y' 1 +zlabel 'z' 1 +text 0 0 1.5 'axis and labels' + +subplot 2 2 2:rotate 60 40 +xtick 0.2: ytick 0.2: ztick 0.2 # too low step of ticks +origin -1 -1 -1 +axis:grid +text 0 0 1.5 'shift origin and add grid' +text 0 0 1.2 '(note, too many ticks)' + +subplot 2 2 3:rotate 60 40 +xtick -6: ytick -6 # decrease the number of ticks +axis 'yz' +ylabel 'y axis' +zlabel 'z axis' +text 0 0 1.5 'remove x axis, and' +text 0 0 1.2 'decrease number of ticks' + + This example shows the importance of the correct choosing of the +number of ticks on axis. If tick step is too small then its text may +overlap and becomes unreadable. This code has the example of `Label' +function. It draws label for axis in specified direction. The text +position on axis is specified by third argument of `Label' function. If +it is positive then then text is drawn near the axis maximum, if +negative then the same takes place near the minimum of axis, if zero - +then at the center of axis. + +[image src="../png/sample2.png"] + +Example of setting up axis range and axis ticks. + + +File: mgl_ru.info, Node: Curvilinear coordinates, Next: Text printing example, Prev: Axis and grids, Up: Advanced usage + +2.2.3 Curvilinear coordinates +----------------------------- + +Now let use curvilinear coordinates. In difference from other systems +of plot creation, MathGL uses textual formulas for connection of the +old (data) and new (output) coordinates. This allows one to plot in +arbitrary coordinates. The following code plots the line Y=0, Z=0 in +Cartesian, polar, parabolic and spiral coordinates: +new x 50: new y 50: new z 50 +fill y 0.5 0.5: fill x -1 1 # creates data arrays +origin -1 1 -1 + +subplot 2 2 0:rotate 60 40 +plot x y z '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)' '' +plot x y z 'r2' +axis: grid +text 0 1.3 1 'cylindrical' + +subplot 2 2 2:rotate 60 40 +axis '2*y*x' 'y*y - x*x' '' +plot x y z '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' +plot x y z 'r2' +axis: grid +text 0 1.3 1 'spiral' + +[image src="../png/sample3.png"] + +Example of curvilinear coordinates + + +File: mgl_ru.info, Node: Text printing example, Prev: Curvilinear coordinates, Up: Advanced usage + +2.2.4 Text printing example +--------------------------- + +MathGL prints text by vector font. There are functions for manual +specifying of text position (like `Puts') and for its automatic +selection (like `Label', `legend' and so on). MathGL prints text always +in specified position even if it lies outside the bounding box. The +default size of font is specified by command FONTSIZE. However, the +actual size of output string depends on position of axes (depends on +functions `SubPlot', `InPlot'). The switching of the font style +(italic, bold, wire and so on) can be done for the whole string (by +function parameter) or inside the string. By default MathGL parses +TeX-like commands for symbols and indexes (see *note Font styles::). +Example of MathGL font drawing is: +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' + +[image src="../png/sample4.png"] + +Example of text printing with different font effects + + Another example demonstrate the features of TeX formula parsing. +text 0 0 '\sqrt{\frac{\alpha^{\gamma^2}+\overset 1{\big\infty}}{\sqrt3{2+b}}}', 0, -4 + +[image src="../png/samplee.png"] + +Example of TeX formula parsing + + +File: mgl_ru.info, Node: Data handling, Next: Data plotting, Prev: Advanced usage, Up: Examples + +2.3 Data handling +================= + +* Menu: + +* Array creation:: +* Data changing:: + + +File: mgl_ru.info, Node: Array creation, Next: Data changing, Up: Data handling + +2.3.1 Array creation +-------------------- + +One can put numbers into the data instance by several ways. Let us do +it for sinus function: + * one can create array by `list' command list a 0 0.04 0.16 0.36 0.64 1 + + * another way is to copy from "inline" array copy a [0,0.04,0.16,0.36,0.64,1] + + * next way is to fill the data by textual formula with the help of + `modify' function new a 6 + modify a 'x^2' + + * or one may fill the array in some interval and modify it later new a 6 + fill a 0 1 + modify a 'u^2' + + * or fill the array using current axis range new a 6 + fill a '(x+1)^2/4' + + * finally it can be loaded from file new s 6: modify s 'x^2' + save s 'sqr.dat' # create file first + read a 'sqr.dat' # load it + + * at this one can read only part of data new s 6: modify s 'x^2' + save s 'sqr.dat' # create file first + read a 'sqr.dat' 5 # load it + + Creation of 2d- and 3d-arrays is mostly the same. One can use direct +data filling by `list' command +list a 11 12 13 | 21 22 23 | 31 32 33 + or by inline arrays +copy a [[11,12,13],[21,22,23],[31,32,33]] + Also data can be filled by formula +new z 30 40 +fill z 'sin(pi*x)*cos(pi*y)' + or loaded from file. + + The only non-obvious thing here is using multidimensional arrays in +C/C++, i.e. arrays defined like `float dat[40][30];'. Since, formaly +this arrays element `dat[i]' can address the memory in arbitrary place +you should use the proper function to convert such arrays to `mglData' +object. For C++ this is functions like `mglData::Set(float **dat, int +N1, int N2'. For C this is functions like `mgl_data_set_float2(HMDT d, +const float **dat, int N1, int N2'. At this, you should keep in mind +that `nx=N2' and `ny=N1' after conversion. + + +File: mgl_ru.info, Node: Data changing, Prev: Array creation, Up: Data handling + +2.3.2 Data changing +------------------- + +MathGL has functions for data processing: differentiating, integrating, +smoothing and so on. 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 `x', `y' or `z'. For example, the call of `diff a 'x'' will +differentiate data along `x' direction; the call of `integrate a 'xy'' +perform the double integration of data along `x' and `y' directions; +the call of `diff2 a '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: +new a 30 40: modify a 'x*y' +axis 0 0 0 1 1 1 +subplot 2 2 0:rotate 60 40 +surf a: box +text 0.7 1 1.2 'a(x,y)' +subplot 2 2 1:rotate 60 40 +diff a 'x': surf a: box +text 0.7 1 1.2 'da/dx' +subplot 2 2 2:rotate 60 40 +integrate a 'xy': surf a: box +text 0.7 1 1.2 '\int da/dx dxdy' +subplot 2 2 3:rotate 60 40 +diff2 a 'y': surf a: box +text 0.7 1 1.2 '\int {d^2}a/dxdy dx' + +[image src="../png/sample6.png"] + +Example of data differentiation and integration + + Data smoothing (function `Smooth') is more interesting and +important. This function has 2 main arguments: type of smoothing and +its direction. Now 4 methods are supported: `0' does nothing for +delta=0 or approaches data to zero with the step delta, `1' linear +averaging by 3 points, `2' linear averaging by 5 points, `3' quadratic +averaging by 5 points. Let me demonstrate it for 1d case: +new y0 30 +modify y0 '0.4*sin(2*pi*x)+0.3*cos(3*pi*x)-0.4*sin(4*pi*x)+0.2*rnd' +copy y1 y0: smooth y1 1 +copy y2 y0: smooth y2 2 +copy y3 y0: smooth y3 3 + +plot y0 'k': addlegend 'none' 'k' +plot y1 'r': addlegend 'line 3' 'r' +plot y2 'g': addlegend 'line 5' 'g' +plot y3 'b': addlegend 'quad 5' 'b' +legend: box + +[image src="../png/sample7.png"] + +Example of data smoothing + + Finally one can create new data arrays on base of the existing one: +extract slice, row or column of data (`SubData'), summarize along some +of direction(s) (`Sum'), find distribution of data elements (`Hist'). +Note, that all these functions are not thread-safe because they use +static internal variable for output array. In particular, the using of +several of them in arguments of the same function will lead to +unpredictable result. + + +File: mgl_ru.info, Node: Data plotting, Next: Hints, Prev: Data handling, Up: Examples + +2.4 Data plotting +================= + +Let me now show how to plot the data. MathGL generally has 2 types of +plotting functions. Simple variant requires a single data array for +plotting, other data (coordinates) are considered uniformly distributed +in interval MIN*MAX. Second variant requires data arrays for all +coordinates. It allows one to plot rather complex multivalent curves +and surfaces (in case of parametric dependencies). Argument setting to +default values allows one to plot data in standard form. Manual +arguments setting gives possibility for fine tuning of colors, +positions and view of graphics. Note, that the call of drawing function +adds something to picture but does not clear the previous plots (as it +does in Matlab). Another difference from Matlab is that all setup (like +transparency, lightning, axis borders and so on) must be specified +*before* plotting functions. + +* Menu: + +* Plots for 1D data:: +* Plots for 2D data:: +* Plots for 3D data:: +* Surface transparency:: + + +File: mgl_ru.info, Node: Plots for 1D data, Next: Plots for 2D data, Up: Data plotting + +2.4.1 Plots for 1D data +----------------------- + +Term "1D data" means that data depend on single index (parameter) like +curve in parametric form {x(i),y(i),z(i)}, i=1...n. There are 5 +generally different types of data representations: simple line plot, +line plot with filling under it, stairs plot, bar plot and vertical +lines (*note 1D plotting::). Each type of plotting has similar +interface. There are 3D version and two 2D versions. One of last +requires single array. The parameters of line and marks (*note Line +styles::) are specified by the string argument. If the string parameter +is `NULL' then solid line with color from palette is used. + + Below I shall show the features of 1D plotting on base of `plot' +function (*note 1D plotting::). Let us start from sinus plot: +new y0 50: modify y0 'sin(pi*(2*x-1))' +subplot 2 2 0 +plot y0: box + Style of line is not specified in `plot' function. So MathGL uses the +solid line with first color of palette (this is blue). Next subplot +shows array Y1 with 2 rows: +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 + As previously I did not specify the style of lines. As a result, +MathGL again uses solid line with next colors in palette (there are +green and red). Now let us plot a circle on the same subplot. The +circle is parametric curve x=cos(\pi t), y=sin(\pi t). I will set the +color of the circle (dark yellow, `Y') and put marks `+' at point +position: +new x 50: modify x 'cos(pi*2*x-pi)' +plot x y0 'Y+' + Note that solid line is used because I did not specify the type of +line. The same picture can be achieved by `Plot2' function. Let us draw +ellipse by orange dash line: +plot y1(:,0) y(:,1) 'q|' + + Drawing in 3D space is mostly the same. Let us draw spiral with +default line style. Now its color is 4-th color from palette (this is +cyan): +subplot 2 2 2:rotate 60 40 +new z 50: modify z '2*x-1' +plot x y0 z 'g':box + Function `Plot3' does 3D curve plot but for single array. Use it to +put circle marks on the previous plot: +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 ' + Note that line style is empty ` ' here. Usage of other 1D plotting +functions looks similar: +subplot 2 2 3:rotate 60 40 +bars x y0 z 'r':box + +[image src="../png/sample8.png"] + +Example of 1D data plot + + +File: mgl_ru.info, Node: Plots for 2D data, Next: Plots for 3D data, Prev: Plots for 1D data, Up: Data plotting + +2.4.2 Plots for 2D data +----------------------- + +Surfaces `Surf' and other 2D plots (*note 2D plotting::) are drown the +same simpler as 1D one. The difference is that the string parameter +specifies not by line style but by the color scheme of the plot (*note +Color scheme::). Here I draw attention on 4 most interesting color +schemes. There is gray scheme where color is changed from black to +white (string `kw') or from white to black (string `wk'). Another +scheme is useful for accentuation of negative (by blue color) and +positive (by red color) regions on plot (string `'BbwrR''). Last one is +the popular "jet" scheme (string `'BbcyrR''). + + Now I shall show the example of a surface drawing. At first let us +switch lightning on +light on + and draw the surface, considering coordinates x,y to be uniformly +distributed in interval MIN*MAX +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 + Color scheme was not specified. So previous color scheme is used. In +this case it is default color scheme ("jet") for the first plot. Next +example is a sphere. The sphere is parametrically specified surface: +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 + I set color scheme to `'BbwrR'' that corresponds to red top and blue +bottom of the sphere. + + Surfaces will be plotted for each of slice of the data if NZ>1. Next +example draws surfaces for data arrays with NZ=3: +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 + Note, that it may entail a confusion. However, if one will use density +plot then the picture will look better: +subplot 2 2 3: rotate 60 40 +dens a1: box + Note, that the previous color scheme is used in last plots because +there are no direct specification of the one. + +[image src="../png/sample9.png"] + +Example of surface plot for 2D data + + Drawing of other 2D plots is analogous. The only peculiarity is the +usage of flag `#'. By default this flag switches on the drawing of a +grid on plot (`grid' or `mesh' for plots in plain or in volume). +However, for isosurfaces (including surfaces of rotation `axial') this +flag switches the face drawing off. Figure becomes wired. The +following code gives example of flag `#' using (compare with normal +function drawing as in its description): +alpha on: light on: light 0 0 0 1 +new a 30 20 +modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))' + +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 + +[image src="../png/samplea.png"] + +Example of 2D data plot with color scheme contained `#' symbol + + +File: mgl_ru.info, Node: Plots for 3D data, Next: Surface transparency, Prev: Plots for 2D data, Up: Data plotting + +2.4.3 Plots for 3D data +----------------------- + +Drawing procedures for 3D plot looks similarly to 1D and 2D plots +described above. There are 3 general types of 3D plots (*note 3D +plotting::): (i) plots on slices or on projections, (ii) isosurfaces, +(iii) cloud-like plots. Plots on slice are clear enough - one specifies +a slice (as its index or as coordinate value) and MathGL draws contour +lines or density plot on slice plane. Isosurface gives more +information. Isosurface is 3D analogue of the contour line `cont'. It +shows the region where data array values exceed specified isosurface +level. Plot becomes more informative if one adds transparency, +lightning or sets color scheme depending on coordinates. Generalization +of isosurface is the cloud-like plot. For this plot the darker color +and less transparent regions correspond to higher values of data. +Contrary, the regions with low values are transparent. For plotting of +the phase of fields (or beams or pulses) one can use isosurface which +transparency depends on the other data array (see function `surf3a'). +As example of 3D data plots let us draw the Gaussian beam diffraction +in space. Beam propagates along X axis: +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 + +[image src="../png/sampleb.png"] + +Example of Gaussian beam diffraction (3D data) + + +File: mgl_ru.info, Node: Surface transparency, Prev: Plots for 3D data, Up: Data plotting + +2.4.4 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 `Alpha'. As a result, all further surfaces (and +isosurfaces, density plots and so on) become transparent. However, +their look can be additionally improved. + + First, the selected surface will be non-transparent if one sets the +flag `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 `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 `transparent on'. + + Third feature is the changing of the way how the light goes through +overlapped surfaces. The variable `transptype' defines it. By default +the usual transparency is used (`transptype 0') - surfaces below is +less visible than the upper ones. A "glass-like" transparency +(`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 (`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 *note Plots for 2D +data:: (grid drawing is disabled) for different types of transparency. +[image src="../png/type0.png"] + +Example of `TranspType=0'. + +[image src="../png/type1.png"] + +Example of `TranspType=1'. + +[image src="../png/type2.png"] + +Example of `TranspType=2'. + + +File: mgl_ru.info, Node: Hints, Prev: Data plotting, Up: Examples + +2.5 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. +More examples with the source code can be find at +`http://mathgl.sf.net/' or in section *note Samples::. + +* 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:: +* Several light sources:: +* CutMin and CutMax features:: +* Mapping visualization:: +* Log-scaled plot:: +* Nonlinear fitting hints:: +* PDE solving hints:: +* Stereo image:: + + +File: mgl_ru.info, Node: ``Compound'' graphics, Next: Two axes in one plot, Up: Hints + +2.5.1 "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 `surfc' can be emulated in MathGL by 2 calls: +surf a +cont a 0 7 -1 # draw contours at z = -1 + Here A is 2-dimensional data for the plotting, `-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: +light on # switch on light for the surface +surf a 'bbcyrr' # select 'jet' colormap for the surface +cont a 'y' # and yellow color for contours + 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: +light on # switch on light for the surface +surf a 'kw' # select 'gray' colormap for the surface +caxis -1 0 # first draw for darker surface colors +conta 'w' # white contours +caxis 0 1 # now draw for brighter surface colors +cont a 'k' # black contours + 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. + + +File: mgl_ru.info, Node: Two axes in one plot, Next: Titles for the plot, Prev: ``Compound'' graphics, Up: Hints + +2.5.2 Two axes in one plot +-------------------------- + +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 (*note +2-axes sample::): +# set up first axis +axis -1 -1 1 1: origin -1 -1 +axis:fplot 'sin(pi*x)' # draw something in first axis +# set up second axis +axis 0 0 1 1: origin 1 1 +axis: fplot 'cos(4*pi*x^2)' # draw something in second axis + 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. + + +File: mgl_ru.info, Node: Titles for the plot, Next: Changing of the color range, Prev: Two axes in one plot, Up: Hints + +2.5.3 Titles for the plot +------------------------- + +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 `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 `subplot' calls). +Alternatively you can use function `title' for plotting title for the +picture at any time. + + +File: mgl_ru.info, Node: Changing of the color range, Next: Management of a point cutting, Prev: Titles for the plot, Up: Hints + +2.5.4 Changing of the color range +--------------------------------- + +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. + + For example, compare 2 surfaces: +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 + + +File: mgl_ru.info, Node: Management of a point cutting, Next: Vector field visualization, Prev: Changing of the color range, Up: Hints + +2.5.5 Management of a point cutting +----------------------------------- + +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 `cut off'. As a consequence, all outstanding +points will be projected on the bounding box. + + 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: +new a 20 30 # create some data +modify a '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 -1 -1 0 1 1 1:rotate 40 60 +cut off # set off cutting flag +surf a # and draw the surface + It is an interesting result, is not it? + + +File: mgl_ru.info, Node: Vector field visualization, Next: Several light sources, Prev: Management of a point cutting, Up: Hints + +2.5.6 Vector field visualization +-------------------------------- + +Vector field visualization (especially in 3d case `vect3' or `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 `meshnum' for +decreasing the number of hachures. The second way is to use the flow +thread chart `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 MatGL. + + +File: mgl_ru.info, Node: Several light sources, Next: CutMin and CutMax features, Prev: Vector field visualization, Up: Hints + +2.5.7 Several light sources +--------------------------- + +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 (*note Several light sample::). + + +File: mgl_ru.info, Node: CutMin and CutMax features, Next: Mapping visualization, Prev: Several light sources, Up: Hints + +2.5.8 CutMin and CutMax features +-------------------------------- + +MathGL library has a feature for cutting of points in some region +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 `isocaps' plot in Matlab). For example, let us use +the standard 3D data array and show its interior (*note CutMinMax +sample::). + +new c 61 51 40 # create the data +new v 10: fill v -0.5 1 +modify c '(-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1))' +cut 0 -1 -1 1 0 1.1 +rotate 40 60: surf3 c -0.5 'bbcyrr' +contf3 v c 'x' -1 'bbcyrr': contf3 v c 'y' -1 'bbcyrr' +contf3 v c 'z' 0 'bbcyrr': contf3 v c 'z' 39 'bbcyrr' + + One can also exclude points from arbitrary area in space. This area +defined by textual formula `cut' (*note Cutting::). The algorithm is +the same as shown for "rectangular cutting". + + +File: mgl_ru.info, Node: Mapping visualization, Next: Log-scaled plot, Prev: CutMin and CutMax features, Up: Hints + +2.5.9 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 `surfc', `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 `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 +:). + + +File: mgl_ru.info, Node: Log-scaled plot, Next: Nonlinear fitting hints, Prev: Mapping visualization, Up: Hints + +2.5.10 Log-scaled plot +---------------------- + +Log-scaled plot can be drawn by 2 steps. First, one should change the +scale of axis by call `axis '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: `xtick 0: yticks 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 *note Log-log +sample::. + + +File: mgl_ru.info, Node: Nonlinear fitting hints, Next: PDE solving hints, Prev: Log-scaled plot, Up: Hints + +2.5.11 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 (*note Fitting sample::). First, let us use +sin function with some random noise: +new rnd 100: new idl 50 # data to be fitted and ideal data +modify rnd '0.4*rnd+0.1+sin(4*pi*x)' +modify idl '0.3+sin(4*pi*x)' + and plot it to see that data we will fit +axis -1 -2 1 2 +plot rnd '. ':plot idl 'b' +box:text 0 2.2 'initial: y = 0.3+sin(2\pi x)' 'C:b' -1 + + The next step is the fitting itself. For that let me specify an +initial values INI for coefficients `abc' and do the fitting for +approximation formula `a+b*sin(c*x)' +new res # The data for found formula +fit res rnd 'a+b*sin(c*x)' 'abc' [1, 1, 3] + Now display it +plot res 'r' +text -1 -1.3 'fitted:' 'L:r' -1 +putsfit 0 -1.8 'y = ' 'C:r' -1 + + 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 `ini = [0, 0, 0]' in the +code above. + + +File: mgl_ru.info, Node: PDE solving hints, Next: Stereo image, Prev: Nonlinear fitting hints, Up: Hints + +2.5.12 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 +`ray' for ray tracing, `pde' for PDE solving, `qo2d' for beam tracing +in 2D case. 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 `ray' 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 `x', `y', `z', time `t' (for particle +dynamics) and momentums `p'=p_x, `q'=p_y, `v'=p_z. Next, you have to +define the initial conditions for coordinates and momentums at `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. +new re 128:new im 128 +ray r 'p^2+q^2-x-1' -0.7 -1 0 0 0.5 0 +plot r(0) r(1) + This example calculate the reflection from linear layer (media with +Hamiltonian `p^2+q^2-x-1'=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 \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 `x', `y', `z' (but not time!), momentums `p'=(d/dx)/i k_0, +`q'=(d/dy)/i k_0 and field amplitude `u'=|u|. The evolutionary +coordinate is `z' in all cases. So that, the equation look like du/dz = +ik_0 H(x,y,\hat p, \hat q, |u|)[u]. Dependence on field amplitude +`u'=|u| allows one to solve nonlinear problems too. For example, for +nonlinear Shrodinger equation you may set `ham='p^2 + q^2 - u^2''. Also +you may specify imaginary part for wave absorption, like `ham = 'p^2 + +i*x*(x>0)'', but only if dependence on variable `i' is linear (i.e. H = +Hre+i*Him). + + Next step is specifing the initial conditions at `z'=`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=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 H. At this moment, simplified form of operator H is supported +- all "mixed" terms (like `x*p'->x*d/dx) are excluded. For example, in +2D case this operator is effectively H = f(p,z) + g(x,z,u). However +commutable combinations (like `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 +`'p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)'' that correspond to equation 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 exp(-48*(x+0.7)^2). The corresponding code looks like this (*note +PDE sample::): +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 'yxz' +caxis 0 1 +dens a 'wyrRk' + + 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 W in direction transverse the ray. So, you don't need to +specify the range of coordinates. *BUT* there is limitation. The +accompanied coordinates are well defined only for smooth enough rays, +i.e. then the ray curvature K (which is defined as 1/K^2 = (|\ddot r|^2 +|\dot r|^2 - (\ddot r, \dot r)^2)/|\dot r|^6) is much large then the +grid width: 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: +new re 128: new im 128 +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 +# now start beam tracing +fill re 'exp(-48*x^2)' +new xx: new yy +qo2d a $1 re im r 1 30 xx yy +caxis 0 1 +dens xx yy a 'wyrRk' + + +File: mgl_ru.info, Node: Stereo image, Prev: PDE solving hints, Up: Hints + +2.5.13 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 (*note Stereo image +sample::): +subplot 2 1 0 # left image +rotate 40 60+3 +# draw something here +subplot 2 1 1 # right image +rotate 40 60-3 +# draw the same here + + +File: mgl_ru.info, Node: Samples, Next: Copying This Manual, Prev: Examples, Up: Top + +3 Примеры использования MathGL +************************************************** + +Эта глава содержит множество примеров кода для всех типов графиков, +наиболее важных возможностей библиотеки и советов. Аналогичные примеры +(с картинками) можно найти на `http://mathgl.sf.net/pictures.html'. + +* Menu: + +* 1D plotting samples:: +* 2D plotting samples:: +* 3D plotting samples:: +* Dual plotting samples:: +* Basic features:: +* Additional features:: +* Advanced features:: + + +File: mgl_ru.info, Node: 1D plotting samples, Next: 2D plotting samples, Up: Samples + +3.1 Примеры 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:: + + +File: mgl_ru.info, Node: Plot sample, Next: Radar sample, Up: 1D plotting samples + +3.1.1 Plot - пример использования +---------------------------------------------------- + +[image src="../png/plot.png"] + +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 + + +File: mgl_ru.info, Node: Radar sample, Next: Tens sample, Prev: Plot sample, Up: 1D plotting samples + +3.1.2 Radar - пример использования +----------------------------------------------------- + +[image src="../png/radar.png"] + +new y 10 3 +modify y '0.4*sin(pi*(2*x+y/2))+0.1*rnd' +radar y '#' + + +File: mgl_ru.info, Node: Tens sample, Next: Area sample, Prev: Radar sample, Up: 1D plotting samples + +3.1.3 Tens - пример использования +---------------------------------------------------- + +[image src="../png/tens.png"] + +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 + + +File: mgl_ru.info, Node: Area sample, Next: Area gradient sample, Prev: Tens sample, Up: 1D plotting samples + +3.1.4 Area - пример использования +---------------------------------------------------- + +[image src="../png/area.png"] + +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 + + +File: mgl_ru.info, Node: Area gradient sample, Next: Bars sample, Prev: Tens sample, Up: 1D plotting samples + +3.1.5 Area с градиентной заливкой - пример использования +----------------------------------------------------------------------------------------------- + +[image src="../png/area_2.png"] + +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' + + +File: mgl_ru.info, Node: Bars sample, Next: Bars 2 colors sample, Prev: Area gradient sample, Up: 1D plotting samples + +3.1.6 Bars - пример использования +---------------------------------------------------- + +[image src="../png/bars.png"] + +new y 10 3 +modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd' +origin 0 0 +box +bars y + + +File: mgl_ru.info, Node: Bars 2 colors sample, Next: Bars above sample, Prev: Bars sample, Up: 1D plotting samples + +3.1.7 Bars (2 цвета) - пример использования +------------------------------------------------------------------- + +[image src="../png/bars_2.png"] + +new y 10 3 +modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd' +origin 0 0 +box +bars y 'cbgGyr' + + +File: mgl_ru.info, Node: Bars above sample, Next: Bars fall sample, Prev: Bars 2 colors sample, Up: 1D plotting samples + +3.1.8 Bars (один над другим) - пример использования +----------------------------------------------------------------------------------- + +[image src="../png/bars_a.png"] + +new y 10 3 +modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd' +origin 0 0 +box +bars y 'a' + + +File: mgl_ru.info, Node: Bars fall sample, Next: Bars above sample, Prev: Bars above sample, Up: 1D plotting samples + +3.1.9 Bars "водопад" - пример использования +--------------------------------------------------------------------- + +[image src="../png/bars_f.png"] + +new y 10 3 +modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd' +origin 0 0 +box +bars y 'f' + + +File: mgl_ru.info, Node: Barh sample, Next: Step sample, Prev: Bars fall sample, Up: 1D plotting samples + +3.1.10 Barh - пример использования +----------------------------------------------------- + +[image src="../png/barh.png"] + +new y 10 3 +modify y '0.8*sin(pi*(2*x+y/2))+0.2*rnd' +origin 0 0 +box +barh y + + +File: mgl_ru.info, Node: Step sample, Next: Stem sample, Prev: Barh sample, Up: 1D plotting samples + +3.1.11 Step - пример использования +----------------------------------------------------- + +[image src="../png/step.png"] + +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 + + +File: mgl_ru.info, Node: Stem sample, Next: Region sample, Prev: Step sample, Up: 1D plotting samples + +3.1.12 Stem - пример использования +----------------------------------------------------- + +[image src="../png/stem.png"] + +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' + + +File: mgl_ru.info, Node: Region sample, Next: Region gradient sample, Prev: Stem sample, Up: 1D plotting samples + +3.1.13 Region - пример использования +------------------------------------------------------- + +[image src="../png/region.png"] + +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' + + +File: mgl_ru.info, Node: Region gradient sample, Next: Error sample, Prev: Region sample, Up: 1D plotting samples + +3.1.14 Region с градиентной заливкой - пример использования +-------------------------------------------------------------------------------------------------- + +[image src="../png/region_2.png"] + +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' + + +File: mgl_ru.info, Node: Error sample, Next: BoxPlot sample, Prev: Region gradient sample, Up: 1D plotting samples + +3.1.15 Error - пример использования +------------------------------------------------------ + +[image src="../png/error.png"] + +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' + + +File: mgl_ru.info, Node: BoxPlot sample, Next: Mark sample, Prev: Error sample, Up: 1D plotting samples + +3.1.16 BoxPlot - пример использования +-------------------------------------------------------- + +[image src="../png/boxplot.png"] + +new a 10 7 +modify a '(2*rnd-1)^3/2' +box +boxplot a +plot a ' ko' + + +File: mgl_ru.info, Node: Mark sample, Next: TextMark sample, Prev: BoxPlot sample, Up: 1D plotting samples + +3.1.17 Mark - пример использования +----------------------------------------------------- + +[image src="../png/mark.png"] + +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' + + +File: mgl_ru.info, Node: TextMark sample, Next: Tube sample, Prev: Mark sample, Up: 1D plotting samples + +3.1.18 TextMark - пример использования +--------------------------------------------------------- + +[image src="../png/textmark.png"] + +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' + + +File: mgl_ru.info, Node: Tube sample, Next: Text sample, Prev: TextMark sample, Up: 1D plotting samples + +3.1.19 Tube - пример использования +----------------------------------------------------- + +[image src="../png/tube.png"] + +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 + + +File: mgl_ru.info, Node: Text sample, Next: Torus sample, Prev: Tube sample, Up: 1D plotting samples + +3.1.20 Text - пример использования +----------------------------------------------------- + +[image src="../png/text.png"] + +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' + + +File: mgl_ru.info, Node: Torus sample, Next: Chart sample, Prev: Text sample, Up: 1D plotting samples + +3.1.21 Torus - пример использования +------------------------------------------------------ + +[image src="../png/torus.png"] + +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' + + +File: mgl_ru.info, Node: Chart sample, Next: Pie chart sample, Prev: Torus sample, Up: 1D plotting samples + +3.1.22 Chart - пример использования +------------------------------------------------------ + +[image src="../png/chart.png"] + +new ch 7 2 +modify ch 'rnd+0.1' +rotate 40 60 +light on +box +chart ch + + +File: mgl_ru.info, Node: Pie chart sample, Next: Ring chart sample, Prev: Chart sample, Up: 1D plotting samples + +3.1.23 Pie chart - пример использования +---------------------------------------------------------- + +[image src="../png/pie_chart.png"] + +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#' + + +File: mgl_ru.info, Node: Ring chart sample, Prev: Pie chart sample, Up: 1D plotting samples + +3.1.24 Ring chart - пример использования +----------------------------------------------------------- + +[image src="../png/ring_chart.png"] + +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#' + + +File: mgl_ru.info, Node: 2D plotting samples, Next: 3D plotting samples, Prev: 1D plotting samples, Up: Samples + +3.2 Примеры 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:: + + +File: mgl_ru.info, Node: Surf sample, Next: Transparent surface sample, Up: 2D plotting samples + +3.2.1 Surf - пример использования +---------------------------------------------------- + +[image src="../png/surf.png"] + +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 + + +File: mgl_ru.info, Node: Transparent surface sample, Next: Surface in fog sample, Prev: Surf sample, Up: 2D plotting samples + +3.2.2 Transparent surface - пример использования +------------------------------------------------------------------- + +[image src="../png/surf_alpha.png"] + +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 + + +File: mgl_ru.info, Node: Surface in fog sample, Next: Sharp colors sample, Prev: Transparent surface sample, Up: 2D plotting samples + +3.2.3 Surface in fog - пример использования +-------------------------------------------------------------- + +[image src="../png/surf_fog.png"] + +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 + + +File: mgl_ru.info, Node: Sharp colors sample, Next: Mesh sample, Prev: Surface in fog sample, Up: 2D plotting samples + +3.2.4 Sharp colors - пример использования +------------------------------------------------------------ + +[image src="../png/surf_sl.png"] + +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|' + + +File: mgl_ru.info, Node: Mesh sample, Next: Fall sample, Prev: Sharp colors sample, Up: 2D plotting samples + +3.2.5 Mesh - пример использования +---------------------------------------------------- + +[image src="../png/mesh.png"] + +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 + + +File: mgl_ru.info, Node: Fall sample, Next: Belt sample, Prev: Mesh sample, Up: 2D plotting samples + +3.2.6 Fall - пример использования +---------------------------------------------------- + +[image src="../png/fall.png"] + +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 + + +File: mgl_ru.info, Node: Belt sample, Next: Tile sample, Prev: Fall sample, Up: 2D plotting samples + +3.2.7 Belt - пример использования +---------------------------------------------------- + +[image src="../png/belt.png"] + +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 + + +File: mgl_ru.info, Node: Tile sample, Next: Boxs sample, Prev: Belt sample, Up: 2D plotting samples + +3.2.8 Tile - пример использования +---------------------------------------------------- + +[image src="../png/tile.png"] + +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 + + +File: mgl_ru.info, Node: Boxs sample, Next: Dens sample, Prev: Tile sample, Up: 2D plotting samples + +3.2.9 Boxs - пример использования +---------------------------------------------------- + +[image src="../png/boxs.png"] + +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 + + +File: mgl_ru.info, Node: Dens sample, Next: Cont sample, Prev: Boxs sample, Up: 2D plotting samples + +3.2.10 Dens - пример использования +----------------------------------------------------- + +[image src="../png/dens.png"] + +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 + + +File: mgl_ru.info, Node: Cont sample, Next: ContF sample, Prev: Dens sample, Up: 2D plotting samples + +3.2.11 Cont - пример использования +----------------------------------------------------- + +[image src="../png/cont.png"] + +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 + + +File: mgl_ru.info, Node: ContF sample, Next: ContD sample, Prev: Cont sample, Up: 2D plotting samples + +3.2.12 ContF - пример использования +------------------------------------------------------ + +[image src="../png/contf.png"] + +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 + + +File: mgl_ru.info, Node: ContD sample, Next: Axial sample, Prev: ContF sample, Up: 2D plotting samples + +3.2.13 ContD - пример использования +------------------------------------------------------ + +[image src="../png/contd.png"] + +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 + + +File: mgl_ru.info, Node: Axial sample, Next: Grad sample, Prev: ContD sample, Up: 2D plotting samples + +3.2.14 Axial - пример использования +------------------------------------------------------ + +[image src="../png/axial.png"] + +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 + + +File: mgl_ru.info, Node: Grad sample, Prev: Axial sample, Up: 2D plotting samples + +3.2.15 Grad - пример использования +----------------------------------------------------- + +[image src="../png/grad.png"] + +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 + + +File: mgl_ru.info, Node: 3D plotting samples, Next: Dual plotting samples, Prev: 2D plotting samples, Up: Samples + +3.3 Примеры 3D графиков +====================================== + +* Menu: + +* Surf3 sample:: +* Cloud sample:: +* CloudP sample:: +* Dens3 sample:: +* Cont3 sample:: +* ContF3 sample:: +* Cont projection sample:: +* Dens projection sample:: +* CutMinMax sample:: +* Isocaps sample:: +* CutOff sample:: + + +File: mgl_ru.info, Node: Surf3 sample, Next: Cloud sample, Up: 3D plotting samples + +3.3.1 Surf3 - пример использования +----------------------------------------------------- + +[image src="../png/surf3.png"] + +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 + + +File: mgl_ru.info, Node: Cloud sample, Next: CloudP sample, Prev: Surf3 sample, Up: 3D plotting samples + +3.3.2 Cloud - пример использования +----------------------------------------------------- + +[image src="../png/cloud.png"] + +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' + + +File: mgl_ru.info, Node: CloudP sample, Next: Dens3 sample, Prev: Cloud sample, Up: 3D plotting samples + +3.3.3 CloudP - пример использования +------------------------------------------------------ + +[image src="../png/cloudp.png"] + +Not available. + + +File: mgl_ru.info, Node: Dens3 sample, Next: Cont3 sample, Prev: CloudP sample, Up: 3D plotting samples + +3.3.4 Dens3 - пример использования +----------------------------------------------------- + +[image src="../png/densa.png"] + +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 + + +File: mgl_ru.info, Node: Cont3 sample, Next: ContF3 sample, Prev: Dens3 sample, Up: 3D plotting samples + +3.3.5 Cont3 - пример использования +----------------------------------------------------- + +[image src="../png/conta.png"] + +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 + + +File: mgl_ru.info, Node: ContF3 sample, Next: Cont projection sample, Prev: Cont3 sample, Up: 3D plotting samples + +3.3.6 ContF3 - пример использования +------------------------------------------------------ + +[image src="../png/contfa.png"] + +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 + + +File: mgl_ru.info, Node: Cont projection sample, Next: Dens projection sample, Prev: ContF3 sample, Up: 3D plotting samples + +3.3.7 Cont projection - пример использования +--------------------------------------------------------------- + +[image src="../png/cont_xyz.png"] + +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 + + +File: mgl_ru.info, Node: Dens projection sample, Next: CutMinMax sample, Prev: Cont projection sample, Up: 3D plotting samples + +3.3.8 Dens projection - пример использования +--------------------------------------------------------------- + +[image src="../png/dens_xyz.png"] + +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 + + +File: mgl_ru.info, Node: CutMinMax sample, Next: Isocaps sample, Prev: Dens projection sample, Up: 3D plotting samples + +3.3.9 CutMinMax - пример использования +--------------------------------------------------------- + +[image src="../png/cutminmax.png"] + +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 + + +File: mgl_ru.info, Node: Isocaps sample, Next: CutOff sample, Prev: CutMinMax sample, Up: 3D plotting samples + +3.3.10 "Isocaps" - пример использования +---------------------------------------------------------- + +[image src="../png/cutminmax2.png"] + +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 + + +File: mgl_ru.info, Node: CutOff sample, Prev: Isocaps sample, Up: 3D plotting samples + +3.3.11 CutOff - пример использования +------------------------------------------------------- + +[image src="../png/surf3_cutoff.png"] + +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 + + +File: mgl_ru.info, Node: Dual plotting samples, Next: Basic features, Prev: 3D plotting samples, Up: Samples + +3.4 Примеры парных/векторных графиков +=================================================================== + +* 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:: + + +File: mgl_ru.info, Node: SurfC sample, Next: SurfA sample, Up: Dual plotting samples + +3.4.1 SurfC - пример использования +----------------------------------------------------- + +[image src="../png/surfc.png"] + +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 + + +File: mgl_ru.info, Node: SurfA sample, Next: TileS sample, Prev: SurfC sample, Up: Dual plotting samples + +3.4.2 SurfA - пример использования +----------------------------------------------------- + +[image src="../png/surfa.png"] + +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 + + +File: mgl_ru.info, Node: TileS sample, Next: Map sample, Prev: SurfA sample, Up: Dual plotting samples + +3.4.3 TileS - пример использования +----------------------------------------------------- + +[image src="../png/tiles.png"] + +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 + + +File: mgl_ru.info, Node: Map sample, Next: Traj sample, Prev: TileS sample, Up: Dual plotting samples + +3.4.4 Map - пример использования +--------------------------------------------------- + +[image src="../png/map.png"] + +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 + + +File: mgl_ru.info, Node: Traj sample, Next: Vect sample, Prev: Map sample, Up: Dual plotting samples + +3.4.5 Traj - пример использования +---------------------------------------------------- + +[image src="../png/traj.png"] + +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 + + +File: mgl_ru.info, Node: Vect sample, Next: VectL sample, Prev: Traj sample, Up: Dual plotting samples + +3.4.6 Vect - пример использования +---------------------------------------------------- + +[image src="../png/vect.png"] + +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 + + +File: mgl_ru.info, Node: VectL sample, Next: VectC sample, Prev: Vect sample, Up: Dual plotting samples + +3.4.7 VectL - пример использования +----------------------------------------------------- + +[image src="../png/vectl.png"] + +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 + + +File: mgl_ru.info, Node: VectC sample, Next: Flow sample, Prev: VectL sample, Up: Dual plotting samples + +3.4.8 VectC - пример использования +----------------------------------------------------- + +[image src="../png/vectc.png"] + +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 + + +File: mgl_ru.info, Node: Flow sample, Next: Pipe sample, Prev: VectC sample, Up: Dual plotting samples + +3.4.9 Flow - пример использования +---------------------------------------------------- + +[image src="../png/flow.png"] + +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 + + +File: mgl_ru.info, Node: Pipe sample, Next: Dew sample, Prev: Flow sample, Up: Dual plotting samples + +3.4.10 Pipe - пример использования +----------------------------------------------------- + +[image src="../png/pipe.png"] + +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 + + +File: mgl_ru.info, Node: Dew sample, Next: Surf3C sample, Prev: Pipe sample, Up: Dual plotting samples + +3.4.11 Dew - пример использования +---------------------------------------------------- + +[image src="../png/dew.png"] + +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 + + +File: mgl_ru.info, Node: Surf3C sample, Next: Surf3A sample, Prev: Dew sample, Up: Dual plotting samples + +3.4.12 Surf3C - пример использования +------------------------------------------------------- + +[image src="../png/surf3c.png"] + +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 + + +File: mgl_ru.info, Node: Surf3A sample, Next: Vect 3D sample, Prev: Surf3C sample, Up: Dual plotting samples + +3.4.13 Surf3A - пример использования +------------------------------------------------------- + +[image src="../png/surf3a.png"] + +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 + + +File: mgl_ru.info, Node: Vect 3D sample, Next: VectL 3D sample, Prev: Surf3A sample, Up: Dual plotting samples + +3.4.14 Vect 3D - пример использования +-------------------------------------------------------- + +[image src="../png/vect3.png"] + +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' + + +File: mgl_ru.info, Node: VectL 3D sample, Next: VectC 3D sample, Prev: Vect 3D sample, Up: Dual plotting samples + +3.4.15 VectL 3D - пример использования +--------------------------------------------------------- + +[image src="../png/vectl3.png"] + +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' + + +File: mgl_ru.info, Node: VectC 3D sample, Next: Flow 3D sample, Prev: VectL 3D sample, Up: Dual plotting samples + +3.4.16 VectC 3D - пример использования +--------------------------------------------------------- + +[image src="../png/vectc3.png"] + +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' + + +File: mgl_ru.info, Node: Flow 3D sample, Next: Pipe 3D sample, Prev: VectC 3D sample, Up: Dual plotting samples + +3.4.17 Flow 3D - пример использования +-------------------------------------------------------- + +[image src="../png/flow3.png"] + +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' + + +File: mgl_ru.info, Node: Pipe 3D sample, Next: Crust sample, Prev: Flow 3D sample, Up: Dual plotting samples + +3.4.18 Pipe 3D - пример использования +-------------------------------------------------------- + +[image src="../png/pipe3.png"] + +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' + + +File: mgl_ru.info, Node: Crust sample, Next: Dots sample, Prev: Pipe 3D sample, Up: Dual plotting samples + +3.4.19 Crust - пример использования +------------------------------------------------------ + +[image src="../png/crust.png"] + +read a 'hotdogs.pts' +norm a -1 1 on +rotate 40 60 +light on +box +crust a 'p' + + +File: mgl_ru.info, Node: Dots sample, Prev: Crust sample, Up: Dual plotting samples + +3.4.20 Dots - пример использования +----------------------------------------------------- + +[image src="../png/dots.png"] + +read a 'hotdogs.pts' +norm a -1 1 on +rotate 40 60 +box +dots a 'p' + + +File: mgl_ru.info, Node: Basic features, Next: Additional features, Prev: Dual plotting samples, Up: Samples + +3.5 Базовые возможности +========================================= + +* 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:: + + +File: mgl_ru.info, Node: 1D plot sample, Next: 2D plot sample, Up: Basic features + +3.5.1 Пример графиков 1D данных +--------------------------------------------------- + +[image src="../png/sample8.png"] + +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 + + +File: mgl_ru.info, Node: 2D plot sample, Next: 3D plot sample, Prev: 1D plot sample, Up: Basic features + +3.5.2 Пример графиков 2D данных +--------------------------------------------------- + +[image src="../png/sample9.png"] + +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 + + +File: mgl_ru.info, Node: 3D plot sample, Next: Line styles sample, Prev: 2D plot sample, Up: Basic features + +3.5.3 Пример графиков 3D данных +--------------------------------------------------- + +[image src="../png/sampleb.png"] + +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 + + +File: mgl_ru.info, Node: Line styles sample, Next: Arrow styles sample, Prev: 3D plot sample, Up: Basic features + +3.5.4 Пример стилей линий и маркеров +-------------------------------------------------------------- + +[image src="../png/sample5.png"] + +NOT AVAILABLE + + +File: mgl_ru.info, Node: Arrow styles sample, Next: Text styles sample, Prev: Line styles sample, Up: Basic features + +3.5.5 Пример стилей стрелок +---------------------------------------------- + +[image src="../png/sampled.png"] + +NOT AVAILABLE + + +File: mgl_ru.info, Node: Text styles sample, Next: TeX parsing sample, Prev: Arrow styles sample, Up: Basic features + +3.5.6 Пример стилей текста +-------------------------------------------- + +[image src="../png/sample4.png"] + +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' + + +File: mgl_ru.info, Node: TeX parsing sample, Next: Font faces sample, Prev: Text styles sample, Up: Basic features + +3.5.7 Пример TeX формулы +------------------------------------- + +[image src="../png/samplee.png"] + +text 0 0 '\sqrt{\frac{\alpha^{\gamma^2}+\overset 1{\big\infty}}{\sqrt3{2+b}}}' '' -4 + + +File: mgl_ru.info, Node: Font faces sample, Next: Colors sample, Prev: TeX parsing sample, Up: Basic features + +3.5.8 Примеры начертаний шрифта +------------------------------------------------------ + +[image src="../png/fonts.png"] + +NOT AVAILABLE + + +File: mgl_ru.info, Node: Colors sample, Next: Color schemes sample, Prev: Font faces sample, Up: Basic features + +3.5.9 Примеры цветов +--------------------------------- + +[image src="../png/colors.png"] + +#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' + + +File: mgl_ru.info, Node: Color schemes sample, Next: Normal transparency, Prev: Colors sample, Up: Basic features + +3.5.10 Примеры цветовых схем +----------------------------------------------- + +[image src="../png/color_schemes.png"] + +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 + + +File: mgl_ru.info, Node: Normal transparency, Next: Glass-like transparency, Prev: Color schemes sample, Up: Basic features + +3.5.11 Обычная прозрачность +---------------------------------------------- + +[image src="../png/type0.png"] + +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 + + +File: mgl_ru.info, Node: Glass-like transparency, Next: Lamp-like transparency, Prev: Normal transparency, Up: Basic features + +3.5.12 "Стеклянная" прозрачность +------------------------------------------------------ + +[image src="../png/type1.png"] + +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 + + +File: mgl_ru.info, Node: Lamp-like transparency, Prev: Glass-like transparency, Up: Basic features + +3.5.13 "Ламповая" прозрачность +-------------------------------------------------- + +[image src="../png/type2.png"] + +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 + + +File: mgl_ru.info, Node: Additional features, Next: Advanced features, Prev: Basic features, Up: Samples + +3.6 Дополнительные возможности +======================================================= + +* 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:: +* Coloring by coordinates sample:: +* Drops sample:: +* Molecules drawing sample:: + + +File: mgl_ru.info, Node: Legend sample, Next: Adding mesh sample, Up: Additional features + +3.6.1 Legend - пример использования +------------------------------------------------------ + +[image src="../png/legend.png"] + +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 + + +File: mgl_ru.info, Node: Adding mesh sample, Next: Surf & Cont sample, Prev: Legend sample, Up: Additional features + +3.6.2 Добавляем сетку +----------------------------------- + +[image src="../png/samplea.png"] + +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 + + +File: mgl_ru.info, Node: Surf & Cont sample, Next: Flow & Dens sample, Prev: Adding mesh sample, Up: Additional features + +3.6.3 Surf & Cont - пример использования +----------------------------------------------------------- + +[image src="../png/surf_cont_y.png"] + +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' + + +File: mgl_ru.info, Node: Flow & Dens sample, Next: Several light sample, Prev: Surf & Cont sample, Up: Additional features + +3.6.4 Flow & Dens - пример использования +----------------------------------------------------------- + +[image src="../png/flow_dens.png"] + +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' + + +File: mgl_ru.info, Node: Several light sample, Next: Mirrored surface sample, Prev: Flow & Dens sample, Up: Additional features + +3.6.5 Несколько источников света +-------------------------------------------------------- + +[image src="../png/several_light.png"] + +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' + + +File: mgl_ru.info, Node: Mirrored surface sample, Next: Cont with labels sample, Prev: Several light sample, Up: Additional features + +3.6.6 Отражение поверхности +----------------------------------------------- + +[image src="../png/mirror.png"] + +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 + or +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 + + +File: mgl_ru.info, Node: Cont with labels sample, Next: Ternary plot sample, Prev: Mirrored surface sample, Up: Additional features + +3.6.7 Cont и подписи - пример использования +---------------------------------------------------------------------- + +[image src="../png/contt.png"] + +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' + + +File: mgl_ru.info, Node: Ternary plot sample, Next: Coloring by coordinates sample, Prev: Cont with labels sample, Up: Additional features + +3.6.8 Ternary plot - пример использования +------------------------------------------------------------ + +[image src="../png/ternary.png"] + +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.' + + +File: mgl_ru.info, Node: Coloring by coordinates sample, Next: Drops sample, Prev: Ternary plot sample, Up: Additional features + +3.6.9 Окрашивание по положению грани +--------------------------------------------------------------- + +[image src="../png/surf3_rgbd.png"] + +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 +surf3 a 'bgrd' + + +File: mgl_ru.info, Node: Drops sample, Next: Molecules drawing sample, Prev: Coloring by coordinates sample, Up: Additional features + +3.6.10 Drops - пример использования +------------------------------------------------------ + +[image src="../png/drops.png"] + +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' + + +File: mgl_ru.info, Node: Molecules drawing sample, Prev: Drops sample, Up: Additional features + +3.6.11 Рисование молекул +---------------------------------------- + +[image src="../png/molecule.png"] + +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' + + +File: mgl_ru.info, Node: Advanced features, Prev: Additional features, Up: Samples + +3.7 "Продвинутые" возможности +=================================================== + +* 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:: + + +File: mgl_ru.info, Node: Curvelinear coorinates sample, Next: 2-axes sample, Up: Advanced features + +3.7.1 Криволинейные координаты +----------------------------------------------------- + +[image src="../png/sample3.png"] + +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 + + +File: mgl_ru.info, Node: 2-axes sample, Next: Semi-log sample, Prev: Curvelinear coorinates sample, Up: Advanced features + +3.7.2 Несколько осей на одном графике +---------------------------------------------------------------- + +[image src="../png/2_axis.png"] + +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' + + +File: mgl_ru.info, Node: Semi-log sample, Next: Log-log sample, Prev: 2-axes sample, Up: Advanced features + +3.7.3 Semi-log - пример использования +-------------------------------------------------------- + +[image src="../png/semilog.png"] + +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 + + +File: mgl_ru.info, Node: Log-log sample, Next: Fitting sample, Prev: Semi-log sample, Up: Advanced features + +3.7.4 Log-log - пример использования +------------------------------------------------------- + +[image src="../png/loglog.png"] + +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 + + +File: mgl_ru.info, Node: Fitting sample, Next: Envelop sample, Prev: Log-log sample, Up: Advanced features + +3.7.5 Fitting - пример использования +------------------------------------------------------- + +[image src="../png/fit.png"] + +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 + + +File: mgl_ru.info, Node: Envelop sample, Next: Sew sample, Prev: Fitting sample, Up: Advanced features + +3.7.6 Envelop - пример использования +------------------------------------------------------- + +[image src="../png/envelop.png"] + +new a 1000 +fill a 'exp(-8*x^2)*sin(10*pi*x)' +plot a 'b' +envelop a +plot a 'r' +axis + + +File: mgl_ru.info, Node: Sew sample, Next: STFA sample, Prev: Envelop sample, Up: Advanced features + +3.7.7 Sew - пример использования +--------------------------------------------------- + +[image src="../png/sew.png"] + +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 + + +File: mgl_ru.info, Node: STFA sample, Next: PDE sample, Prev: Sew sample, Up: Advanced features + +3.7.8 STFA - пример использования +---------------------------------------------------- + +[image src="../png/stfa.png"] + +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' + + +File: mgl_ru.info, Node: PDE sample, Next: Beam tracing sample, Prev: STFA sample, Up: Advanced features + +3.7.9 PDE - пример использования +--------------------------------------------------- + +[image src="../png/pde.png"] + +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 + + +File: mgl_ru.info, Node: Beam tracing sample, Next: Parser sample, Prev: PDE sample, Up: Advanced features + +3.7.10 Beam tracing - пример использования +------------------------------------------------------------- + +[image src="../png/qo2d.png"] + +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 + + +File: mgl_ru.info, Node: Parser sample, Next: Manual ticks sample, Prev: Beam tracing sample, Up: Advanced features + +3.7.11 Parser - пример использования +------------------------------------------------------- + + +File: mgl_ru.info, Node: Manual ticks sample, Next: ColumnPlot sample, Prev: Parser sample, Up: Advanced features + +3.7.12 Особые метки по осям +-------------------------------------------- + +[image src="../png/tval.png"] + +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 + + +File: mgl_ru.info, Node: ColumnPlot sample, Next: StickPlot sample, Prev: Manual ticks sample, Up: Advanced features + +3.7.13 ColumnPlot - пример использования +----------------------------------------------------------- + +[image src="../png/column.png"] + +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 + + +File: mgl_ru.info, Node: StickPlot sample, Prev: ColumnPlot sample, Up: Advanced features + +3.7.14 StickPlot - пример использования +---------------------------------------------------------- + +[image src="../png/stick.png"] + +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' + + +File: mgl_ru.info, Node: Stereo image sample, Prev: StickPlot sample, Up: Advanced features + +3.7.15 Пример стерео изображения +------------------------------------------------------- + +[image src="../png/stereo.png"] + +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 + + + +Local Variables: +coding: utf-8 +End: diff --git a/texinfo/mgl_ru.info-2 b/texinfo/mgl_ru.info-2 new file mode 100644 index 0000000..82e8068 --- /dev/null +++ b/texinfo/mgl_ru.info-2 @@ -0,0 +1,889 @@ +This is mgl_ru.info, produced by makeinfo version 4.13 from mgl_ru.texi. + +Это документация для MathGL (версии 1.11) - библиотеки классов и +функций для построения научной графики. Пожалуйста сообщайте о любых +ошибках в этом руководстве на . + + Copyright (C) 2009 Алексей Балакин. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, with the Front-Cover Texts + being "A GNU Manual," and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + "GNU Free Documentation License." + + (a) The FSF's Back-Cover Text is: "You have the freedom to copy + and modify this GNU manual. Buying copies from the FSF supports + it in developing GNU and promoting software freedom." + +INFO-DIR-SECTION MathGL documentation system +START-INFO-DIR-ENTRY +* MathGL: (mathgl). The library for scientific graphics. +END-INFO-DIR-ENTRY + + +File: mgl_ru.info, Node: Copying This Manual, Next: Index, Prev: Samples, Up: Top + +Appendix A GNU Free Documentation License +***************************************** + + Version 1.2, November 2002 + + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it + can be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You + accept the license if you copy, modify or distribute the work in a + way requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. If a section does not fit the above definition of + Secondary then it is not allowed to be designated as Invariant. + The Document may contain zero Invariant Sections. If the Document + does not identify any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup, or absence of + markup, has been arranged to thwart or discourage subsequent + modification by readers is not Transparent. An image format is + not Transparent if used for any substantial amount of text. A + copy that is not "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML, PostScript or PDF designed for + human modification. Examples of transparent image formats include + PNG, XCF and JPG. Opaque formats include proprietary formats that + can be read and edited only by proprietary word processors, SGML or + XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML, PostScript or PDF + produced by some word processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a computer-network location from + which the general network-using public has access to download + using public-standard network protocols a complete Transparent + copy of the Document, free of added material. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of + previous versions (which should, if there were any, be listed + in the History section of the Document). You may use the + same title as a previous version if the original publisher of + that version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on + the Title Page. If there is no section Entitled "History" in + the Document, create one stating the title, year, authors, + and publisher of the Document as given on its Title Page, + then add an item describing the Modified Version as stated in + the previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in + the "History" section. You may omit a network location for a + work that was published at least four years before the + Document itself, or if the original publisher of the version + it refers to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the + section all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section + titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + `http://www.gnu.org/copyleft/'. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. + + +File: mgl_ru.info, Node: Index, Prev: Copying This Manual, Up: Top + +Индекс +************ + +[index] +* Menu: + +* AddLegend: Legend sample. (line 6) +* addlegend: Legend. (line 29) +* addto: Operators. (line 18) +* adjust: Axis settings. (line 114) +* Alpha <1>: 3D plot sample. (line 6) +* Alpha <2>: 2D plot sample. (line 6) +* Alpha: Transparent surface sample. + (line 6) +* alpha <1>: Command options. (line 20) +* alpha: Transparency. (line 15) +* alphadef <1>: Command options. (line 20) +* alphadef: Transparency. (line 19) +* ambient <1>: Command options. (line 26) +* ambient: Lighting. (line 25) +* Area <1>: Area gradient sample. + (line 6) +* Area: Area sample. (line 6) +* area: 1D plotting. (line 56) +* arrowsize: Default sizes. (line 18) +* aspect: Transformation matrix. + (line 61) +* Axial <1>: Adding mesh sample. (line 6) +* Axial: Axial sample. (line 6) +* axial: 2D plotting. (line 135) +* axialdir: Other settings. (line 31) +* Axis <1>: Log-log sample. (line 6) +* Axis <2>: Semi-log sample. (line 6) +* Axis <3>: 2-axes sample. (line 6) +* Axis <4>: Curvelinear coorinates sample. + (line 6) +* Axis <5>: Dens3 sample. (line 6) +* Axis <6>: Ring chart sample. (line 6) +* Axis: Pie chart sample. (line 6) +* axis <1>: Axis and Colorbar. (line 10) +* axis: Axis settings. (line 12) +* ball: Primitives drawing. (line 12) +* Barh: Barh sample. (line 6) +* barh: 1D plotting. (line 101) +* Bars <1>: 1D plot sample. (line 6) +* Bars <2>: Bars fall sample. (line 6) +* Bars <3>: Bars above sample. (line 6) +* Bars <4>: Bars 2 colors sample. + (line 6) +* Bars: Bars sample. (line 6) +* bars: 1D plotting. (line 87) +* barwidth: Default sizes. (line 11) +* beam: 3D plotting. (line 119) +* Belt: Belt sample. (line 6) +* belt: 2D plotting. (line 57) +* box: Axis and Colorbar. (line 43) +* BoxPlot: BoxPlot sample. (line 6) +* boxplot: 1D plotting. (line 182) +* Boxs: Boxs sample. (line 6) +* boxs: 2D plotting. (line 66) +* call: Program flow. (line 34) +* caxis: Axis settings. (line 53) +* Chart <1>: Ring chart sample. (line 6) +* Chart <2>: Pie chart sample. (line 6) +* Chart: Chart sample. (line 6) +* chart: 1D plotting. (line 115) +* chdir: Program flow. (line 9) +* clearlegend: Legend. (line 34) +* clf: Primitives drawing. (line 9) +* Cloud: Cloud sample. (line 6) +* cloud: 3D plotting. (line 109) +* CloudP: CloudP sample. (line 6) +* Colorbar <1>: Color schemes sample. + (line 6) +* Colorbar: Dens sample. (line 6) +* colorbar: Axis and Colorbar. (line 17) +* columnplot: Transformation matrix. + (line 39) +* combine: Make another data. (line 6) +* cone: Primitives drawing. (line 55) +* Cont <1>: Cont with labels sample. + (line 6) +* Cont <2>: Surf & Cont sample. (line 6) +* Cont <3>: Adding mesh sample. (line 6) +* Cont: Cont sample. (line 6) +* cont: 2D plotting. (line 89) +* Cont3: Cont3 sample. (line 6) +* cont3: 3D plotting. (line 54) +* conta: 3D plotting. (line 72) +* ContD: ContD sample. (line 6) +* contd: 2D plotting. (line 119) +* ContF: ContF sample. (line 6) +* contf: 2D plotting. (line 105) +* ContF3 <1>: Isocaps sample. (line 6) +* ContF3: ContF3 sample. (line 6) +* contf3: 3D plotting. (line 76) +* contfa: 3D plotting. (line 93) +* contfx: Other plotting. (line 36) +* contfy: Other plotting. (line 36) +* contfz: Other plotting. (line 36) +* ContX: Cont projection sample. + (line 6) +* contx: Other plotting. (line 27) +* ContY: Cont projection sample. + (line 6) +* conty: Other plotting. (line 27) +* ContZ: Cont projection sample. + (line 6) +* contz: Other plotting. (line 27) +* copy: Data create. (line 31) +* cosfft: Change data. (line 40) +* crange <1>: Command options. (line 30) +* crange: Axis settings. (line 75) +* crop: Rearrange data. (line 31) +* Crust: Crust sample. (line 6) +* crust: Other plotting. (line 51) +* ctick: Axis settings. (line 92) +* cumsum: Change data. (line 11) +* curve: Primitives drawing. (line 22) +* cut <1>: Command options. (line 42) +* cut: Cutting. (line 10) +* CutMax <1>: Isocaps sample. (line 6) +* CutMax: CutMinMax sample. (line 6) +* CutMin <1>: Isocaps sample. (line 6) +* CutMin: CutMinMax sample. (line 6) +* CutOff: CutOff sample. (line 6) +* defchr: Program flow. (line 21) +* define: Program flow. (line 12) +* defnum: Program flow. (line 25) +* defpal: Program flow. (line 29) +* delete: Rearrange data. (line 35) +* Dens <1>: Flow & Dens sample. (line 6) +* Dens <2>: Adding mesh sample. (line 6) +* Dens <3>: 3D plot sample. (line 6) +* Dens <4>: 2D plot sample. (line 6) +* Dens: Dens sample. (line 6) +* dens: 2D plotting. (line 81) +* Dens3: Dens3 sample. (line 6) +* dens3: 3D plotting. (line 41) +* densa: 3D plotting. (line 50) +* DensX: Dens projection sample. + (line 6) +* densx: Other plotting. (line 18) +* DensY: Dens projection sample. + (line 6) +* densy: Other plotting. (line 18) +* DensZ: Dens projection sample. + (line 6) +* densz: Other plotting. (line 18) +* Dew: Dew sample. (line 6) +* dew: Vector fields. (line 73) +* diff: Change data. (line 17) +* diff2: Change data. (line 33) +* divto: Operators. (line 12) +* Dots: Dots sample. (line 6) +* dots: Other plotting. (line 44) +* Drop <1>: Molecules drawing sample. + (line 6) +* Drop: Drops sample. (line 6) +* drop: Primitives drawing. (line 46) +* else: Program flow. (line 64) +* elseif: Program flow. (line 55) +* endif: Program flow. (line 68) +* Envelop: Envelop sample. (line 6) +* envelop: Change data. (line 72) +* Error: Error sample. (line 6) +* error: 1D plotting. (line 173) +* evaluate: Make another data. (line 10) +* export: File I/O. (line 48) +* extend: Rearrange data. (line 12) +* facex: Primitives drawing. (line 30) +* facey: Primitives drawing. (line 31) +* facez: Primitives drawing. (line 32) +* Fall: Fall sample. (line 6) +* fall: 2D plotting. (line 47) +* fgets: Text printing. (line 52) +* fill: Data filling. (line 6) +* Fit: Fitting sample. (line 6) +* fit: Nonlinear fitting. (line 38) +* fits: Nonlinear fitting. (line 30) +* Flow <1>: Flow & Dens sample. (line 6) +* Flow <2>: Flow 3D sample. (line 6) +* Flow: Flow sample. (line 6) +* flow: Vector fields. (line 82) +* Fog: Surface in fog sample. + (line 6) +* fog: Fog. (line 6) +* font: Other settings. (line 6) +* fontsize: Command options. (line 46) +* for: Program flow. (line 72) +* fplot: Other plotting. (line 94) +* fsurf: Other plotting. (line 105) +* func: Program flow. (line 38) +* Grad: Grad sample. (line 6) +* grad: 2D plotting. (line 151) +* grid: Axis and Colorbar. (line 38) +* grid2: 2D plotting. (line 161) +* grid3: 3D plotting. (line 98) +* grida: 3D plotting. (line 105) +* hankel: Change data. (line 44) +* hist: Make another data. (line 20) +* idset: Data create. (line 38) +* if: Program flow. (line 49) +* import: File I/O. (line 43) +* info: Data create. (line 42) +* inplot: Transformation matrix. + (line 30) +* insert: Rearrange data. (line 42) +* integrate: Change data. (line 13) +* jacobian: Make another data. (line 140) +* Legend: Legend sample. (line 6) +* legend <1>: Command options. (line 56) +* legend: Legend. (line 18) +* legendbox: Legend. (line 37) +* legendmarks: Legend. (line 41) +* Light: Several light sample. + (line 6) +* light: Lighting. (line 13) +* Line <1>: Arrow styles sample. (line 6) +* Line: Line styles sample. (line 6) +* line: Primitives drawing. (line 16) +* linewidth: Default sizes. (line 22) +* list: Data create. (line 16) +* Map: Map sample. (line 6) +* map: Dual plotting. (line 76) +* Mark <1>: Line styles sample. (line 6) +* Mark: Mark sample. (line 6) +* mark: 1D plotting. (line 153) +* marksize <1>: Command options. (line 49) +* marksize: Default sizes. (line 15) +* max: Make another data. (line 47) +* Mesh: Mesh sample. (line 6) +* mesh: 2D plotting. (line 40) +* meshnum <1>: Command options. (line 52) +* meshnum: Other settings. (line 25) +* mglParse: Parser sample. (line 6) +* mglPDE: PDE sample. (line 6) +* mglQO2d: Beam tracing sample. (line 6) +* mglRay <1>: Beam tracing sample. (line 6) +* mglRay: PDE sample. (line 6) +* min: Make another data. (line 52) +* mirror: Change data. (line 57) +* modify: Data filling. (line 6) +* momentum: Make another data. (line 36) +* multo: Operators. (line 6) +* new: Data create. (line 6) +* next: Program flow. (line 81) +* norm: Change data. (line 83) +* normsl: Change data. (line 76) +* once: Program flow. (line 85) +* origin: Axis settings. (line 58) +* palette: Other settings. (line 15) +* pde: Make another data. (line 94) +* perspective: Transformation matrix. + (line 65) +* Pipe <1>: Pipe 3D sample. (line 6) +* Pipe: Pipe sample. (line 6) +* pipe: Vector fields. (line 114) +* Plot <1>: Log-log sample. (line 6) +* Plot <2>: Semi-log sample. (line 6) +* Plot <3>: Legend sample. (line 6) +* Plot <4>: 1D plot sample. (line 6) +* Plot: Plot sample. (line 6) +* plot: 1D plotting. (line 30) +* plotfactor: Zooming. (line 10) +* put: Data filling. (line 29) +* Puts <1>: Font faces sample. (line 6) +* Puts <2>: TeX parsing sample. (line 6) +* Puts: Text styles sample. (line 6) +* PutsFit: Fitting sample. (line 6) +* putsfit: Nonlinear fitting. (line 46) +* qo2d: Make another data. (line 125) +* quadplot: Other plotting. (line 83) +* Radar: Radar sample. (line 6) +* radar: 1D plotting. (line 38) +* ranges: Axis settings. (line 14) +* ray: Make another data. (line 114) +* read: File I/O. (line 6) +* readall: File I/O. (line 21) +* readhdf: File I/O. (line 37) +* readmat: File I/O. (line 16) +* rearrange: Rearrange data. (line 6) +* rect: Primitives drawing. (line 61) +* Region <1>: Region gradient sample. + (line 6) +* Region: Region sample. (line 6) +* region: 1D plotting. (line 69) +* resize: Make another data. (line 56) +* return: Program flow. (line 45) +* roll: Change data. (line 52) +* rotate: Transformation matrix. + (line 53) +* rotatetext: Other settings. (line 11) +* save: File I/O. (line 34) +* savehdf: File I/O. (line 40) +* setsize: Export to file. (line 12) +* SetTicks <1>: Log-log sample. (line 6) +* SetTicks: Semi-log sample. (line 6) +* SetTicksVal <1>: StickPlot sample. (line 6) +* SetTicksVal <2>: ColumnPlot sample. (line 6) +* SetTicksVal: Manual ticks sample. (line 6) +* Sew: Sew sample. (line 6) +* sew: Change data. (line 61) +* sinfft: Change data. (line 37) +* smooth: Change data. (line 66) +* Sphere: Molecules drawing sample. + (line 6) +* sphere: Primitives drawing. (line 42) +* squeeze: Rearrange data. (line 25) +* Stem: Stem sample. (line 6) +* stem: 1D plotting. (line 79) +* Step: Step sample. (line 6) +* step: 1D plotting. (line 128) +* STFA: STFA sample. (line 6) +* stfa: Dual plotting. (line 86) +* stfad: Make another data. (line 87) +* stickplot: Transformation matrix. + (line 46) +* stop: Program flow. (line 89) +* subdata: Make another data. (line 60) +* SubPlot <1>: Adding mesh sample. (line 6) +* SubPlot: 1D plot sample. (line 6) +* subplot: Transformation matrix. + (line 15) +* subto: Operators. (line 24) +* sum: Make another data. (line 43) +* Surf <1>: Mirrored surface sample. + (line 6) +* Surf <2>: Several light sample. + (line 6) +* Surf <3>: Surf & Cont sample. (line 6) +* Surf <4>: Adding mesh sample. (line 6) +* Surf <5>: 3D plot sample. (line 6) +* Surf <6>: 2D plot sample. (line 6) +* Surf <7>: Sharp colors sample. (line 6) +* Surf <8>: Surface in fog sample. + (line 6) +* Surf <9>: Transparent surface sample. + (line 6) +* Surf: Surf sample. (line 6) +* surf: 2D plotting. (line 32) +* Surf3 <1>: Coloring by coordinates sample. + (line 6) +* Surf3 <2>: CutOff sample. (line 6) +* Surf3 <3>: Isocaps sample. (line 6) +* Surf3 <4>: CutMinMax sample. (line 6) +* Surf3: Surf3 sample. (line 6) +* surf3: 3D plotting. (line 27) +* Surf3A: Surf3A sample. (line 6) +* surf3a: Dual plotting. (line 53) +* Surf3C: Surf3C sample. (line 6) +* surf3c: Dual plotting. (line 31) +* SurfA: SurfA sample. (line 6) +* surfa: Dual plotting. (line 45) +* SurfC: SurfC sample. (line 6) +* surfc: Dual plotting. (line 23) +* swap: Change data. (line 49) +* Tens: Tens sample. (line 6) +* tens: 1D plotting. (line 48) +* Ternary: Ternary plot sample. (line 6) +* ternary: Axis settings. (line 63) +* Text: Text sample. (line 6) +* text: Text printing. (line 28) +* TextMark: TextMark sample. (line 6) +* textmark: 1D plotting. (line 163) +* ticklen: Default sizes. (line 28) +* tickstl: Default sizes. (line 33) +* Tile: Tile sample. (line 6) +* tile: 2D plotting. (line 73) +* TileS: TileS sample. (line 6) +* tiles: Dual plotting. (line 68) +* title: Text printing. (line 48) +* tlabel: Axis and Colorbar. (line 51) +* Torus: Torus sample. (line 6) +* torus: 1D plotting. (line 135) +* trace: Make another data. (line 67) +* Traj: Traj sample. (line 6) +* traj: Vector fields. (line 20) +* transform: Make another data. (line 73) +* transforma: Make another data. (line 83) +* transparent: Transparency. (line 23) +* transpose: Rearrange data. (line 21) +* TranspType <1>: Lamp-like transparency. + (line 6) +* TranspType <2>: Glass-like transparency. + (line 6) +* TranspType: Normal transparency. (line 6) +* transptype: Transparency. (line 26) +* tricont: Other plotting. (line 70) +* triplot: Other plotting. (line 58) +* Tube: Tube sample. (line 6) +* tube: 1D plotting. (line 143) +* var: Data create. (line 11) +* Vect <1>: Vect 3D sample. (line 6) +* Vect: Vect sample. (line 6) +* vect: Vector fields. (line 30) +* VectC <1>: VectC 3D sample. (line 6) +* VectC: VectC sample. (line 6) +* vectc: Vector fields. (line 49) +* VectL <1>: VectL 3D sample. (line 6) +* VectL: VectL sample. (line 6) +* vectl: Vector fields. (line 61) +* write: Export to file. (line 6) +* xlabel: Axis and Colorbar. (line 48) +* xrange <1>: Command options. (line 33) +* xrange: Axis settings. (line 72) +* xtick: Axis settings. (line 89) +* ylabel: Axis and Colorbar. (line 49) +* yrange <1>: Command options. (line 36) +* yrange: Axis settings. (line 73) +* ytick: Axis settings. (line 90) +* zlabel: Axis and Colorbar. (line 50) +* zoom: Zooming. (line 16) +* zrange <1>: Command options. (line 39) +* zrange: Axis settings. (line 74) +* ztick: Axis settings. (line 91) +* Стиль линий: Line styles. (line 6) +* Стиль маркеров: Line styles. (line 6) +* Стиль стрелок: Line styles. (line 6) +* Стиль текста: Font styles. (line 6) +* Текстовые формулы: Textual formulas. (line 6) +* Цветовая схема: Color scheme. (line 6) + + + + +Local Variables: +coding: utf-8 +End: diff --git a/texinfo/mgl_ru.texi b/texinfo/mgl_ru.texi index 7a6b702..cee1571 100644 --- a/texinfo/mgl_ru.texi +++ b/texinfo/mgl_ru.texi @@ -27,10 +27,10 @@ supports it in developing GNU and promoting software freedom.'' @end quotation @end copying -@dircategory MathGL documentation system -@direntry -* MathGL: (mathgl). The library for scientific graphics. -@end direntry +@c @dircategory MathGL documentation system +@c @direntry +@c * MathGL: (mathgl). The library for scientific graphics. +@c @end direntry @titlepage @title Язык MGL diff --git a/texinfo/png/Makefile.am b/texinfo/png/Makefile.am index 1d28940..80e5143 100644 --- a/texinfo/png/Makefile.am +++ b/texinfo/png/Makefile.am @@ -7,6 +7,5 @@ CLEANFILES = $(png_images) $(png_images): hotdogs.pts # $(top_builddir)/examples/mgl_example $(top_builddir)/examples/mgl_example -kind=${@:.png=} - if test ! -d ../../png; then mkdir ../../png/; fi cp ${@} ../../png/ touch $(srcdir)/../mathgl.texi diff --git a/texinfo/png/Makefile.in b/texinfo/png/Makefile.in index 8ed1804..f5e89c6 100644 --- a/texinfo/png/Makefile.in +++ b/texinfo/png/Makefile.in @@ -463,7 +463,6 @@ uninstall-am: uninstall-pngDATA $(png_images): hotdogs.pts # $(top_builddir)/examples/mgl_example $(top_builddir)/examples/mgl_example -kind=${@:.png=} - if test ! -d ../../png; then mkdir ../../png/; fi cp ${@} ../../png/ touch $(srcdir)/../mathgl.texi -- 2.30.2