Logo Search packages:      
Sourcecode: mathgl version File versions  Download package

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes

mglGraphAB Class Reference

Class implement the creation of different mathematical plots using Z-ordering. More...

#include <mgl_ab.h>

Inheritance diagram for mglGraphAB:
Inheritance graph
[legend]
Collaboration diagram for mglGraphAB:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void AddLegend (const char *text, const char *style)
void AddLegendw (const wchar_t *text, const char *style)
void AddLight (int n, mreal x, mreal y, mreal z, char col='w')
void AddLight (int n, float x, float y, float z, char c='w')
void AdjustTicks (const char *dir="xyzc")
 Auto adjust ticks.
void AdjustTicks (const char *dir="xyzc")
bool Alpha (bool enable)
 Set the transparency on/off.
virtual void Ambient (mreal bright=0.5)
 Set ambient light brightness.
void Area (mglData &x, mglData &y, mglData &z, const char *pen="")
void Area (mglData &x, mglData &y, const char *pen="", bool sum=false)
void Area (mglData &y, const char *pen="", bool sum=false)
void Aspect (float Ax, float Ay, float Az)
void Aspect (mreal Ax, mreal Ay, mreal Az)
 Set aspect ratio for further plotting.
void Axial (mglData &v, mglData &x, mglData &y, mglData &z, const char *sch="")
void Axial (mglData &v, mglData &z, const char *sch="")
void Axial (mglData &x, mglData &y, mglData &z, const char *sch="", int Num=3)
void Axial (mglData &z, const char *sch="", int Num=3)
void Axis (const char *dir="xyz", bool adjust=false)
void Ball (mreal x, mreal y, mreal z, mglColor col=RC, mreal alpha=1)
 Draws the point (ball) at position {x,y,z} with color col.
void Ball (float x, float y, float z, char col='r')
void Barh (mglData &y, mglData &v, const char *pen="")
void Barh (mglData &v, const char *pen="")
void Bars (mglData &x, mglData &y, mglData &z, const char *pen="")
void Bars (mglData &x, mglData &y, const char *pen="")
void Bars (mglData &y, const char *pen="")
void Beam (mglData &tr, mglData &g1, mglData &g2, mglData &a, float r, const char *stl=0, int flag=0, int num=3)
void Beam (float val, mglData &tr, mglData &g1, mglData &g2, mglData &a, float r, const char *stl=NULL, int flag=0)
void Belt (mglData &x, mglData &y, mglData &z, const char *stl="")
void Belt (mglData &z, const char *stl="")
void Box (const char *col="k", bool ticks=true)
void BoxPlot (mglData &x, mglData &y, const char *pen="")
void BoxPlot (mglData &y, const char *pen="")
void Boxs (mglData &x, mglData &y, mglData &z, const char *stl="", float zVal=NAN)
void Boxs (mglData &z, const char *stl="", float zVal=NAN)
void Chart (mglData &a, const char *colors="")
void ClearLegend ()
void Clf (float r=1, float g=1, float b=1)
void CloseGIF ()
 Stop writing cinema using GIF format.
void CloseGIF ()
void Cloud (mglData &x, mglData &y, mglData &z, mglData &a, const char *stl="", float alpha=1)
void Cloud (mglData &a, const char *stl="", float alpha=1)
void Colorbar (const char *sch, int where, float x, float y, float w, float h)
void Colorbar (int where, float x, float y, float w, float h)
void Colorbar (const char *sch="", int where=0)
void Colorbar (mglData &val, const char *sch="", int where=0)
void ColumnPlot (int num, int ind)
void Cone (float x1, float y1, float z1, float x2, float y2, float z2, float r1, float r2=-1, const char *stl="B", bool edge=false)
void Cont (mglData &v, mglData &x, mglData &y, mglData &z, const char *sch="", float zVal=NAN)
void Cont (mglData &v, mglData &z, const char *sch="", float zVal=NAN)
void Cont (mglData &x, mglData &y, mglData &z, const char *sch="", int Num=7, float zVal=NAN)
void Cont (mglData &z, const char *sch="", int Num=7, float zVal=NAN)
void Cont3 (mglData &v, mglData &x, mglData &y, mglData &z, mglData &a, char dir, int sVal, const char *sch="")
void Cont3 (mglData &v, mglData &a, char dir, int sVal, const char *sch="")
void Cont3 (mglData &x, mglData &y, mglData &z, mglData &a, char dir, int sVal, const char *sch="", int Num=7)
void Cont3 (mglData &a, char dir, int sVal, const char *sch="", int Num=7)
void ContA (mglData &x, mglData &y, mglData &z, mglData &a, const char *sch="", int Num=7)
void ContA (mglData &a, const char *sch="", int Num=7)
void ContD (mglData &v, mglData &x, mglData &y, mglData &z, const char *sch="", float zVal=NAN)
void ContD (mglData &v, mglData &z, const char *sch="", float zVal=NAN)
void ContD (mglData &x, mglData &y, mglData &z, const char *sch="", int Num=7, float zVal=NAN)
void ContD (mglData &z, const char *sch="", int Num=7, float zVal=NAN)
void ContF (mglData &v, mglData &x, mglData &y, mglData &z, const char *sch="", float zVal=NAN)
void ContF (mglData &v, mglData &z, const char *sch="", float zVal=NAN)
void ContF (mglData &x, mglData &y, mglData &z, const char *sch="", int Num=7, float zVal=NAN)
void ContF (mglData &z, const char *sch="", int Num=7, float zVal=NAN)
void ContF3 (mglData &v, mglData &x, mglData &y, mglData &z, mglData &a, char dir, int sVal, const char *sch="")
void ContF3 (mglData &x, mglData &y, mglData &z, mglData &a, char dir, int sVal, const char *sch="", int Num=7)
void ContF3 (mglData &a, char dir, int sVal, const char *sch="", int Num=7)
void ContF3 (mglData &v, mglData &a, char dir, int sVal, const char *sch="")
void ContFA (mglData &x, mglData &y, mglData &z, mglData &a, const char *sch="", int Num=7)
void ContFA (mglData &a, const char *sch="", int Num=7)
void ContFX (mglData &a, const char *stl="", float sVal=NAN, int Num=7)
void ContFX (mglData &v, mglData &a, const char *stl="", float sVal=NAN)
void ContFY (mglData &a, const char *stl="", float sVal=NAN, int Num=7)
void ContFY (mglData &v, mglData &a, const char *stl="", float sVal=NAN)
void ContFZ (mglData &a, const char *stl="", float sVal=NAN, int Num=7)
void ContFZ (mglData &v, mglData &a, const char *stl="", float sVal=NAN)
void ContX (mglData &a, const char *stl="", float sVal=NAN, int Num=7)
void ContX (mglData &v, mglData &a, const char *stl="", float sVal=NAN)
void ContY (mglData &a, const char *stl="", float sVal=NAN, int Num=7)
void ContY (mglData &v, mglData &a, const char *stl="", float sVal=NAN)
void ContZ (mglData &a, const char *stl="", float sVal=NAN, int Num=7)
void ContZ (mglData &v, mglData &a, const char *stl="", float sVal=NAN)
void CopyFont (mglGraph *gr)
void Crust (mglData &x, mglData &y, mglData &z, const char *sch="", float er=0)
void Curve (float x1, float y1, float z1, float dx1, float dy1, float dz1, float x2, float y2, float z2, float dx2, float dy2, float dz2, const char *pen="B", int n=100)
void CutOff (const char *EqC)
void DefaultPlotParam ()
void Dens (mglData &x, mglData &y, mglData &z, const char *stl="", float zVal=NAN)
void Dens (mglData &z, const char *stl="", float zVal=NAN)
void Dens3 (mglData &x, mglData &y, mglData &z, mglData &a, char dir, int sVal, const char *stl="")
void Dens3 (mglData &a, char dir, int sVal, const char *stl="")
void DensA (mglData &x, mglData &y, mglData &z, mglData &a, const char *stl="")
void DensA (mglData &a, const char *stl="")
void DensX (mglData &a, const char *stl="", float sVal=NAN)
void DensY (mglData &a, const char *stl="", float sVal=NAN)
void DensZ (mglData &a, const char *stl="", float sVal=NAN)
void Dew (mglData &x, mglData &y, mglData &ax, mglData &ay, const char *sch="", float zVal=NAN)
void Dew (mglData &ax, mglData &ay, const char *sch="", float zVal=NAN)
void Dots (mglData &x, mglData &y, mglData &z, const char *sch="")
void Dots (mglData &x, mglData &y, mglData &z, mglData &a, const char *sch="")
void Drop (float x0, float y0, float z0, float dx, float dy, float dz, float r, const char *col="r", float shift=1, float ap=1)
virtual void EndFrame ()
 Finish frame drawing.
void EndFrame ()
void Error (mglData &y, mglData &ey, const char *pen="")
void Error (mglData &x, mglData &y, mglData &ey, const char *pen="")
void Error (mglData &x, mglData &y, mglData &ex, mglData &ey, const char *pen="")
void FaceX (float x0, float y0, float z0, float wy, float wz, const char *stl="w", float dx=0, float dy=0)
void FaceY (float x0, float y0, float z0, float wx, float wz, const char *stl="w", float dx=0, float dy=0)
void FaceZ (float x0, float y0, float z0, float wx, float wy, const char *stl="w", float dx=0, float dy=0)
void Fall (mglData &z, const char *stl="")
void Fall (mglData &x, mglData &y, mglData &z, const char *stl="")
void Fill (mglData &u, const char *eq)
void Fill (mglData &u, const char *eq, mglData &v)
void Fill (mglData &u, const char *eq, mglData &v, mglData &w)
virtual void Finish ()
 Finish plotting. Normally this function is called internaly.
float Fit (mglData &fit, mglData &x, mglData &y, mglData &z, mglData &a, const char *eq, const char *var, mglData &ini)
float Fit (mglData &fit, mglData &x, mglData &y, mglData &z, mglData &a, const char *eq, const char *var)
float Fit (mglData &fit, mglData &y, const char *eq, const char *var)
float Fit (mglData &fit, mglData &y, const char *eq, const char *var, mglData &ini)
float Fit (mglData &fit, mglData &x, mglData &y, const char *eq, const char *var)
float Fit (mglData &fit, mglData &x, mglData &y, const char *eq, const char *var, mglData &ini)
float Fit (mglData &fit, mglData &x, mglData &y, mglData &z, const char *eq, const char *var, mglData &ini)
float Fit (mglData &fit, mglData &x, mglData &y, mglData &z, const char *eq, const char *var)
float Fit2 (mglData &fit, mglData &z, const char *eq, const char *var, mglData &ini)
float Fit2 (mglData &fit, mglData &z, const char *eq, const char *var)
float Fit3 (mglData &fit, mglData &a, const char *eq, const char *var, mglData &ini)
float Fit3 (mglData &fit, mglData &a, const char *eq, const char *var)
float FitS (mglData &fit, mglData &y, mglData &s, const char *eq, const char *var)
float FitS (mglData &fit, mglData &x, mglData &y, mglData &s, const char *eq, const char *var)
float FitS (mglData &fit, mglData &x, mglData &y, mglData &z, mglData &a, mglData &s, const char *eq, const char *var)
float FitS (mglData &fit, mglData &y, mglData &s, const char *eq, const char *var, mglData &ini)
float FitS (mglData &fit, mglData &x, mglData &y, mglData &z, mglData &s, const char *eq, const char *var)
float FitS (mglData &fit, mglData &x, mglData &y, mglData &z, mglData &a, mglData &s, const char *eq, const char *var, mglData &ini)
float FitS (mglData &fit, mglData &x, mglData &y, mglData &s, const char *eq, const char *var, mglData &ini)
float FitS (mglData &fit, mglData &x, mglData &y, mglData &z, mglData &s, const char *eq, const char *var, mglData &ini)
void Flow (mglData &x, mglData &y, mglData &ax, mglData &ay, const char *sch="", int num=5, bool central=true, float zVal=NAN)
void Flow (mglData &ax, mglData &ay, const char *sch="", int num=5, bool central=true, float zVal=NAN)
void Flow (mglData &x, mglData &y, mglData &z, mglData &ax, mglData &ay, mglData &az, const char *sch="", int num=3, bool central=true)
void Flow (mglData &ax, mglData &ay, mglData &az, const char *sch="", int num=3, bool central=true)
void FlowP (float x0, float y0, float z0, mglData &ax, mglData &ay, const char *sch="")
void FlowP (float x0, float y0, float z0, mglData &x, mglData &y, mglData &z, mglData &ax, mglData &ay, mglData &az, const char *sch="")
void FlowP (float x0, float y0, float z0, mglData &ax, mglData &ay, mglData &az, const char *sch="")
void FlowP (float x0, float y0, float z0, mglData &x, mglData &y, mglData &ax, mglData &ay, const char *sch="")
virtual void Flush ()
 Flush the plotting commands to frame.
void Flush ()
void Fog (float d, float dz=0.25)
virtual void Fog (mreal d, mreal dz=0.25)
 Set the fog distance or switch it off (if d=0).
void GetBGRN (char *imgdata, int imglen)
virtual const unsigned char * GetBits ()
 Get RGB bitmap of current state image.
const char * GetFit ()
int GetHeight ()
 Get height of the image.
int GetNumFrame ()
 Get the number of created frames.
int GetNumFrame ()
mreal GetRatio ()
 Get ratio (mreal width)/(mreal height).
void GetRGB (char *imgdata, int imglen)
void GetRGBA (char *imgdata, int imglen)
const unsigned char * GetRGBA ()
 Get RGBA bitmap of current state image.
int GetWidth ()
 Get width of the image.
void Glyph (mreal x, mreal y, mreal f, int style, long icode, char col)
 Draw a set of triangles (or lines if trig==NULL) for glyph from point (0,0). Normally this function is used internally.
void Grid (const char *dir="xyz", const char *pen="B")
void Grid (mglData &x, mglData &y, mglData &z, const char *stl="", float zVal=NAN)
void Grid (mglData &z, const char *stl="", float zVal=NAN)
void Grid3 (mglData &x, mglData &y, mglData &z, mglData &a, char dir, int sVal, const char *stl="")
void Grid3 (mglData &a, char dir, int sVal, const char *stl="")
void GridA (mglData &x, mglData &y, mglData &z, mglData &a, const char *stl="")
void GridA (mglData &a, const char *stl="")
void Hist (mglData &res, mglData &x, mglData &y, mglData &z, mglData &a)
void Hist (mglData &res, mglData &x, mglData &y, mglData &a)
void Hist (mglData &res, mglData &x, mglData &a)
void Identity (bool rel=false)
void InPlot (float x1, float x2, float y1, float y2, bool rel=false)
void InPlot (mreal x1, mreal x2, mreal y1, mreal y2, bool rel=false)
 Put further plotting in some region of whole frame surface.
void Label (char dir, const char *text, float pos=+1, float size=-1.4, float shift=0)
void Label (char dir, const wchar_t *text, float pos=+1, float size=-1.4, float shift=0)
void Label (double x, double y, const char *text, const char *fnt=0, double size=-1.4)
void Label (double x, double y, const wchar_t *text, const char *fnt=0, double size=-1.4)
void Legend (int n, wchar_t **text, char **style, mreal x, mreal y, const char *font="rL", mreal size=-0.8, mreal llen=0.1)
 Draw legend strings text at position (x, y) by font with size.
void Legend (float x, float y, const char *font="L", float size=-0.8, float llen=0.1)
void Legend (int where=3, const char *font="L", float size=-0.8, float llen=0.1)
void Light (int n, mglPoint p, mglColor c=WC, mreal br=0.5, bool infty=true)
 Add a light source.
void Light (int n, bool enable)
 Switch on/off the specified light source.
bool Light (bool enable)
 Set the using of light on/off.
void Light (int n, mglPoint p, char c='w', mreal bright=0.5, bool infty=true)
 Add a light source.
void Line (float x1, float y1, float z1, float x2, float y2, float z2, const char *pen="B", int n=2)
void LoadFont (const char *name, const char *path=NULL)
void Map (mglData &x, mglData &y, mglData &a, mglData &b, const char *sch="", int ks=0, bool pnts=true)
void Map (mglData &a, mglData &b, const char *sch="", int ks=0, bool pnts=true)
void Mark (mreal x, mreal y, mreal z, char mark='.')
 draw mark with different type at position {x,y,z} (no scaling)
void Mark (mglData &y, mglData &r, const char *pen)
void Mark (mglData &x, mglData &y, mglData &r, const char *pen)
void Mark (mglData &x, mglData &y, mglData &z, mglData &r, const char *pen)
void Mark (float x, float y, float z, char mark)
void Mesh (mglData &x, mglData &y, mglData &z, const char *stl="")
void Mesh (mglData &z, const char *stl="")
 mglGraphAB (int w=600, int h=400)
 Initialize ZBuffer drawing and allocate the memory for image with size [Width x Height].
virtual int NewFrame ()
 Create new frame.
mglData PDE (const char *ham, mglData &ini_re, mglData &ini_im, float dz=0.1, float k0=100)
void Pen (mglColor col, char style, mreal width)
 Set the parameter lines directly (internaly used by mglGraph::SelectPen)
void Perspective (float val)
void Perspective (mreal a)
 Set perspective (in range [0,1)) for plot. Set to zero for switching off.
void Pipe (mglData &ax, mglData &ay, mglData &az, const char *sch="", float r0=0.05, int num=3, bool central=true)
void Pipe (mglData &x, mglData &y, mglData &ax, mglData &ay, const char *sch="", float r0=0.05, int num=5, bool central=true, float zVal=NAN)
void Pipe (mglData &x, mglData &y, mglData &z, mglData &ax, mglData &ay, mglData &az, const char *sch="", float r0=0.05, int num=3, bool central=true)
void Pipe (mglData &ax, mglData &ay, const char *sch="", float r0=0.05, int num=5, bool central=true, float zVal=NAN)
void Plot (mglData &x, mglData &y, const char *pen="")
void Plot (const char *fy, const char *stl="", int n=100)
void Plot (const char *fx, const char *fy, const char *fz, const char *stl="", int n=100)
void Plot (mglData &x, mglData &y, mglData &z, const char *pen="")
void Plot (mglData &y, const char *pen="")
virtual void PutDrawReg (int m, int n, int k, mglGraphAB *gr)
 Put drawing from other mglGraphZB (for multithreading, like subplots)
void Puts (float x, float y, float z, const char *text, const char *font="C", float size=-1, char dir=0)
void Puts (float x, float y, float z, float dx, float dy, float dz, const char *text, float size=-1)
void PutsFit (float x, float y, float z, const char *prefix=0, const char *font=0, float size=-1)
mreal Putsw (mglPoint p, mglPoint l, const wchar_t *text, char font='t', mreal size=-1)
 Print string str with font size size in position p along direction l.
void Putsw (mglPoint p, const wchar_t *text, const char *font=0, mreal size=-1, char dir=0, mreal shift=0)
 Print string str in position p with font size size.
void Putsw (float x, float y, float z, float dx, float dy, float dz, const wchar_t *text, float size=-1)
void Putsw (float x, float y, float z, const wchar_t *text, const char *font="C", float size=-1, char dir=0)
void Radar (mglData &a, const char *pen="", float r=-1)
void Region (mglData &y1, mglData &y2, const char *pen=NULL, bool inside=true)
void Region (mglData &x, mglData &y1, mglData &y2, const char *pen=NULL, bool inside=true)
void ResetFrames ()
 Reset frames counter (start it from zero)
void ResetFrames ()
void RestoreFont ()
void RestoreM ()
 Restore transformation matrix after last InPlot()
void Rotate (float TetX, float TetZ=0, float TetY=0)
void RotateN (float Tet, float x, float y, float z)
void RotateN (mreal Tet, mreal x, mreal y, mreal z)
 Rotate a further plotting around vector {x,y,z}.
char SelectPen (const char *pen)
 Set the parameter of line (usualy called internaly)
HMGL Self ()
void SetAlphaDef (float val)
 Set default value of alpha-channel.
void SetAlphaDef (float alpha)
void SetAmbient (float i)
void SetArrowkSize (mreal val)
 Set size of arrows.
void SetArrowSize (float size)
void SetAutoRanges (float x1, float x2, float y1=0, float y2=0, float z1=0, float z2=0)
void SetAxialDir (char val)
 Set default axial direction.
void SetAxialDir (char dir)
void SetBarWidth (float width)
void SetBarWidth (mreal val)
 Set relative width of rectangles in Bars, Barh, BoxPlot.
void SetBaseLineWidth (mreal val)
 Set base width for all lines.
void SetBaseLineWidth (float width)
void SetCoor (int how)
void SetCRange (float c1, float c2)
void SetCRange (mglData &dat, bool add=false)
void SetCTT (const wchar_t *t)
void SetCTT (const char *t)
void SetCTT (const wchar_t *templ)
void SetCTT (const char *templ)
void SetCut (bool val)
 Set cutting for points outside of bounding box.
void SetCut (bool cut)
void SetCutBox (float x1, float y1, float z1, float x2, float y2, float z2)
void SetCutBox (float x1, float y1, float z1, float x2, float y2, float z2)
 Set additional cutting box.
void SetDrawFace (bool val)
 Enable/disable face drawing (for speeding up)
void SetDrawFace (bool enable)
void SetDrawReg (int m, int n, int k)
 Set allowed drawing region (for multithreading, like subplots)
void SetFontDef (char *fnt)
void SetFontSize (float size)
void SetFontSizePT (mreal pt, int dpi=72)
 Set FontSize by size in pt and picture DPI (default is 16 pt for dpi=72)
void SetFunc (const char *EqX, const char *EqY, const char *EqZ=NULL, const char *EqA=NULL)
void SetLegendBox (bool enable)
void SetMarkSize (mreal val)
 Set size of marks.
void SetMarkSize (float size)
void SetMeshNum (int val)
 Set number of mesh lines.
void SetMeshNum (int num)
void SetOrigin (float x0, float y0, float z0=NAN)
void SetPalColor (int n, float r, float g, float b)
 Sets color for individual palette entry.
void SetPalColor (int n, float r, float g, float b)
void SetPalette (const char *colors)
 Set palette.
void SetPalette (const char *colors)
void SetPalNum (int n)
void SetPalNum (int num)
 Set number of colors in palette.
void SetPlotFactor (float val)
void SetPlotFactor (mreal val)
 Set PlotFactor.
void SetRanges (float x1, float x2, float y1, float y2, float z1=0, float z2=0)
void SetRotatedText (bool rotated)
void SetScheme (const char *colors)
void SetScheme (const char *sch, bool face=true)
 Set colormap scheme for surfaces (usualy called internaly)
virtual void SetSize (int w, int h)
 Set size of frame in pixels. Normally this function is called internaly.
void SetTickLen (mreal tlen, mreal stt=1.)
 Set ticks length.
void SetTickLen (float len, float stt=1)
void SetTicks (char dir, mreal d=-5, int ns=0, mreal org=NAN)
 Set the ticks parameters.
void SetTicks (char dir, float d=-5, int ns=0, float org=NAN)
void SetTickStl (const char *stl, const char *sub=0)
void SetTickStl (const char *stl, const char *sub=0)
 Set ticks styles.
void SetTicksVal (char dir, int n, double val, const char *lbl,...)
void SetTicksVal (char dir, int n, mreal *val, const char **lbl)
 Set ticks position and text (use n=0 to disable this feature)
void SetTicksVal (char dir, int n, mreal *val, const wchar_t **lbl)
void SetTransparent (bool enable)
void SetTransparent (bool val)
 Temporary switches transparency on/off.
void SetTranspType (int val)
 Set the transparency type.
void SetTranspType (int type)
void SetTuneTicks (int tune, float fact_pos=1.15)
void SetTuneTicks (int tune, mreal pos=1.15)
 Tune ticks.
void SetWarn (int code, const char *who="")
 Set warning code ant fill Message.
void SetXRange (mglData &dat, bool add=false)
void SetXTT (const wchar_t *templ)
void SetXTT (const char *templ)
void SetXTT (const char *t)
void SetXTT (const wchar_t *t)
 Set templates for ticks.
void SetYRange (mglData &dat, bool add=false)
void SetYTT (const char *t)
void SetYTT (const wchar_t *t)
void SetYTT (const char *templ)
void SetYTT (const wchar_t *templ)
void SetZRange (mglData &dat, bool add=false)
void SetZTT (const char *templ)
void SetZTT (const char *t)
void SetZTT (const wchar_t *t)
void SetZTT (const wchar_t *templ)
void ShowImage (const char *viewer="kuickshow", bool keep=0)
void SimplePlot (const mglData &a, int type=0, const char *stl=0)
 Plot data depending on its dimensions and type parameter.
void SimplePlot (mglData &a, int type, const char *stl="")
void Sphere (float x0, float y0, float z0, float r, const char *col="r")
void StartGIF (const char *fname, int ms=100)
 Start write frames to cinema using GIF format.
void StartGIF (const char *fname, int ms=100)
void Stem (mglData &x, mglData &y, mglData &z, const char *pen="")
void Stem (mglData &x, mglData &y, const char *pen="")
void Stem (mglData &y, const char *pen="")
void Step (mglData &x, mglData &y, mglData &z, const char *pen="")
void Step (mglData &y, const char *pen="")
void Step (mglData &x, mglData &y, const char *pen="")
void STFA (mglData &x, mglData &y, mglData &re, mglData &im, int dn, const char *sch="", float zVal=NAN)
void STFA (mglData &re, mglData &im, int dn, const char *sch="", float zVal=NAN)
void StickPlot (int num, int i, float tet, float phi)
void StickPlot (int num, int i, mreal tet, mreal phi)
 Put further plotting in cell of stick rotated on angles tet, phi.
void SubPlot (int nx, int ny, int m, float dx=0, float dy=0)
void Surf (const char *fx, const char *fy, const char *fz, const char *stl="", int n=100)
void Surf (mglData &x, mglData &y, mglData &z, const char *stl="")
void Surf (mglData &z, const char *stl="")
void Surf (const char *fz, const char *stl="", int n=100)
void Surf3 (mglData &x, mglData &y, mglData &z, mglData &a, const char *stl="", int num=3)
void Surf3 (mglData &a, const char *stl="", int num=3)
void Surf3 (float Val, mglData &x, mglData &y, mglData &z, mglData &a, const char *stl="")
void Surf3 (float Val, mglData &a, const char *stl="")
void Surf3A (float Val, mglData &x, mglData &y, mglData &z, mglData &a, mglData &b, const char *stl="")
void Surf3A (float Val, mglData &a, mglData &b, const char *stl="")
void Surf3A (mglData &x, mglData &y, mglData &z, mglData &a, mglData &b, const char *stl="", int num=3)
void Surf3A (mglData &a, mglData &b, const char *stl="", int num=3)
void Surf3C (float Val, mglData &a, mglData &b, const char *stl="")
void Surf3C (mglData &x, mglData &y, mglData &z, mglData &a, mglData &b, const char *stl="", int num=3)
void Surf3C (mglData &a, mglData &b, const char *stl="", int num=3)
void Surf3C (float Val, mglData &x, mglData &y, mglData &z, mglData &a, mglData &b, const char *stl="")
void SurfA (mglData &x, mglData &y, mglData &z, mglData &c, const char *sch="")
void SurfA (mglData &z, mglData &c, const char *sch="")
void SurfC (mglData &z, mglData &c, const char *sch="")
void SurfC (mglData &x, mglData &y, mglData &z, mglData &c, const char *sch="")
void Tens (mglData &y, mglData &c, const char *pen="")
void Tens (mglData &x, mglData &y, mglData &c, const char *pen="")
void Tens (mglData &x, mglData &y, mglData &z, mglData &c, const char *pen="")
void Ternary (bool val)
void Text (mglData &x, mglData &y, const char *text, const char *font="", float size=-1)
void Text (mglData &x, mglData &y, mglData &z, const char *text, const char *font="", float size=-1)
void Text (mglData &y, const char *text, const char *font="", float size=-1)
void TextMark (mglData &x, mglData &y, mglData &r, const char *text, const char *fnt="")
void TextMark (mglData &y, const char *text, const char *fnt="")
void TextMark (mglData &y, mglData &r, const char *text, const char *fnt="")
void TextMark (mglData &x, mglData &y, mglData &z, mglData &r, const char *text, const char *fnt="")
void Tile (mglData &z, const char *stl="")
void Tile (mglData &x, mglData &y, mglData &z, const char *stl="")
void TileS (mglData &x, mglData &y, mglData &z, mglData &r, const char *stl="")
void TileS (mglData &z, mglData &r, const char *stl="")
void Title (const char *text, const char *font="C", float size=-2)
void Title (const wchar_t *text, const char *font="C", float size=-2)
void Torus (mglData &r, mglData &z, const char *pen="")
void Traj (mglData &x, mglData &y, mglData &z, mglData &ax, mglData &ay, mglData &az, const char *sch="", float len=0)
void Traj (mglData &x, mglData &y, mglData &ax, mglData &ay, const char *sch="", float zVal=NAN, float len=0)
void TriPlot (mglData &nums, mglData &x, mglData &y, const char *sch="", float zVal=NAN)
void TriPlot (mglData &nums, mglData &x, mglData &y, mglData &z, const char *sch="")
void TriPlot (mglData &nums, mglData &x, mglData &y, mglData &z, mglData &c, const char *sch="")
void Tube (mglData &x, mglData &y, mglData &r, const char *pen="")
void Tube (mglData &x, mglData &y, mglData &z, mglData &r, const char *pen="")
void Tube (mglData &y, mglData &r, const char *pen="")
void Tube (mglData &x, mglData &y, float r, const char *pen="")
void Tube (mglData &y, float r, const char *pen="")
void Tube (mglData &x, mglData &y, mglData &z, float r, const char *pen="")
void Vect (mglData &ax, mglData &ay, const char *sch="", float zVal=NAN, int flag=0)
void Vect (mglData &x, mglData &y, mglData &z, mglData &ax, mglData &ay, mglData &az, const char *sch="", int flag=0)
void Vect (mglData &x, mglData &y, mglData &ax, mglData &ay, const char *sch="", float zVal=NAN, int flag=0)
void Vect (mglData &ax, mglData &ay, mglData &az, const char *sch="", int flag=0)
void VectC (mglData &x, mglData &y, mglData &z, mglData &ax, mglData &ay, mglData &az, const char *sch="")
void VectC (mglData &ax, mglData &ay, const char *sch="", float zVal=NAN)
void VectC (mglData &x, mglData &y, mglData &ax, mglData &ay, const char *sch="", float zVal=NAN)
void VectC (mglData &ax, mglData &ay, mglData &az, const char *sch="")
void VectL (mglData &ax, mglData &ay, const char *sch="", float zVal=NAN)
void VectL (mglData &ax, mglData &ay, mglData &az, const char *sch="")
void VectL (mglData &x, mglData &y, mglData &ax, mglData &ay, const char *sch="", float zVal=NAN)
void VectL (mglData &x, mglData &y, mglData &z, mglData &ax, mglData &ay, mglData &az, const char *sch="")
void WriteEPS (const char *fname, const char *descr="")
void WriteFrame (const char *fname, const char *descr="")
void WriteGIF (const char *fname, const char *descr="")
void WriteIDTF (const char *fname, const char *descr="")
void WriteJPEG (const char *fname, const char *descr="")
void WritePNG (const char *fname, const char *descr="", bool alpha=true)
virtual void WriteSVG (const char *fname, const char *descr=0)
 Write the frame in file using SVG format.
void Zoom (float x1, float y1, float x2, float y2)
Export functions

These functions export current view to a graphic file. The filename fname should have apropriate extension. Parameter descr gives the short description of the plot. Just now the compression of TIFF files and transparency in EPS files are not supported.

virtual void WriteJPEG (const char *fname, const char *descr=0)
 Write the frame in file using JPEG format.
virtual void WriteBMP (const char *fname, const char *descr=0)
 Write the frame in file using BMP format.
virtual void WritePNG (const char *fname, const char *descr=0, bool alpha=true)
 Write the frame in file using PNG format.
virtual void WriteEPS (const char *fname, const char *descr=0)
 Write the frame in file using PostScript format.
virtual void WriteIDTF (const char *fname, const char *descr=0)
 Write the frame in file using IDTF format.
virtual void WriteGIF (const char *fname, const char *descr=0)
 Write the frame in file using GIF format (only for current frame!)
void WriteFrame (const char *fname=0, const char *descr=0)
 Write the frame in file (depending extension, write current frame if fname is empty)
void ShowImage (const char *viewer="kuickshow", bool keep=false)
 Show currently produced image by Qt or FLTK library.
Plot positioning functions

These functions control how and where further plotting will be placed. There are a curtain order of these functions calls for the better plot view. First one is mglGraph::SubPlot or mglGraph::InPlot for specifing the place. After it a mglGraph::Aspect and mglGraph::Rotate. And finally any other plotting functions may be called. The function mglGraph::View can be used in any place.

virtual void View (mreal tetx, mreal tetz, mreal tety=0)
 Set angle of view indepently from mglGraph::Rotate().
void DefaultPlotParam ()
void Zoom (mreal x1, mreal y1, mreal x2, mreal y2)
 Zoom in or zoom out (if Zoom(0, 0, 1, 1)) a part of picture.
void Identity (bool rel=false)
 Clear transformation matrix.
virtual void Clf (mglColor Back=WC)
 Clear up the frame.
void SubPlot (int nx, int ny, int m, mreal dx=0, mreal dy=0)
 Put further plotting in some region of whole frame surface.
void ColumnPlot (int num, int i)
 Put further plotting in column cell of previous subplot.
void Rotate (mreal TetX, mreal TetZ, mreal TetY=0)
 Rotate a further plotting.
Axis functions

Axis functions control and draw the axes. There is twofold axis representation in MathGL. First the coordinates of data point are normalized in box mglGraph::Min X mglGraph::Max. If mglGraph::Cut is true then point is omitted otherwise it is projected to bounding box. After it transformation formulas mglGraph::fx, mglGraph::fy, mglGraph::fz are applied to the data point. Finally, the data point is plotted by one of function. There is possibility to set members mglGraph::Max, mglGraph::Min, mglGraph::fx, mglGraph::fy, mglGraph::fz directly. But one should call mglGraph::RecalcBorder function to setup plotting routines. The more safe way is to set these values by calling mglGraph::Axis functions. In this case the function mglGraph::RecalcBorder is called automaticly.

void Box (mglColor pen, bool ticks=true)
 Draws bounding box outside the plotting volume.
void Box (const char *col=0, bool ticks=true)
 Draws bounding box outside the plotting volume with color c.
void CRange (const mglData &a, bool add=false, mreal fact=0)
 Safety set values of mglGraph::Cmin and mglGraph::Cmax as minimal and maximal values of data a.
void CRange (mreal C1, mreal C2)
void XRange (const mglData &a, bool add=false, mreal fact=0)
 Safety set values of mglGraph::Min.x and mglGraph::Max.x as minimal and maximal values of data a.
void YRange (const mglData &a, bool add=false, mreal fact=0)
 Safety set values of mglGraph::Min.x and mglGraph::Max.x as minimal and maximal values of data a.
void ZRange (const mglData &a, bool add=false, mreal fact=0)
 Safety set values of mglGraph::Min.x and mglGraph::Max.x as minimal and maximal values of data a.
void SetRanges (mreal x1, mreal x2, mreal y1, mreal y2, mreal z1=0, mreal z2=0)
 Safetely set values of mglGraph::Min and mglGraph::Max.
void SetAutoRanges (mreal x1, mreal x2, mreal y1=0, mreal y2=0, mreal z1=0, mreal z2=0)
 Set ranges for automatic variables.
void CAxis (mreal C1, mreal C2)
 Safetly set the values of mglGraph::Cmin and mglGraph::Cmax.
void SetOrigin (mreal x0, mreal y0, mreal z0=NAN)
 Set axis origin.
void Axis (mglPoint Min, mglPoint Max, mglPoint Org=mglPoint(NAN, NAN, NAN))
 Safetly set the value for mglGraph::Min, mglGraph::Max and mglGraph::Org members of the class.
void Axis (const char *dir="xyzt", bool adjust=false)
 Draw axises with ticks in directions determined by string parameter dir.
void SetFunc (const char *EqX, const char *EqY, const char *EqZ=0, const char *EqA=0)
 Safetly set the transformation formulas for coordinate.
void SetCoor (int how)
 Set the predefined transformation rules.
void CutOff (const char *EqCut)
 Safetly set the cutting off condition (formula).
void Ternary (bool tern)
 Set to draw Ternary axis (triangle like axis, grid and so on)
void RecalcBorder ()
 Recalculate internal parameter for correct applies transformation rules. Must be called after any direct changes of members mglGraph::Min, mglGraph::Max, mglGraph::fx, mglGraph::fy, mglGraph::fz.
void Grid (const char *dir="xyz", const char *pen="B-")
 Draw grid lines perpendicular to direction determined by string parameter dir.
void Label (char dir, const char *text, mreal pos=+1, mreal size=-1.4, mreal shift=0)
 Print the label text for axis dir.
void Label (mreal x, mreal y, const char *text, const char *fnt=0, mreal size=-1.4, bool rel=false)
 Print the text at arbitrary position of the picture x, y in range [0,1]x[0,1].
void Labelw (mreal x, mreal y, const wchar_t *text, const char *fnt=0, mreal size=-1.4, bool rel=false)
void Labelw (char dir, const wchar_t *text, mreal pos=+1, mreal size=-1.4, mreal shift=0)
 Print the label text for axis dir.
void Colorbar (const char *sch=0, int where=0)
 Draw colorbar at edge of axis.
void Colorbar (const char *sch, int where, mreal x, mreal y, mreal w, mreal h)
void Colorbar (int where, mreal x, mreal y, mreal w, mreal h)
void Colorbar (const mglData &v, const char *sch=0, int where=0)
 Draw colorbar at edge of axis.
void Colorbar (const mglData &v, const char *sch, int where, mreal x, mreal y, mreal w, mreal h)
2D plotting functions

These functions perform plotting of 2D data. 2D means that data depend from 2 independent parameters like matrix f(x_i,y_j), i=1...n, j=1...m. There are 6 generally different types of data representations: simple mesh lines plot (Mesh), surface plot (Surf), surface plot by boxes (Boxs), density plot (Dens), contour lines plot (Cont, ContF, ContD) and its rotational figure (Axial). Cont, ContF, ContD and Axial functions have variants for automatic and manual selection of level values for contours. Also there are functions for plotting data grid lines according to the data format (Grid) for enhancing density or contour plots. Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of colouring are specified by the string argument (see mglGraph::SetScheme).

void Grid (const mglData &x, const mglData &y, const mglData &z, const char *stl=0, mreal zVal=NAN)
 Draw grid lines for density plot of 2d data specified parametrically.
void Grid (const mglData &a, const char *stl=0, mreal zVal=NAN)
 Draw grid lines for density plot of 2d data.
void Surf (const char *eqZ, const char *sch=0, int n=0)
 Draw curve for formula with x,y in range [Min, Max].
void Surf (const char *eqX, const char *eqY, const char *eqZ, const char *sch=0, int n=0)
 Draw curve for formulas parametrically depended on u,v in range [0,1].
void Surf (const mglData &x, const mglData &y, const mglData &z, const char *sch=0)
 Draw surface for 2d data specified parametrically.
void Surf (const mglData &z, const char *sch=0)
 Draw surface for 2d data.
void Crust (const mglData &x, const mglData &y, const mglData &z, const char *sch=0, mreal er=0)
 Draw power crust for points in arrays x, y, z.
void Crust (const mglData &tr, const char *sch=0, mreal er=0)
 Draw power crust for points in arrays tr.
void Dots (const mglData &x, const mglData &y, const mglData &z, const char *sch=0)
 Draw dots in points x, y, z.
void Dots (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch=0, mreal alpha=1)
 Draw half-transparent dots in points x, y, z.
void Dots (const mglData &tr, const char *sch=0)
 Draw dots in points tr.
void TriPlot (const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *sch=0)
 Draw triangle mesh for points in arrays x, y, z with specified color c.
void TriPlot (const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const char *sch=0)
 Draw triangle mesh for points in arrays x, y, z.
void TriPlot (const mglData &nums, const mglData &x, const mglData &y, const char *sch=0, mreal zVal=NAN)
 Draw triangle mesh for points in arrays x, y.
void Mesh (const mglData &x, const mglData &y, const mglData &z, const char *sch=0)
 Draw mesh lines for 2d data specified parametrically.
void Mesh (const mglData &z, const char *sch=0)
 Draw mesh lines for 2d data.
void Fall (const mglData &x, const mglData &y, const mglData &z, const char *sch=0)
 Draw mesh lines for 2d data specified parametrically.
void Fall (const mglData &z, const char *sch=0)
 Draw mesh lines for 2d data.
void Belt (const mglData &x, const mglData &y, const mglData &z, const char *sch=0)
 Draw belts for 2d data specified parametrically.
void Belt (const mglData &z, const char *sch=0)
 Draw belts for 2d data.
void Dens (const mglData &x, const mglData &y, const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw density plot for surface specified parametrically.
void Dens (const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw density plot for 2d data.
void STFA (const mglData &x, const mglData &y, const mglData &re, const mglData &im, int dn, const char *sch=0, mreal zVal=NAN)
 Draw density plot for spectra-gramm specified parametrically.
void STFA (const mglData &re, const mglData &im, int dn, const char *sch=0, mreal zVal=NAN)
 Draw density plot for spectra-gramm.
void Boxs (const mglData &x, const mglData &y, const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw vertical boxes for 2d data specified parametrically.
void Boxs (const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw vertical boxes for 2d data.
void Tile (const mglData &x, const mglData &y, const mglData &z, const char *sch=0)
 Draw vertical tiles for 2d data specified parametrically.
void Tile (const mglData &z, const char *sch=0)
 Draw vertical tiles for 2d data.
void Cont (const mglData &v, const mglData &x, const mglData &y, const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw contour lines for 2d data specified parametrically.
void Cont (const mglData &v, const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw contour lines for 2d data.
void Cont (const mglData &x, const mglData &y, const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN)
 Draw several contour lines for 2d data specified parametrically.
void Cont (const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN)
 Draw several contour lines for 2d data.
void Axial (const mglData &v, const mglData &x, const mglData &y, const mglData &a, const char *sch=0)
 Draw axial-symmetric isosurfaces for 2d data specified parametrically.
void Axial (const mglData &v, const mglData &a, const char *sch=0)
 Draw axial-symmetric isosurfaces for 2d data.
void Axial (const mglData &x, const mglData &y, const mglData &a, const char *sch=0, int Num=3)
 Draw several axial-symmetric isosurfaces for 2d data specified parametrically.
void Axial (const mglData &a, const char *sch=0, int Num=3)
 Draw several axial-symmetric isosurfaces for 2d data.
void ContF (const mglData &v, const mglData &x, const mglData &y, const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw solid contours for 2d data specified parametrically.
void ContF (const mglData &v, const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw solid contours for 2d data.
void ContF (const mglData &x, const mglData &y, const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN)
 Draw several solid contours for 2d data specified parametrically.
void ContF (const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN)
 Draw several solid contours for 2d data.
void ContD (const mglData &v, const mglData &x, const mglData &y, const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw solid contours for 2d data specified parametrically with manual colors.
void ContD (const mglData &v, const mglData &z, const char *sch=0, mreal zVal=NAN)
 Draw solid contours for 2d data with manual colors.
void ContD (const mglData &x, const mglData &y, const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN)
 Draw several solid contours for 2d data specified parametrically with manual colors.
void ContD (const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN)
 Draw several solid contours for 2d data with manual colors.
Primitive functions

These functions draw the simplest primitives, like line, point, sphere, drop, cone and so on.

void Ball (mglPoint p, char col='r')
 Draws the point (ball) at position p with color col.
void Error (mglPoint p, mglPoint e, const char *pen=0)
 Draws the 3d error box e for point p.
void Line (mglPoint p1, mglPoint p2, const char *stl="B", int num=2)
 Draws the line between points with style stl.
void Curve (mglPoint p1, mglPoint d1, mglPoint p2, mglPoint d2, const char *stl="B", int num=100)
 Draws the spline curve between points with style stl.
void Face (mglPoint p1, mglPoint p2, mglPoint p3, mglPoint p4, const char *stl="w", int num=2, mreal val=NAN)
 Draws the face between points with color stl (include interpolation up to 4 colors).
void FaceX (mreal x0, mreal y0, mreal z0, mreal wy, mreal wz, const char *stl="w", mreal dx=0, mreal dy=0)
void FaceY (mreal x0, mreal y0, mreal z0, mreal wx, mreal wz, const char *stl="w", mreal dx=0, mreal dy=0)
void FaceZ (mreal x0, mreal y0, mreal z0, mreal wx, mreal wy, const char *stl="w", mreal dx=0, mreal dy=0)
void Sphere (mglPoint p, mreal r, const char *stl="r")
 Draws the sphere at point p with color stl and radius r.
void Ellipse (mglPoint p, mglPoint r, const char *stl="r")
 Draws the ellipsoid at point p with color stl and radiuses r.
void Drop (mglPoint p, mglPoint q, mreal r, const char *stl="r", mreal shift=1, mreal ap=1)
 Draws the drop at point p in direction q with color stl and radius r.
void Drop (mglPoint p, mglPoint q, mreal r, mglColor c, mreal shift=1, mreal ap=1)
 Draws the drop at point p in direction q with color stl and radius r.
void Cone (mglPoint p1, mglPoint p2, mreal r1, mreal r2=-1, const char *stl="B", bool edge=false)
 Draws the line between points with style stl.
void Mark (mglPoint p, char mark='.')
 draw mark with different type at position {x,y,z} (no scaling)
1D plotting functions

These functions perform plotting of 1D data. 1D means that data depended from only 1 parameter like parametric curve {x(i),y(i),z(i)}, i=1...n. There are 5 generally different types of data representations: simple line plot (Plot), line plot with filling under it (Area), stairs plot (Step), bar plot (Bars,Barh) and vertical lines (Stem). Each type of plotting has similar interface. There are 3D version and two 2D versions. One of last requires only one array. The parameters of line and marks are specified by the string argument (see mglGraph::SelectPen). If the string parameter is NULL then solid line with color from palette is used.

void Error (const mglData &y, const mglData &ey, const char *pen=0, mreal zVal=NAN)
 Draw error boxes ey for data y.
void Error (const mglData &x, const mglData &y, const mglData &ey, const char *pen=0, mreal zVal=NAN)
 Draw error boxes ey for data {x,y}.
void Error (const mglData &x, const mglData &y, const mglData &ex, const mglData &ey, const char *pen=0, mreal zVal=NAN)
 Draw error boxes {ex,ey} for data {x,y}.
void Mark (const mglData &x, const mglData &y, const mglData &z, const mglData &r, const char *pen=0)
 Draw marks with diffenernt sizes r for points in arrays x, y, z.
void Mark (const mglData &x, const mglData &y, const mglData &r, const char *pen=0, mreal zVal=NAN)
 Draw marks with diffenernt sizes r for points in arrays x, y.
void Mark (const mglData &y, const mglData &r, const char *pen=0, mreal zVal=NAN)
 Draw marks with diffenernt sizes r for points in arrays y.
void Plot (const char *eqY, const char *pen=0, mreal zVal=NAN, int n=0)
 Draw curve for formula with x in range [Min.x, Max.x].
void Plot (const char *eqX, const char *eqY, const char *eqZ, const char *pen=0, int n=0)
 Draw curve for formulas parametrically depended on t in range [0,1].
void Plot (const mglData &x, const mglData &y, const mglData &z, const char *pen=0)
 Draw line plot for points in arrays x, y, z.
void Plot (const mglData &x, const mglData &y, const char *pen=0, mreal zVal=NAN)
 Draw line plot for points in arrays x, y.
void Plot (const mglData &y, const char *pen=0, mreal zVal=NAN)
 Draw line plot for points in arrays y.
void Radar (const mglData &a, const char *stl=0, mreal r=-1)
 Draw radar chart (plot in curved coordinates)
void BoxPlot (const mglData &x, const mglData &a, const char *stl=0, mreal zVal=NAN)
void BoxPlot (const mglData &a, const char *stl=0, mreal zVal=NAN)
void Tens (const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *pen=0)
 Draw line plot for points in arrays x, y, z which is colored by c (like tension plot). Parameter pen set color scheme and line styles (dashing and width).
void Tens (const mglData &x, const mglData &y, const mglData &c, const char *pen=0, mreal zVal=NAN)
 Draw line plot for points in arrays x, y.
void Tens (const mglData &y, const mglData &c, const char *pen=0, mreal zVal=NAN)
 Draw line plot for points in arrays y.
void Region (const mglData &y1, const mglData &y2, const char *pen=0, mreal zVal=NAN, bool inside=true)
 Fill area between curves y1 and y2 (if inside=false) or area for y1<=y<=y2 (if inside=true).
void Region (const mglData &x, const mglData &y1, const mglData &y2, const char *pen=0, mreal zVal=NAN, bool inside=true)
 Fill area between curves y1 and y2 (if inside=false) or area for y1<=y<=y2 (if inside=true) for parametrically specified points.
void Area (const mglData &x, const mglData &y, const mglData &z, const char *pen=0)
 Draw area plot for points in arrays x, y, z.
void Area (const mglData &x, const mglData &y, const char *pen=0, bool sum=false, mreal zVal=NAN)
 Draw area plot for points in arrays x, y.
void Area (const mglData &y, const char *pen=0, bool sum=false, mreal zVal=NAN)
 Draw area plot for points in arrays y.
void Stem (const mglData &x, const mglData &y, const mglData &z, const char *pen=0)
 Draw vertical lines from points in arrays x, y, z to mglGraph::Org.
void Stem (const mglData &x, const mglData &y, const char *pen=0, mreal zVal=NAN)
 Draw vertical lines from points in arrays x, y to mglGraph::Org.
void Stem (const mglData &y, const char *pen=0, mreal zVal=NAN)
 Draw vertical lines from points in arrays y to mglGraph::Org.
void Step (const mglData &x, const mglData &y, const mglData &z, const char *pen=0)
 Draw stairs for points in arrays x, y, z.
void Step (const mglData &x, const mglData &y, const char *pen=0, mreal zVal=NAN)
 Draw stairs for points in arrays x, y.
void Step (const mglData &y, const char *pen=0, mreal zVal=NAN)
 Draw line plot for points in arrays y.
void Bars (const mglData &x, const mglData &y, const mglData &z, const char *pen=0, bool above=false)
 Draw vertical bars from points in arrays x, y, z to mglGraph::Org.
void Bars (const mglData &x, const mglData &y, const char *pen=0, mreal zVal=NAN, bool above=false)
 Draw vertical bars from points in arrays x, y to mglGraph::Org.
void Bars (const mglData &y, const char *pen=0, mreal zVal=NAN, bool above=false)
 Draw vertical bars from points in arrays y to mglGraph::Org.
void Barh (const mglData &y, const mglData &v, const char *pen=0, mreal zVal=NAN, bool above=false)
 Draw vertical bars from points in arrays x, y to mglGraph::Org.
void Barh (const mglData &v, const char *pen=0, mreal zVal=NAN, bool above=false)
 Draw vertical bars from points in arrays y to mglGraph::Org.
void Torus (const mglData &r, const mglData &z, const char *pen=0)
 Draw surface of curve {r,z} rotatation around Z axis.
void Torus (const mglData &z, const char *pen=0)
 Draw surface of curve rotatation around Z axis.
void Chart (const mglData &a, const char *col=0)
 Draw chart for data a.
void TextMark (const mglData &x, const mglData &y, const mglData &z, const mglData &r, const char *text, const char *fnt=0)
 Draw textual marks with diffenernt sizes r for points in arrays x, y, z.
void TextMark (const mglData &x, const mglData &y, const mglData &r, const char *text, const char *fnt=0, mreal zVal=NAN)
 Draw textual marks with diffenernt sizes r for points in arrays x, y.
void TextMark (const mglData &y, const mglData &r, const char *text, const char *fnt=0, mreal zVal=NAN)
 Draw textual marks with diffenernt sizes r for points in arrays y.
void TextMark (const mglData &x, const mglData &y, const mglData &z, const mglData &r, const wchar_t *text, const char *fnt=0)
 Draw textual marks with diffenernt sizes r for points in arrays x, y, z.
void TextMark (const mglData &x, const mglData &y, const mglData &r, const wchar_t *text, const char *fnt=0, mreal zVal=NAN)
 Draw textual marks with diffenernt sizes r for points in arrays x, y.
void TextMark (const mglData &y, const mglData &r, const wchar_t *text, const char *fnt=0, mreal zVal=NAN)
 Draw textual marks with diffenernt sizes r for points in arrays y.
void TextMark (const mglData &y, const char *text, const char *fnt=0, mreal zVal=NAN)
 Draw textual marks with diffenernt sizes r for points in arrays y.
void TextMark (const mglData &y, const wchar_t *text, const char *fnt=0, mreal zVal=NAN)
 Draw textual marks with diffenernt sizes r for points in arrays y.
void Tube (const mglData &x, const mglData &y, const mglData &z, const mglData &r, const char *pen=0)
 Draw tube with radial sizes r for points in arrays x, y, z.
void Tube (const mglData &x, const mglData &y, const mglData &r, const char *pen=0, mreal zVal=NAN)
 Draw tube with radial sizes r for points in arrays x, y.
void Tube (const mglData &y, const mglData &r, const char *pen=0, mreal zVal=NAN)
 Draw tube with radial sizes r for points in arrays y.
void Tube (const mglData &x, const mglData &y, const mglData &z, mreal r, const char *pen=0)
 Draw tube with constant radial sizes r for points in arrays x, y, z.
void Tube (const mglData &x, const mglData &y, mreal r, const char *pen=0, mreal zVal=NAN)
 Draw tube with constant radial sizes r for points in arrays x, y.
void Tube (const mglData &y, mreal r, const char *pen=0, mreal zVal=NAN)
 Draw tube with constant radial sizes r for points in arrays y.
void Plot2 (const mglData &a, const char *pen=0, mreal zVal=NAN)
 Draw line plot for points in arrays a(0,:),a(1,:).
void Plot3 (const mglData &a, const char *pen=0)
 Draw line plot for points in arrays a(0,:),a(1,:),a(2,:).
void Area2 (const mglData &a, const char *pen=0, mreal zVal=NAN)
 Draw area plot for points in arrays a(0,:),a(1,:).
void Area3 (const mglData &a, const char *pen=0)
 Draw area plot for points in arrays a(0,:),a(1,:),a(2,:).
void Bars2 (const mglData &a, const char *pen=0, mreal zVal=NAN, bool above=false)
 Draw vertical bars from points in arrays a(0,:),a(1,:) to mglGraph::Org.
void Bars3 (const mglData &a, const char *pen=0, bool above=false)
 Draw vertical bars from points in arrays a(0,:),a(1,:),a(2,:) to mglGraph::Org.
void Stem2 (const mglData &a, const char *pen=0, mreal zVal=NAN)
 Draw vertical lines from points in arrays a(0,:),a(1,:) to mglGraph::Org.
void Stem3 (const mglData &a, const char *pen=0)
 Draw vertical lines from points in arrays a(0,:),a(1,:),a(2,:) to mglGraph::Org.
void Step2 (const mglData &a, const char *pen=0, mreal zVal=NAN)
 Draw stairs for points in arrays a(0,:),a(1,:).
void Step3 (const mglData &a, const char *pen=0)
 Draw stairs for points in arrays a(0,:),a(1,:),a(2,:).
void Torus2 (const mglData &a, const char *pen=0)
 Draw surface of curve {a(0,:),a(1,:)} rotatation around Z axis for.
Histogram functions

These functions make histogram (distribution) of data. This functions do not draw obtained curve itself.

void Hist (mglData &res, const mglData &x, const mglData &a)
void Hist (mglData &res, const mglData &x, const mglData &y, const mglData &a)
void Hist (mglData &res, const mglData &x, const mglData &y, const mglData &z, const mglData &a)
Fitting functions

These functions fit data to formula (find formula parameters for best fitting the data points). This functions do not draw obtained curve itself.

mreal Fit (mglData &fit, const mglData &y, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data along x-direction for each data row. Data 'fit' will contain values for found formula.
mreal Fit (mglData &fit, const mglData &y, const char *eq, const char *var, mglData &ini, bool print=false)
mreal Fit (mglData &fit, const mglData &x, const mglData &y, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data along x-direction for each data row. Data 'fit' will contain values for found formula.
mreal Fit (mglData &fit, const mglData &x, const mglData &y, const char *eq, const char *var, mglData &ini, bool print=false)
mreal Fit (mglData &fit, const mglData &x, const mglData &y, const mglData &z, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data along x-,y-directions for each data slice. Data 'fit' will contain values for found formula.
mreal Fit (mglData &fit, const mglData &x, const mglData &y, const mglData &z, const char *eq, const char *var, mglData &ini, bool print=false)
mreal Fit (mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data along all directions. Data 'fit' will contain values for found formula.
mreal Fit (mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *eq, const char *var, mglData &ini, bool print=false)
mreal Fit2 (mglData &fit, const mglData &z, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data along x-,y-directions for each data slice. Data 'fit' will contain values for found formula.
mreal Fit2 (mglData &fit, const mglData &z, const char *eq, const char *var, mglData &ini, bool print=false)
mreal Fit3 (mglData &fit, const mglData &a, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data along all directions. Data 'fit' will contain values for found formula.
mreal Fit3 (mglData &fit, const mglData &a, const char *eq, const char *var, mglData &ini, bool print=false)
mreal FitS (mglData &fit, const mglData &y, const mglData &s, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data with dispersion s along x-direction for each data row. Data 'fit' will contain values for found formula.
mreal FitS (mglData &fit, const mglData &y, const mglData &s, const char *eq, const char *var, mglData &ini, bool print=false)
mreal FitS (mglData &fit, const mglData &x, const mglData &y, const mglData &s, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data with dispersion s along x-direction for each data row. Data 'fit' will contain values for found formula.
mreal FitS (mglData &fit, const mglData &x, const mglData &y, const mglData &s, const char *eq, const char *var, mglData &ini, bool print=false)
mreal FitS (mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &s, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data with dispersion s along x-,y-directions for each data slice. Data 'fit' will contain values for found formula.
mreal FitS (mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &s, const char *eq, const char *var, mglData &ini, bool print=false)
mreal FitS (mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &s, const char *eq, const char *var, mreal *ini=0, bool print=false)
 Fit data with dispersion s along all directions. Data 'fit' will contain values for found formula.
mreal FitS (mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &s, const char *eq, const char *var, mglData &ini, bool print=false)
void PutsFit (mglPoint p, const char *prefix=0, const char *font=0, mreal size=-1)
 Print fitted last formula (with coefficients)
const char * GetFit ()
 Get last fitted formula.
Text functions

Text functions draw the text. There is a function for drawing text in arbitrary place, in arbitrary direction and along arbitrary curve. The font style for text is specified by string argument. The size argument control the size of text: if positive it give the value if negative it give the value relative to FontSize. The font type (STIX, arial, courier, times and so on) can be selected by function SetFont(), GetFont().

void SetFontSizeCM (mreal cm, int dpi=72)
 Set FontSize by size in centimeters and picture DPI (default is 0.56 cm = 16 pt)
void SetFontSizeIN (mreal in, int dpi=72)
 Set FontSize by size in inch and picture DPI (default is 0.22 in = 16 pt)
void SetFont (mglFont *f)
 Set font typeface. Note that each mglFont instance can be used with ONLY ONE mglGraph instance at a moment of time!
mglFontGetFont ()
 Get current typeface. Note that this variable can be deleted at next SetFont() call!
void RestoreFont ()
 Restore font.
void LoadFont (const char *name, const char *path=NULL)
 Load font from file.
void CopyFont (mglGraph *gr)
 Copy font from another mglGraph instance.
void SetFontSize (mreal val)
 Set default font size.
void SetRotatedText (bool val)
 Set to use or not text rotation.
void SetFontDef (const char *fnt)
 Set default font style and color.
void Puts (mglPoint p, const char *text, const char *font=0, mreal size=-1, char dir=0, mreal shift=0)
 Print string str in position p with font size size.
mreal Puts (mglPoint p, mglPoint l, const char *text, char font='t', mreal size=-1)
 Print string str with font size size in position p along direction l.
void Text (mglPoint p, const char *text, const char *font=0, mreal size=-1.4, char dir=0)
 Print unrotated string str in position p with font size size.
void Text (mglPoint p, const wchar_t *text, const char *font=0, mreal size=-1.4, char dir=0)
 Print unrotated string str in position p with font size size.
void Text (const mglData &y, const char *text, const char *font=0, mreal size=-1, mreal zVal=NAN)
 Print string str along curve with font size size.
void Text (const mglData &x, const mglData &y, const char *text, const char *font=0, mreal size=-1, mreal zVal=NAN)
 Print string str along parametrical curve with font size size.
void Text (const mglData &x, const mglData &y, const mglData &z, const char *text, const char *font=0, mreal size=-1)
 Print string str along curve in 3D with font size size.
void Text (const mglData &y, const wchar_t *text, const char *font=0, mreal size=-1, mreal zVal=NAN)
 Print string str along curve with font size size.
void Text (const mglData &x, const mglData &y, const wchar_t *text, const char *font=0, mreal size=-1, mreal zVal=NAN)
 Print string str along parametrical curve with font size size.
void Text (const mglData &x, const mglData &y, const mglData &z, const wchar_t *text, const char *font=0, mreal size=-1)
 Print string str along curve in 3D with font size size.
void Title (const wchar_t *text, const char *font=0, mreal size=-2)
 Print the title text for the picture.
void Title (const char *text, const char *font=0, mreal size=-2)
void Printf (mglPoint p, const char *arg,...)
 Print formated output in position p.
Legend functions

Legend functions accumulate and draw legend strings. There is twofold legend representation in MathGL. First the string array can be drawn directly. Second the string can be accumulated in internal array (by AddLegend() function) and later drawn. The position of legend can be specified manually or by corner of plot (default is right-top).

void AddLegend (const char *text, const char *style)
 Add string to legend.
void AddLegend (const wchar_t *text, const char *style)
 Add string to legend.
void ClearLegend ()
 Clear saved legend string.
void Legend (mreal x, mreal y, const char *font="rL", mreal size=-0.8, mreal llen=0.1)
 Draw legend of accumulated strings at position (x, y) by font with size.
void Legend (int where=0x3, const char *font="rL", mreal size=-0.8, mreal llen=0.1)
 Draw legend of accumulated strings by font with size.
void Legend (int n, wchar_t **text, char **style, int where=0x3, const char *font="rL", mreal size=-0.8, mreal llen=0.1)
 Draw legend of accumulated strings by font with size.
void SetLegendBox (bool val)
 Switch on/off box around legend.
Dual plotting functions

These plotting functions draw a two (or three) matrix simultaneously in different forms (as coloring, vector field, flow chart or mapping). The color scheme is specified by the string parameter (see mglGraph::SetScheme). The array x and y can be vectors or matrices with the same size as main matrix. Also there is case when matrix is plotted along all square X*Y specified by corners mglGraph::Min -- mglGraph::Max.

void Dew (const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN)
 Plot dew drops for vector field {ax,ay} parametrically depended on coordinate {x,y}.
void Dew (const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN)
 Plot dew drops for vector field {ax,ay}.
void SurfC (const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *sch=0)
 Draw surface specified parametrically with coloring by other matrix.
void SurfC (const mglData &z, const mglData &c, const char *sch=0)
 Draw surface specified by matrix with coloring by other matrix.
void SurfA (const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *sch=0)
 Draw surface specified parametrically which transparency is determined by other matrix.
void SurfA (const mglData &z, const mglData &c, const char *sch=0)
 Draw surface specified by matrix which transparency is determined by other matrix.
void TileS (const mglData &x, const mglData &y, const mglData &z, const mglData &r, const char *sch=0)
 Draw vertical tiles with variable size for 2d data specified parametrically.
void TileS (const mglData &z, const mglData &r, const char *sch=0)
 Draw vertical tiles with variable size for 2d data.
void Traj (const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN, mreal len=0)
 Plot arrows at position {x,y} along {ax,ay} with length len and color proportional to value |a|.
void Traj (const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, mreal len=0)
 Plot arrows at position {x,y,z} along {ax,ay,az} with length len and color proportional to value |a|.
void Vect (const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN, int flag=0)
 Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with length and color proportional to value |a|.
void Vect (const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN, int flag=0)
 Plot vector field {ax,ay} with length and color proportional to value |a|.
void Vect (const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, int flag=0)
 Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with length and color proportional to value |a|.
void Vect (const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, int flag=0)
 Plot 3d vector field {ax,ay,ay} with length and color proportional to value |a|.
void VectL (const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN)
 Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with length proportional to value |a|.
void VectL (const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN)
 Plot vector field {ax,ay} with length proportional to value |a|.
void VectL (const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0)
 Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with length proportional to value |a|.
void VectL (const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0)
 Plot 3d vector field {ax,ay,ay} with length proportional to value |a|.
void VectC (const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN)
 Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a|.
void VectC (const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN)
 Plot vector field {ax,ay} with color proportional to value |a|.
void VectC (const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0)
 Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a|.
void VectC (const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0)
 Plot 3d vector field {ax,ay,ay} with color proportional to value |a|.
void Map (const mglData &x, const mglData &y, const mglData &a, const mglData &b, const char *sch=0, int ks=0, bool pnts=true)
 Color map of matrix a to matrix b, both matrix parametrically depend on coordinates.
void Map (const mglData &a, const mglData &b, const char *sch=0, int ks=0, bool pnts=true)
 Color map of matrix a to matrix b.
void Surf3A (mreal Val, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *stl=0)
 Draw isosurface for 3d data a specified parametrically with alpha proportional to b.
void Surf3A (mreal Val, const mglData &a, const mglData &b, const char *stl=0)
 Draw isosurface for 3d data a with alpha proportional to b.
void Surf3A (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *stl=0, int num=3)
 Draw several isosurface for 3d data a specified parametrically with alpha proportional to b.
void Surf3A (const mglData &a, const mglData &b, const char *stl=0, int num=3)
 Draw several isosurface for 3d data a with alpha proportional to b.
void Surf3C (mreal Val, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *stl=0)
 Draw isosurface for 3d data a specified parametrically with color proportional to b.
void Surf3C (mreal Val, const mglData &a, const mglData &b, const char *stl=0)
 Draw isosurface for 3d data a with color proportional to b.
void Surf3C (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *stl=0, int num=3)
 Draw several isosurface for 3d data a specified parametrically with color proportional to b.
void Surf3C (const mglData &a, const mglData &b, const char *stl=0, int num=3)
 Draw several isosurface for 3d data a with color proportional to b.
void Flow (const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, int num=5, bool central=true, mreal zVal=NAN)
 Plot flows for vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a|.
void Flow (const mglData &ax, const mglData &ay, const char *sch=0, int num=5, bool central=true, mreal zVal=NAN)
 Plot flows for vector field {ax,ay} with color proportional to value |a|.
void Flow (const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, int num=3, bool central=true)
 Plot flows for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a|.
void Flow (const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, int num=3, bool central=true)
 Plot flows for 3d vector field {ax,ay,ay} with color proportional to value |a|.
void FlowP (mglPoint p0, const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0)
 Draw flow from point p.
void FlowP (mglPoint p0, const mglData &ax, const mglData &ay, const char *sch=0)
void FlowP (mglPoint p0, const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0)
void FlowP (mglPoint p0, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0)
void Pipe (const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, mreal r0=0.05, int num=5, bool central=true, mreal zVal=NAN)
 Plot flow pipes for vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a|.
void Pipe (const mglData &ax, const mglData &ay, const char *sch=0, mreal r0=0.05, int num=5, bool central=true, mreal zVal=NAN)
 Plot flow pipes for vector field {ax,ay} with color proportional to value |a|.
void Pipe (const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, mreal r0=0.05, int num=3, bool central=true)
 Plot flow pipes for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a|.
void Pipe (const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, mreal r0=0.05, int num=3, bool central=true)
 Plot flow pipes for 3d vector field {ax,ay,ay} with color proportional to value |a|.
3D plotting functions

3D plotting functions draw a 3-ranged tensor in different forms. There are the using of slices, isosurfaces (surfaces of constant amplitude) or volume intransparency like clouds. The color scheme is specified by the string parameter (see mglGraph::SetScheme). The array x, y and z can be vectors or matrixes with the same size as main matrix. Also there is case when matrix is plotted along all square X*Y*Z specified by corners mglGraph::Min -- mglGraph::Max.

void Grid3 (const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *stl=0)
 Draw grid lines for density plot at slice for 3d data specified parametrically.
void Grid3 (const mglData &a, char dir, int sVal=-1, const char *stl=0)
 Draw grid lines for density plot at slice for 3d data.
void GridA (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0)
 Draw grid lines for density plot at central slices for 3d data specified parametrically.
void GridA (const mglData &a, const char *stl=0)
 Draw grid lines for density plot at central slices for 3d data.
void Dens3 (const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *stl=0)
 Draw density plot at slice for 3d data specified parametrically.
void Dens3 (const mglData &a, char dir, int sVal=-1, const char *stl=0)
 Draw density plot at slice for 3d data.
void DensA (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0)
 Draw density plot at central slices for 3d data specified parametrically.
void DensA (const mglData &a, const char *stl=0)
 Draw density plot at central slices for 3d data.
void Surf3 (mreal Val, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0)
 Draw isosurface for 3d data specified parametrically.
void Surf3 (mreal Val, const mglData &a, const char *stl=0)
 Draw isosurface for 3d data.
void Surf3 (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0, int num=3)
 Draw several isosurfaces for 3d data specified parametrically.
void Surf3 (const mglData &a, const char *stl=0, int num=3)
 Draw several isosurface for 3d data.
void Beam (const mglData &tr, const mglData &g1, const mglData &g2, const mglData &a, mreal r, const char *stl=0, int flag=0, int num=3)
 Draw several isosurfaces for 3d beam in curvilinear coordinates.
void Beam (mreal val, const mglData &tr, const mglData &g1, const mglData &g2, const mglData &a, mreal r, const char *stl=0, int flag=0)
 Draw isosurface for 3d beam in curvilinear coordinates.
void Cont3 (const mglData &v, const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *sch=0)
 Draw contour lines at slice for 3d data specified parametrically.
void Cont3 (const mglData &v, const mglData &a, char dir, int sVal=-1, const char *sch=0)
 Draw contour lines at slice for 3d data.
void Cont3 (const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *sch=0, int Num=7)
 Draw several contour lines at slice for 3d data specified parametrically.
void Cont3 (const mglData &a, char dir, int sVal=-1, const char *sch=0, int Num=7)
 Draw several contour lines at slice for 3d data.
void ContA (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch=0, int Num=7)
 Draw contour lines at central slices for 3d data specified parametrically.
void ContA (const mglData &a, const char *sch=0, int Num=7)
 Draw contour lines at central slices for 3d data.
void ContF3 (const mglData &v, const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *sch=0)
 Draw solid contours at slice for 3d data specified parametrically.
void ContF3 (const mglData &v, const mglData &a, char dir, int sVal=-1, const char *sch=0)
 Draw solid contours at slice for 3d data.
void ContF3 (const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *sch=0, int Num=7)
 Draw several solid contours at slice for 3d data specified parametrically.
void ContF3 (const mglData &a, char dir, int sVal=-1, const char *sch=0, int Num=7)
 Draw several solid contours at slice for 3d data.
void ContFA (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch=0, int Num=7)
 Draw solid contours at central slices for 3d data specified parametrically.
void ContFA (const mglData &a, const char *sch=0, int Num=7)
 Draw solid contours at central slices for 3d data.
void CloudP (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0, mreal alpha=1, bool rnd=true)
 Draw a cloud of points for 3d data specified parametrically.
void CloudP (const mglData &a, const char *stl=0, mreal alpha=1, bool rnd=true)
 Draw a cloud of points for 3d data.
void Cloud (const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0, mreal alpha=1)
 Draw a semi-transparent cloud for 3d data specified parametrically.
void Cloud (const mglData &a, const char *stl=0, mreal alpha=1)
 Draw a semi-transparent cloud for 3d data.
Combined plotting functions

These plotting functions draw density plot or contour lines in x, y, or z plain. If a is a tensor (3-dimensional data) then interpolation to a given sVal is performed.

void DensX (const mglData &a, const char *stl=0, mreal sVal=NAN)
 Draw density plot for data a at x = sVal.
void DensY (const mglData &a, const char *stl=0, mreal sVal=NAN)
 Draw density plot for data a at y = sVal.
void DensZ (const mglData &a, const char *stl=0, mreal sVal=NAN)
 Draw density plot for data a at z = sVal.
void ContX (const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7)
 Draw several contour plots for data a at x = sVal.
void ContX (const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN)
 Draw contour plots for data a at x = sVal.
void ContY (const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7)
 Draw several contour plots for data a at y = sVal.
void ContY (const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN)
 Draw contour plots for data a at y = sVal.
void ContZ (const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7)
 Draw several contour plots for data a at z = sVal.
void ContZ (const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN)
 Draw contour plots for data a at z = sVal.
void ContFX (const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7)
 Draw several contour plots for data a at x = sVal.
void ContFX (const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN)
 Draw contour plots for data a at x = sVal.
void ContFY (const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7)
 Draw several contour plots for data a at y = sVal.
void ContFY (const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN)
 Draw contour plots for data a at y = sVal.
void ContFZ (const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7)
 Draw several contour plots for data a at z = sVal.
void ContFZ (const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN)
 Draw contour plots for data a at z = sVal.
IDTF specific functions

These functions are useful only in IDTF mode VertexColor enables smooth color change. Compression gives smaller files, but quality degrades. Unrotate reverses the current space transform before saving, in an attempt to make MathGl axes similar to Adobe Reader axes It makes positioning cameras and crossections easier Groups contain objects and other groups, they are used to select a part of a model to zoom to / make invizible / make transparent / etc.

virtual void DoubleSided (bool enable)
virtual void VertexColor (bool enable)
virtual void TextureColor (bool enable)
virtual void Compression (bool enable)
virtual void Unrotate (bool enable)
virtual void BallIsPoint (bool enable)
virtual void StartGroup (const char *name)
void StartGroup (const char *name, int id)
virtual void StartAutoGroup (const char *name)
virtual void EndGroup ()

Public Attributes

mreal AlphaDef
 Default value of alpha channel (transparency) for all plotting functions.
mreal ArrowSize
 The size of arrows.
bool AutoOrg
 Shift Org automatically if it lye outside Min ... Max range.
bool AutoPlotFactor
 Enable autochange PlotFactor.
char AxialDir
 Direction of rotation for Axial() and Torus().
mreal BarWidth
 Relative width of rectangles in mglGraph::Bars().
mreal BaseLineWidth
 Base line width (as factor). Useful for LARGE bitmap plots.
int CirclePnts
 Number of points for a circle drawing (used in Tube(), Drop(), Sphere(), Cone())
mreal Cmax
 Maximal value for data coloring.
mreal Cmin
 Minimal value for data coloring.
bool Cut
 Flag which determines how points outside bounding box are drown.
mglPoint CutMax
mglPoint CutMin
 Lower edge of bounding box for cut off.
mreal dc
 Step for colorbar mark (if positive) or its number (if negative).
bool DrawFace
 Switch on/off face drawing (for faster plot rotation, redrawing and so on)
mreal dx
 Step for axis mark (if positive) or its number (if negative) in x direction.
mreal dy
 Step for axis mark (if positive) or its number (if negative) in y direction.
mreal dz
 Step for axis mark (if positive) or its number (if negative) in z direction.
mglFormulafa
 Transformation formula for coloring.
mreal FactorPos
 Position of axis ticks factor (0 at Min, 1 at Max, 1.1 is default)
mglFormulafc
 Cutting off condition (formula).
int FitPnts
 Number of output points in fitting.
char FontDef [32]
 Font specification (see mglGraph::Puts). Default is Roman with align at center.
mreal FontSize
 The size of font for tick and axis labels.
mglFormulafx
 Transformation formula for x direction.
mglFormulafy
 Transformation formula for y direction.
mglFormulafz
 Transformation formula for z direction.
int GridPnts
 Number of points for grid lines.
bool LegendBox
 Set on/off drawing legend box.
mreal MarkSize
 The size of marks for 1D plots.
mglPoint Max
 Upper edge of bounding box for graphics.
int MeshNum
 Set approximate number of lines in mglGraph::Mesh and mglGraph::Grid. By default (=0) it draw all lines.
char * Message
 Buffer for receiving messages.
mglPoint Min
 Lower edge of bounding box for graphics.
mreal NSx
 Number of axis submarks in x direction.
mreal NSy
 Number of axis submarks in y direction.
mreal NSz
 Number of axis submarks in z direction.
int NumPal
 Number of colors in palette.
int ObjId
 object id for mglPrim
int * OI
 ObjId arrays.
mglPoint Org
 Center of axis cross section.
mreal OrgC
 Starting point for colorbar ticks.
mglPoint OrgT
 Point of starting ticks numbering (if NAN then Org is used).
mglColor Pal [101]
 Color palette for 1D plotting.
mreal PlotFactor
 Factor for sizing overall plot (should be >1.5, default is =1.55)
const char * PlotId
 Id of plot for saving filename (in GLUT window for example)
bool RotatedText
 Use text rotation along axis.
bool Transparent
 Flag which temporaly switch on/off transparency for plot.
int TranspType
 Type of transparency (no full support in OpenGL mode).
int TuneTicks
 Draw tuned ticks with extracted common component.
int WarnCode
 Warning code.

Protected Member Functions

mreal _d (mreal v, mreal v1, mreal v2)
 fast linear interpolation
long add_cpoint (long &pc, mreal **p, mreal **k, bool **t, mreal x, mreal y, mreal z, mreal k1, mreal k2, bool scale)
 add point to contour line chain
virtual void arrow_plot (mreal *p1, mreal *p2, char st)
void axial_plot (long n, mreal *pp, long *nn, long np, bool wire)
 Axial-symmetric isosurface based on contour line.
virtual void ball (mreal *p, mreal *c)
 Draws the point (ball) at position p with color c.
void boxs_plot (long n, long m, mreal *pp, mglColor *cc, bool *tt, mreal Alpha, bool line)
 Boxs plot depending on positions and colors of vertexes on grid.
virtual void cloud_plot (long nx, long ny, long nz, mreal *pp, mreal *a, mreal alpha)
 Cloud plot depending on positions and alpha of vertexes on 3D grid.
unsigned char * col2int (mglColor c, mreal alpha, unsigned char *r)
 Transform mglColor and alpha value to bits format.
unsigned char * col2int (mreal *c, mreal *n, unsigned char *r)
 Transform mreal color and alpha to bits format.
void colorbar (const mglData &v, const mglColor *s, int where, mreal x, mreal y, mreal w, mreal h)
 Draw generic colorbar.
void combine (unsigned char *c1, unsigned char *c2)
 Combine colors in 2 plane.
void curv_plot (long n, mreal *pp, bool *tt)
 Plot series of consequently connected lines.
void curv_plot (long n, mreal *pp, bool *tt, long *nn)
 Plot series of arbitrary connected lines.
void curv_plot (long n, mreal *pp, mreal *cc, bool *tt)
 Plot series of consequently connected lines with color varing.
void DefColor (mglColor c, mreal alpha=-1)
 Set default color.
void DrawTick (mreal *pp, bool sub)
 Draw tick.
void FindOptOrg (mreal ax[3], mreal ay[3], mreal az[3])
mreal GetA (mreal a)
 Get alpha value depending on single variable a.
mglColor GetC (mreal z, bool scale=true)
 Get color depending on single variable z, which should be scaled if scale=true.
mglColor GetC (mreal x, mreal y, mreal z, bool simple=false)
 Get color depending on three coordinates x,y,z.
mreal GetOrgX (char dir)
 Get Org.x (parse NAN value)
mreal GetOrgY (char dir)
 Get Org.y (parse NAN value)
mreal GetOrgZ (char dir)
 Get Org.z (parse NAN value)
mglColor GetPal ()
unsigned char ** GetRGBLines (long &w, long &h, unsigned char *&f, bool solid=true)
 Get RGB(A) lines for saving in file.
void glyph_fill (mreal x, mreal y, mreal f, int nt, const short *trig, mreal *c)
void glyph_line (mreal x, mreal y, mreal f, mreal *c, bool solid)
 Draw glyph by peaces.
void glyph_wire (mreal x, mreal y, mreal f, int nl, const short *line, mreal *c)
virtual void LightScale ()
 Additionally scale positions of light sources.
virtual void line_plot (mreal *p1, mreal *p2, mreal *c1, mreal *c2, bool all=false)
 Draw line between points p1,p2 with color c1, c2 at edges.
void lines_plot (long n, mreal *pp, mreal *cc, bool *tt, bool ball)
 Plot series of unconnected lines.
virtual void mark_plot (mreal *pp, char type)
 Draw mark at position pp with style type.
void mesh_plot (long n, long m, mreal *pp, mreal *cc, bool *tt, int how)
 Mesh plot depending on positions and colors of vertexes on grid.
void NormScale (mreal *s, long n)
 Additionally scale normals s (array with length 3*n)
virtual void pnt_plot (long x, long y, mreal z, unsigned char c[4])
 Plot point p with color c.
void PostScale (mreal *p, long n)
 Additionally scale points p (array with length 3*n) for positioning in image.
virtual void quad_plot (mreal *p0, mreal *p1, mreal *p2, mreal *p3, mreal *c0, mreal *c1, mreal *c2, mreal *c3)
 Draw face of points p0,p1,p2,p3 with color c0, c1, c2, c3 at edges.
virtual void quad_plot_a (mreal *p0, mreal *p1, mreal *p2, mreal *p3, mreal a0, mreal a1, mreal a2, mreal a3, mreal alpha)
 Draw face of points p0,p1,p2,p3 with values a0, a1, a2, a3 at edges.
virtual void quad_plot_n (mreal *p0, mreal *p1, mreal *p2, mreal *p3, mreal *c0, mreal *c1, mreal *c2, mreal *c3, mreal *n0, mreal *n1, mreal *n2, mreal *n3)
 Draw face of points p0,p1,p2,p3 with color c0, c1, c2, c3 at edges.
void quads_plot (long n, mreal *pp, mreal *cc, bool *tt)
 Plot quads depending on positions and colors of vertexes on grid.
virtual bool ScalePoint (mreal &x, mreal &y, mreal &z)
 Scale coordinates of point for faster plotting also cut off some points.
void SetPal (const char *colors)
 Set Pal & NumPal.
void surf3_plot (long n, long m, long *kx1, long *kx2, long *ky1, long *ky2, long *kz, mreal *pp, mreal *cc, mreal *kk, mreal *nn, bool wire)
 Plot isosurface depending on positions and colors of vertexes on 3D grid.
void surf_plot (long n, long m, mreal *pp, mreal *cc, bool *tt)
 Surface plot depending on positions and colors of vertexes on grid.
virtual void trig_plot (mreal *p0, mreal *p1, mreal *p2, mreal *c0, mreal *c1, mreal *c2)
 Draw triangle between points p0,p1,p2 with color c0, c1, c2 at edges.
virtual void trig_plot_n (mreal *p0, mreal *p1, mreal *p2, mreal *c0, mreal *c1, mreal *c2, mreal *n0, mreal *n1, mreal *n2)
 Draw triangle between points p0,p1,p2 with color c0, c1, c2 at edges.
void trigs_plot (long n, long *nn, long m, mreal *pp, mreal *cc, bool *tt, bool wire, bool bytrig=false)
 Plot quads depending on positions and colors of vertexes on grid.
virtual void tube_plot (long n, mreal *pp, mreal *cc, mreal *rr)
 Plot tube between consequently connected lines with color and radius varing.
void vects_plot (long n, mreal *pp, mreal *cc, bool *tt)
 Plot series of unconnected arrows.
void wire_plot (long n, long m, mreal *pp, mreal *cc, bool *tt)

Protected Attributes

int _st
int _sx
 Relative shift of fog.
int _sy
int _sz
mreal aLight [10]
 Aperture of light sources.
mreal AmbBr
 Default ambient light brightness.
char Arrow1
char Arrow2
mreal B [9]
 Transformation matrix (used by PostScale() function)
mreal B1 [12]
 Transformation matrix for colorbar.
unsigned char BDef [4]
 Background color.
mreal BL [13]
 Previous transformation matrix.
mreal bLight [10]
 Brightness of light sources.
mreal CDef [4]
 Default color.
mreal cLight [30]
 Color of light sources.
mreal CloudFactor
 Factor of transparency in mglGraph::CloudP and mglGraph::CloudQ.
mglColor cmap [NUM_COLOR]
 Colors for color scheme.
wchar_t ctt [256]
 Colorbar-tick template (set NULL to use default one ("%.2g" in simplest case))
int CurFrameId
 Number of automaticle created frames.
int CurrPal
 Current index of palette mglGraph::Pal.
char DefPal [101]
 Default palette.
int Depth
 Depth of the image.
int(* DrawFunc )(mglGraph *gr, void *par)
 Drawing function for window procedure. It should return the number of frames.
mreal f_size
 font size for glyph lines
bool Finished
 Flag that final picture mglGraphZB::G is ready.
mglFontfnt
 Class for printing vector text.
mreal FogDist
 Flag that Ternary axis is used.
mreal FogDz
 Inverse fog distance (fog ~ exp(-FogDist*Z))
mreal font_factor
mreal fscl
mreal ftet
 last scale and rotation for glyphs
void * FuncPar
unsigned char * G
 Final picture in RGB format. Prepared after calling mglGraphZB::Finish().
unsigned char * G4
 Final picture in RGBA format. Prepared after calling mglGraphZB::Finish().
int Height
 Height of the image.
bool iLight [10]
 Infinity/local position of light sources.
mreal inH
 Relative width and height of last InPlot.
mreal inW
char * LegStl [100]
 String array with legend style (see mglGraph::AddLegend)
wchar_t * LegStr [100]
 String array with legend text (see mglGraph::AddLegend)
void(* LoadFunc )(int next, void *par)
bool nLight [10]
 Availability of light sources.
bool NoAutoFactor
 Temporary variable.
int NumCol
 Actual number of colors in color scheme mglGraph::cmap.
int NumFig
 Number of figures in the list. If 0 then no list and mglGraph::DrawFunc will called for each drawing.
int NumLeg
 Number of used positions in LegStr and LegStl arrays.
int nx1
int nx2
int ny1
int ny2
bool OnCoord
 Flag which allow to use color scheme along axis.
char PalNames [101]
 IDs of colors in the palette.
unsigned PDef
 Pen bit mask.
mreal PenWidth
 Pen width for further line plotting (must be >0 !!!)
mreal Persp
 Perspective factor (=0 is perspective off)
mreal pLight [30]
 Actual position of light sources (filled by LightScale() function)
mreal pPos
 Current position in pen mask.
mreal rLight [30]
 Position of light sources.
bool ScalePuts
 Enable/disable point positions scaling in puts.
bool SmoothColorbar
 Use color interpolation in colorbar (default is true)
mreal st_t
 Subtick-to-tick ratio (ls=lt/sqrt(1+st_t)). Default is 1.
char SubTStl [32]
 Subtick line style. Default is "k".
bool TernAxis
mreal TickLen
 Length of tiks (subticks length is sqrt(1+st_t)=1.41... times smaller)
char TickStl [32]
 Tick line style. Default is "k".
bool UseAlpha
 Flag that Alpha is used.
bool UseLight
 Flag of using lightning.
int Width
 Width of the image.
mreal xPos
 Shifting plot in X-direction (used by PostScale() function)
wchar_t xtt [256]
 X-tick template (set NULL to use default one ("%.2g" in simplest case))
mreal yPos
 Shifting plot in Y-direction (used by PostScale() function)
wchar_t ytt [256]
 Y-tick template (set NULL to use default one ("%.2g" in simplest case))
mreal zoomx1
mreal zoomx2
mreal zoomy1
mreal zoomy2
mreal zPos
 Shifting plot in depth (used by PostScale() function)
wchar_t ztt [256]
 Z-tick template (set NULL to use default one ("%.2g" in simplest case))

Private Attributes

int st_pos
mreal stack [MGL_STACK_ENTRY *13]

Widget functions

These functions control window behaviar in classes mglGraphFLTK, mglGraphQT and so on. They do nothing in "non-visual" classes like mglGraphZB, mglGraphPS, mglGraphGL, mglGraphIDTF.


bool AutoClf
 Clear canvas between drawing.
mreal Delay
 Delay for animation in seconds.
bool ShowMousePos
 Switch to show or not mouse click position.
mglPoint LastMousePos
 Last mouse position.
bool ClfOnUpdate
mglPoint CalcXYZ (int xs, int ys)
 Calculate 3D coordinate {x,y,z} for screen point {xs,ys}.
void CalcScr (mglPoint p, int *xs, int *ys)
 Calculate screen point {xs,ys} for 3D coordinate {x,y,z}.
mglPoint CalcScr (mglPoint p)
virtual void ToggleAlpha ()
 Switch on/off transparency (do not overwrite switches in user drawing function)
virtual void ToggleLight ()
 Switch on/off lighting (do not overwrite switches in user drawing function)
virtual void ToggleZoom ()
 Switch on/off zooming by mouse.
virtual void ToggleRotate ()
 Switch on/off rotation by mouse.
virtual void ToggleNo ()
 Switch off all zooming and rotation.
virtual void Update ()
 Update picture by calling user drawing function.
virtual void ReLoad (bool o)
 Reload user data and update picture.
virtual void Adjust ()
 Adjust size of bitmap to window size.
virtual void NextFrame ()
 Show next frame (if one)
virtual void PrevFrame ()
 Show previous frame (if one)
virtual void Animation ()
virtual void Window (int argc, char **argv, int(*draw)(mglGraph *gr, void *p), const char *title, void *par=NULL, void(*reload)(int next, void *p)=NULL, bool maximize=false)
 Create a window for plotting based on callback function (can be NULL).
void Window (int argc, char **argv, mglDraw *draw, const char *title, bool maximize=false)
 Create a window for plotting based on class mglDraw.
void Push ()
 Push transformation matrix into stack.
void Pop ()
 Pop transformation matrix from stack.
void SetPosScale (mreal xp, mreal yp, mreal zp, mreal scl=1)
 Set diagonal matrix and its shift.

Detailed Description

Class implement the creation of different mathematical plots using Z-ordering.

Definition at line 29 of file mgl_ab.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index