manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3 Transformation matrix

These functions control how and where further plotting will be placed. There is a curtain order of calling of these functions for the better plot view. First one should be SubPlot() or InPlot() for specifying the place. After it a Rotate() and Aspect(). And finally any other plotting functions may be called. Alternatevely you can use ColumnPlot() for position plots in the column one by another without gap between plot axis (bounding boxes).

Method on mglGraph (C++, Python): void SubPlot (int nx, int ny, int m, float dx=0, float dy=0)
C function: void mgl_subplot (HMGL gr, int nx, int ny, int m)
C function: void mgl_subplot_d (HMGL gr, int nx, int ny, int m, float dx, float dy)

Puts further plotting in a m-th cell of nx*ny grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating the subplot. From the aesthetical point of view it is not recommended to use this function with different matrices in the same frame. The position of the cell can be shifted from its default position by relative size dx, dy.

Method on mglGraph (C++, Python): void SubPlot (int nx, int ny, int m, const char *style)
C function: void mgl_subplot_s (HMGL gr, int nx, int ny, int m, const char *style)

The same as previous but space reserved for axis/colorbar is saved only if style contain: ‘L’ or ‘<’ – at left side, ‘R’ or ‘>’ – at right side, ‘A’ or ‘^’ – at top side, ‘U’ or ‘_’ – at bottom side.

Method on mglGraph (C++, Python): void InPlot (float x1, float x2, float y1, float y2, bool rel=false)
C function: void mgl_inplot (HMGL gr, float x1, float x2, float y1, float y2)
C function: void mgl_relplot (HMGL gr, float x1, float x2, float y1, float y2)

Puts further plotting in some region of the whole frame surface. This function allows one to create a plot in arbitrary place of the screen. The position is defined by rectangular coordinates [x1, x2]*[y1, y2]. The coordinates x1, x2, y1, y2 are normalized to interval [0, 1]. If parameter rel=true then the relative position to current SubPlot() (or last InPlot() with rel=false) is used. This function set off any aspects or rotations. So it should be used first for creating subplot.

Method on mglGraph (C++, Python): void ColumnPlot (int num, int ind, float d=0)
C function: void mgl_columnplot (HMGL gr, int num, int ind)
C function: void mgl_columnplot_d (HMGL gr, int num, int ind, float d)

Puts further plotting in ind-th cell of column with num cells. The position is relative to previous SubPlot() call (or InPlot() with rel=false). Parameter d set extra gap between cells. See section ColumnPlot sample, for sample code and picture.

Method on mglGraph (C++, Python): void StickPlot (int num, int ind, float tet, float phi)
C function: void mgl_stickplot (HMGL gr, int num, int ind, float tet, float phi)

Puts further plotting in ind-th cell of stick with num cells. At this, stick is rotated on angles tet, phi. The position is relative to previous SubPlot() call (or InPlot() with rel=false). See section StickPlot sample, for sample code and picture.

Method on mglGraph (C++, Python): void Rotate (float TetX, float TetZ, float TetY=0)
C function: void mgl_rotate (HMGL gr, float TetX, float TetZ, float TetY)

Rotates a further plotting relative to each axis {x, z, y} consecutively on angles TetX, TetZ, TetY.

Method on mglGraph (C++, Python): void RotateN (float Tet, float x, float y, float z)
C function: void mgl_rotate_vector (HMGL gr, float Tet, float x, float y, float z)

Rotates a further plotting around vector {x, y, z} on angle Tet.

Method on mglGraph (C++, Python): void Aspect (float Ax, float Ay, float Az)
C function: void mgl_aspect (HMGL gr, float Ax, float Ay, float Az)

Defines aspect ratio for the plot. The viewable axes will be related one to another as the ratio Ax:Ay:Az. For the best effect it should be used after Rotate() function.

Method on mglGraph (C++, Python): void Perspective (float a)
C function: void mgl_perspective (HMGL gr, float a)

Add (switch on) the perspective to plot. The parameter a ~ 1/z_eff \in [0,1). By default (a=0) the perspective is off.

Method on mglGraph (C++, Python): void Identity (bool rel=false)
C function: void mgl_identity (HMGL gr, int rel)

Clears transformation matrix. This function clears all previous effects of Aspect(), SubPlot(), InPlot() or Rotate() functions. It is equivalent to the call of InPlot(0,1,0,1,rel).

Method on mglGraph (C++, Python): void Push ()
C function: void mgl_mat_push (HMGL gr)

Push transformation matrix into stack. Later you can restore its current state by Pop() function. Stack can keep up to 10 matrices.

Method on mglGraph (C++, Python): void Pop ()
C function: void mgl_mat_pop (HMGL gr)

Pop (restore last ’pushed’) transformation matrix into stack.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.