[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.4 Subplots and rotation
These functions control how and where further plotting will be placed. There is a certain calling order of these functions for the better plot appearance. First one should be subplot, multiplot or inplot for specifying the place. Second one can be title for adding title for the subplot. After it a rotate and aspect. And finally any other plotting functions may be called. Alternatively you can use columnplot, gridplot, stickplot or relative inplot for positioning plots in the column (or grid, or stick) one by another without gap between plot axis (bounding boxes). See section Subplots, for sample code and picture.
- MGL command: subplot
nx ny m ['stl'='<>_^' dx=0 dy=0]
- Method on
mglGraph
:void
SubPlot (int
nx,int
ny,int
m,const char *
stl="<>_^"
,float
dx=0
,float
dy=0
) - C function:
void
mgl_subplot (HMGL
gr,int
nx,int
ny,int
m,const char *
stl) - C function:
void
mgl_subplot_d (HMGL
gr,int
nx,int
ny,int
m,const char *
stl,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. Extra space will be reserved for axis/colorbar if stl contain:
- ‘L’ or ‘<’ – at left side,
- ‘R’ or ‘>’ – at right side,
- ‘A’ or ‘^’ – at top side,
- ‘U’ or ‘_’ – at bottom side.
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.
- MGL command: multiplot
nx ny m dx dy
['style'='<>_^'] - Method on
mglGraph
:void
MultiPlot (int
nx,int
ny,int
m,int
dx,int
dy,const char *
stl="<>_^"
) - C function:
void
mgl_multiplot (HMGL
gr,int
nx,int
ny,int
m,int
dx,int
dy,const char *
stl) Puts further plotting in a rectangle of dx*dy cells starting from 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 subplot. Extra space will be reserved for axis/colorbar if stl contain:
- ‘L’ or ‘<’ – at left side,
- ‘R’ or ‘>’ – at right side,
- ‘A’ or ‘^’ – at top side,
- ‘U’ or ‘_’ – at bottom side.
- MGL command: inplot
x1 x2 y1 y2 [rel=off]
- Method on
mglGraph
: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 inplot with rel=false
) is used. This function set off any aspects or rotations. So it should be used first for creating subplot.
- MGL command: columnplot
num ind [d=0]
- Method on
mglGraph
: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 (or inplot with rel=
false
). Parameter d set extra gap between cells.
- MGL command: gridplot
nx ny ind [d=0]
- Method on
mglGraph
:void
GridPlot (int
nx,int
ny,int
ind,float
d=0
) - C function:
void
mgl_gridplot (HMGL
gr,int
nx,int
ny,int
ind) - C function:
void
mgl_gridplot_d (HMGL
gr,int
nx,int
ny,int
ind,float
d) Puts further plotting in ind-th cell of nx*ny grid. The position is relative to previous subplot (or inplot with rel=
false
). Parameter d set extra gap between cells.
- MGL command: stickplot
num ind tet phi
- Method on
mglGraph
: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 (or inplot with rel=
false
).
- MGL command: title 'title' ['stl'=''
size=-2
] - Method on
mglGraph
:void
Title (const char *
txt,const char *
stl=""
,float
size=-2
) - Method on
mglGraph
:void
Title (const wchar_t *
txt,const char *
stl=""
,float
size=-2
) - C function:
void
mgl_title (HMGL
gr,const char *
txt,const char *
stl,float
size) - C function:
void
mgl_titlew (HMGL
gr,const wchar_t *
txt,const char *
stl,float
size) Add text title for current subplot/inplot. Paramater stl can contain:
- font style (see, Font styles);
- ‘#’ for box around the title.
Parameter size set font size. This function set off any aspects or rotations. So it should be used just after creating subplot.
- MGL command: rotate
tetz tetx [tety=0]
- Method on
mglGraph
: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.
- MGL command: rotate
tet x y z
- Method on
mglGraph
: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.
- MGL command: aspect
ax ay [az=1]
- Method on
mglGraph
:void
Aspect (float
Ax,float
Ay,float
Az=1
) - 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.
- MGL command: perspective
val
- Method on
mglGraph
: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
: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
:void
Pop () - C function:
void
mgl_mat_pop (HMGL
gr) Pop (restore last ’pushed’) transformation matrix into stack.
- Method on
mglGraph
:void
SetPlotFactor (float
val) - C function:
void
mgl_set_plotfactor (HMGL
gr,float
val) Sets the factor of plot size. It is not recommended to set it lower then 1.5. This is some analogue of function Zoom() but applied not to overall image but for each InPlot. Use negative value or zero to enable automatic selection.
There are 2 functions View()
and Zoom()
which transform whole image. I.e. they act as secondary transformation matrix. They were introduced for rotating/zooming the whole plot by mouse.
- Method on
mglGraph
:void
View (float
TetX,float
TetZ,float
TetY=0
) - C function:
void
mgl_view (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. Rotation is done independently on rotate. Use
Zoom(0,0,1,1)
to return default view.
- Method on
mglGraph
(C++, Python):void
Zoom (float
x1,float
y1,float
x2,float
y2) - C function:
void
mgl_set_zoom (HMGL
gr,float
x1,float
y1,float
x2,float
y2) The function changes the scale of graphics that correspond to zoom in/out of the picture. After function call the current plot will be cleared and further the picture will contain plotting from its part [x1,x2]*[y1,y2]. Here picture coordinates x1, x2, y1, y2 changes from 0 to 1. Attention! this settings can not be overwritten by any other functions. Use
Zoom(0,0,1,1)
to return default view.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 13, 2012 using texi2html 5.0.