Top
Back: mathinit
Forward: latex_lib
FastBack:
FastForward:
Up: graphics_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.9.1.3 mplot

Procedure from library graphics.lib (see graphics_lib).

Usage:
mplot(fname, I [,I1,I2,..,s] ); fname=string; I,I1,I2,..=ideals, s=string representing the plot region.
Use the ideals I1,I2,.. in order to produce multiple plots (they need to have the same number of entries as I!).

Return:
string, text with Mathematica commands to display a plot

Note:
The plotregion is defaulted to -1,1 around zero.
For implicit given curves enter first the string returned by procedure mathinit into Mathematica in order to load ImplicitPlot. The following conventions for I are used:
 
  - ideal with 2 entries in one variable means a parametrised plane curve,
  - ideal with 3 entries in one variable means a parametrised space curve,
  - ideal with 3 entries in two variables means a parametrised surface,
  - ideal with 2 entries in two variables means an implicit curve
    given as I[1]==I[2],
  - ideal with 1 entry (or one polynomial) in two variables means
    an implicit curve given as  f == 0,

Example:
 
LIB "graphics.lib";
// ---------  plane curves ------------
ring rr0 = 0,x,dp; export rr0;
ideal I = x3 + x, x2;
ideal J = x2, -x+x3;
mplot("",I,J,"-2,2");
==> 
==> ParametricPlot[{{s^3+s,s^2},{s^2,s^3-s}},{s,-2,2},
==>  AspectRatio->Automatic];
==> 
// Paste the output into a Mathematica notebook
// active evaluation of the cell with SHIFT RETURN
// --------- space curves --------------
I = x3,-1/10x3+x2,x2;
mplot("",I);
==> 
==> ParametricPlot3D[{{s^3,-1/10*s^3+s^2,s^2}},{s,-1,1},
==>  ViewPoint->{1.3,-2.4,2}];
==> 
// Paste the output into a Mathematica notebook
// active evaluation of the cell with SHIFT RETURN
// ----------- surfaces -------------------
ring rr1 = 0,(x,y),dp; export rr1;
ideal J = xy,y,x2;
mplot("",J,"-2,1","1,2");
==> 
==> ParametricPlot3D[{{s*t,t,s^2}},{s,-2,1},{t,1,2},
==>  Boxed->True, Axes->True, ViewPoint->{1.3,-2.4,2}];
==> 
// Paste the output into a Mathematica notebook
// active evaluation of the cell with SHIFT RETURN
kill rr0,rr1;

Top Back: mathinit Forward: latex_lib FastBack: FastForward: Up: graphics_lib Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 4.3.1, 2022, generated by texi2html.