These functions perform plotting of 2D and 3D vector fields. There are 5 generally different types of vector fields representations: simple vector field (Vect), vectors along the curve (Traj), vector field by dew-drops (Dew), flow threads (Flow, FlowP), flow pipes (Pipe). By default (if absent) values of x, y, z are equidistantly distributed in axis range. The minor dimensions of arrays x, y, z, ax should be equal. The size of ax, ay and az must be equal. Arrays x, y, z can be vectors (not matrices as ax). String sch sets the color scheme (see Color scheme) for plot. String opt contain command options (see Command options).
y1dat y2dat ['sch'=''] ¶x1dat y1dat x2dat y2dat ['sch'=''] ¶x1dat y1dat z1dat x2dat y2dat z2dat ['sch'=''] ¶mglGraph: void Lines (const mglDataA &y1, const mglDataA &y2, const char *sch="", const char *opt="") ¶mglGraph: void Lines (const mglDataA &x1, const mglDataA &y1, const mglDataA &x2, const mglDataA &y2, const char *sch="", const char *opt="") ¶mglGraph: void Lines (const mglDataA &x1, const mglDataA &y1, const mglDataA &z1, const mglDataA &x2, const mglDataA &y2, const mglDataA &z2, const char *sch="", const char *opt="") ¶void mgl_lines_xyz (HMGL gr, HCDTx1, HCDTy1, HCDTz1, HCDTx2, HCDTy2, HCDTz2, const char *sch, const char *opt) ¶void mgl_lines_xy (HMGL gr, HCDTx1, HCDTy1, HCDTx2, HCDTy2, const char *sch, const char *opt) ¶void mgl_lines (HMGL gr, HCDTy1, HCDTy2, const char *sch, const char *opt) ¶The function draws lines between points {x1, y1, z1} and {x2, y2, z2}. String pen specifies the color (see Line styles). By default (pen="") color from palette is used (see Palette and colors). The minor sizes of all arrays must be the same. The plots are drawn for each row if one of the data is the matrix. See also plot, traj. See Sample ‘lines’, for sample code and picture.
xdat ydat udat vdat ['sch'=''] ¶xdat ydat zdat udat vdat wdat ['sch'=''] ¶mglGraph: void Traj (const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") ¶mglGraph: void Traj (const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") ¶void mgl_traj_xyz (HMGL gr, HCDTx, HCDTy, HCDTz, HCDTax, HCDTay, HCDTaz, const char *sch, const char *opt) ¶void mgl_traj_xy (HMGL gr, HCDTx, HCDTy, HCDTax, HCDTay, const char *sch, const char *opt) ¶The function draws vectors {ax, ay, az} along a curve {x, y, z}. The length of arrows are proportional to \sqrt{ax^2+ay^2+az^2}. String pen specifies the color (see Line styles). By default (pen="") color from palette is used (see Palette and colors). Option value set the vector length factor (if non-zero) or vector length to be proportional the distance between curve points (if value=0). The minor sizes of all arrays must be equal and large 2. The plots are drawn for each row if one of the data is the matrix. See also vect. See Sample ‘traj’, for sample code and picture.
udat vdat ['sch'=''] ¶xdat ydat udat vdat ['sch'=''] ¶mglGraph: void Vect (const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") ¶mglGraph: void Vect (const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") ¶void mgl_vect_2d (HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *opt) ¶void mgl_vect_xy (HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) ¶The function draws plane vector field plot for the field {ax, ay} depending parametrically on coordinates x, y at level z equal to minimal z-axis value. The length and color of arrows are proportional to \sqrt{ax^2+ay^2}. The number of arrows depend on meshnum. The appearance of the hachures (arrows) can be changed by symbols:
See also flow, dew. See Sample ‘vect’, for sample code and picture.
udat vdat wdat ['sch'=''] ¶xdat ydat zdat udat vdat wdat ['sch'=''] ¶mglGraph: void Vect (const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") ¶mglGraph: void Vect (const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") ¶void mgl_vect_3d (HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) ¶void mgl_vect_xyz (HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) ¶This is 3D version of the first functions. Here arrays ax, ay, az must be 3-ranged tensors with equal sizes and the length and color of arrows is proportional to \sqrt{ax^2+ay^2+az^2}.
udat vdat wdat ['sch'='' sval] ¶xdat ydat zdat udat vdat wdat ['sch'='' sval] ¶mglGraph: void Vect3 (const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", mreal sVal=-1, const char *opt="") ¶mglGraph: void Vect3 (const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", mreal sVal=-1, const char *opt="") ¶void mgl_vect3 (HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, mreal sVal, const char *opt) ¶void mgl_vect3_xyz (HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, mreal sVal, const char *opt) ¶The function draws 3D vector field plot for the field {ax, ay, az} depending parametrically on coordinates x, y, z. Vector field is drawn at slice sVal in direction {‘x’, ‘y’, ‘z’} if sch contain corresponding symbol (by default, ‘y’ direction is used). The length and color of arrows are proportional to \sqrt{ax^2+ay^2+az^2}. The number of arrows depend on meshnum. The appearance of the hachures (arrows) can be changed by symbols:
See also vect, flow, dew. See Sample ‘vect3’, for sample code and picture.
udat vdat ['sch'=''] ¶xdat ydat udat vdat ['sch'=''] ¶mglGraph: void Dew (const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") ¶mglGraph: void Dew (const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") ¶void mgl_dew (HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *opt) ¶void mgl_dew_xy (HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) ¶The function draws dew-drops for plane vector field {ax, ay} depending parametrically on coordinates x, y at level z equal to minimal z-axis value. Note that this is very expensive plot in memory usage and creation time! The color of drops is proportional to \sqrt{ax^2+ay^2}. The number of drops depend on meshnum. See also vect. See Sample ‘dew’, for sample code and picture.
udat vdat ['sch'=''] ¶xdat ydat udat vdat ['sch'=''] ¶mglGraph: void Flow (const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") ¶mglGraph: void Flow (const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") ¶void mgl_flow_2d (HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *opt) ¶void mgl_flow_xy (HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) ¶The function draws flow threads for the plane vector field {ax, ay} parametrically depending on coordinates x, y at level z equal to minimal z-axis value. Option value set the approximate number of threads (default is 5), or accuracy for stationary points (if style ‘.’ is used) . String sch may contain:
See also pipe, vect, tape, flow3, barwidth. See Sample ‘flow’, for sample code and picture.
udat vdat wdat ['sch'=''] ¶xdat ydat zdat udat vdat wdat ['sch'=''] ¶mglGraph: void Flow (const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") ¶mglGraph: void Flow (const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") ¶void mgl_flow_3d (HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) ¶void mgl_flow_xyz (HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) ¶This is 3D version of the first functions. Here arrays ax, ay, az must be 3-ranged tensors with equal sizes and the color of line is proportional to \sqrt{ax^2+ay^2+az^2}.
x0 y0 udat vdat ['sch'=''] ¶x0 y0 xdat ydat udat vdat ['sch'=''] ¶mglGraph: void FlowP (mglPoint p0, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") ¶mglGraph: void FlowP (mglPoint p0, const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") ¶void mgl_flowp_2d (HMGL gr, mreal x0, mreal y0, mreal z0, HCDT ax, HCDT ay, const char *sch, const char *opt) ¶void mgl_flowp_xy (HMGL gr, mreal x0, mreal y0, mreal z0, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) ¶The same as first one (flow) but draws single flow thread starting from point p0={x0,y0,z0}. String sch may also contain: ‘>’ or ‘<’ for drawing in forward or backward direction only (default is both).
x0 y0 z0 udat vdat wdat ['sch'=''] ¶x0 y0 z0 xdat ydat zdat udat vdat wdat ['sch'=''] ¶mglGraph: void FlowP (mglPoint p0, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") ¶mglGraph: void FlowP (mglPoint p0, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") ¶void mgl_flowp_3d (HMGL gr, mreal x0, mreal y0, mreal z0, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) ¶void mgl_flowp_xyz (HMGL gr, mreal x0, mreal y0, mreal z0, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) ¶This is 3D version of the previous functions.
udat vdat wdat ['sch'=''] ¶xdat ydat zdat udat vdat ['sch'=''] ¶mglGraph: void Flow3 (const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", double sVal=-1, const char *opt="") ¶mglGraph: void Flow3 (const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", double sVal=-1, const char *opt="") ¶void mgl_flow3 (HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, double sVal, const char *opt) ¶void mgl_flow3_xyz (HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, double sVal, const char *opt) ¶The function draws flow threads for the 3D vector field {ax, ay, az} parametrically depending on coordinates x, y, z. Flow threads starts from given plane. Option value set the approximate number of threads (default is 5). String sch may contain:
See also flow, pipe, vect. See Sample ‘flow3’, for sample code and picture.
pdat ['sch'=''] ¶xdat ydat pdat ['sch'=''] ¶xdat ydat zdat pdat ['sch'=''] ¶mglGraph: void Grad (const mglDataA &phi, const char *sch="", const char *opt="") ¶mglGraph: void Grad (const mglDataA &x, const mglDataA &y, const mglDataA &phi, const char *sch="", const char *opt="") ¶mglGraph: void Grad (const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &phi, const char *sch="", const char *opt="") ¶void mgl_grad (HMGL gr, HCDT phi, const char *sch, const char *opt) ¶void mgl_grad_xy (HMGL gr, HCDT x, HCDT y, HCDT phi, const char *sch, const char *opt) ¶void mgl_grad_xyz (HMGL gr, HCDT x, HCDT y, HCDT z, HCDT phi, const char *sch, const char *opt) ¶The function draws gradient lines for scalar field phi[i,j] (or phi[i,j,k] in 3d case) specified parametrically {x[i,j,k], y[i,j,k], z[i,j,k]}. Number of lines is proportional to value option (default is 5). See also dens, cont, flow.
udat vdat ['sch'='' r0=0.05] ¶xdat ydat udat vdat ['sch'='' r0=0.05] ¶mglGraph: void Pipe (const mglDataA &ax, const mglDataA &ay, const char *sch="", mreal r0=0.05, const char *opt="") ¶mglGraph: void Pipe (const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", mreal r0=0.05, const char *opt="") ¶void mgl_pipe_2d (HMGL gr, HCDT ax, HCDT ay, const char *sch, mreal r0, const char *opt) ¶void mgl_pipe_xy (HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, mreal r0, const char *opt) ¶The function draws flow pipes for the plane vector field {ax, ay} parametrically depending on coordinates x, y at level z equal to minimal z-axis value. Number of pipes is proportional to value option (default is 5). If ‘#’ symbol is specified then pipes start only from edges of axis range. The color of lines is proportional to \sqrt{ax^2+ay^2}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). Parameter r0 set the base pipe radius. If r0<0 or symbol ‘i’ is specified then pipe radius is inverse proportional to amplitude. The vector field is plotted for each z slice of ax, ay. See also flow, vect. See Sample ‘pipe’, for sample code and picture.
udat vdat wdat ['sch'='' r0=0.05] ¶xdat ydat zdat udat vdat wdat ['sch'='' r0=0.05] ¶mglGraph: void Pipe (const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", mreal r0=0.05, const char *opt="") ¶mglGraph: void Pipe (const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", mreal r0=0.05, const char *opt="") ¶void mgl_pipe_3d (HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, mreal r0, const char *opt) ¶void mgl_pipe_xyz (HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, mreal r0, const char *opt) ¶This is 3D version of the first functions. Here arrays ax, ay, az must be 3-ranged tensors with equal sizes and the color of line is proportional to \sqrt{ax^2+ay^2+az^2}.