| [ << ] | [ < ] | [ 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:voidSubPlot (intnx,intny,intm,const char *stl="<>_^",mrealdx=0,mrealdy=0) - C function:
voidmgl_subplot (HMGLgr,intnx,intny,intm,const char *stl) - C function:
voidmgl_subplot_d (HMGLgr,intnx,intny,intm,const char *stl,mrealdx,mrealdy) 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,
- ‘#’ – reserve none space (use whole region for axis range).
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:voidMultiPlot (intnx,intny,intm,intdx,intdy,const char *stl="<>_^") - C function:
voidmgl_multiplot (HMGLgr,intnx,intny,intm,intdx,intdy,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=on] - Method on
mglGraph:voidInPlot (mrealx1,mrealx2,mrealy1,mrealy2,boolrel=true) - C function:
voidmgl_inplot (HMGLgr,mrealx1,mrealx2,mrealy1,mrealy2) - C function:
voidmgl_relplot (HMGLgr,mrealx1,mrealx2,mrealy1,mrealy2) 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=
truethen 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:voidColumnPlot (intnum,intind,mreald=0) - C function:
voidmgl_columnplot (HMGLgr,intnum,intind) - C function:
voidmgl_columnplot_d (HMGLgr,intnum,intind,mreald) 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:voidGridPlot (intnx,intny,intind,mreald=0) - C function:
voidmgl_gridplot (HMGLgr,intnx,intny,intind) - C function:
voidmgl_gridplot_d (HMGLgr,intnx,intny,intind,mreald) 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:voidStickPlot (intnum,intind,mrealtet,mrealphi) - C function:
voidmgl_stickplot (HMGLgr,intnum,intind,mrealtet,mrealphi) 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:voidTitle (const char *txt,const char *stl="",mrealsize=-2) - Method on
mglGraph:voidTitle (const wchar_t *txt,const char *stl="",mrealsize=-2) - C function:
voidmgl_title (HMGLgr,const char *txt,const char *stl,mrealsize) - C function:
voidmgl_titlew (HMGLgr,const wchar_t *txt,const char *stl,mrealsize) 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
tetx tetz [tety=0] - Method on
mglGraph:voidRotate (mrealTetX,mrealTetZ,mrealTetY=0) - C function:
voidmgl_rotate (HMGLgr,mrealTetX,mrealTetZ,mrealTetY) 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:voidRotateN (mrealTet,mrealx,mrealy,mrealz) - C function:
voidmgl_rotate_vector (HMGLgr,mreal Tet,mreal x,mreal y,mreal z) Rotates a further plotting around vector {x, y, z} on angle Tet.
- MGL command: aspect
ax ay [az=1] - Method on
mglGraph:voidAspect (mrealAx,mrealAy,mrealAz=1) - C function:
voidmgl_aspect (HMGLgr,mrealAx,mrealAy,mrealAz) 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. If Ax is
NANthen function try to select optimal aspect ratio to keep equal ranges for x-y axis. At this, Ay will specify proportionality factor, or set to use automatic one if Ay=NAN.
- Method on
mglGraph:voidPush () - C function:
voidmgl_mat_push (HMGLgr) Push transformation matrix into stack. Later you can restore its current state by Pop() function.
- Method on
mglGraph:voidPop () - C function:
voidmgl_mat_pop (HMGLgr) Pop (restore last ’pushed’) transformation matrix into stack.
- Method on
mglGraph:voidSetPlotFactor (mrealval) - C function:
voidmgl_set_plotfactor (HMGLgr,mrealval) 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 3 functions View(), Zoom() and Perspective() which transform whole image. I.e. they act as secondary transformation matrix. They were introduced for rotating/zooming the whole plot by mouse. It is not recommended to call them for picture drawing.
- MGL command: perspective
val - Method on
mglGraph:voidPerspective (mreala) - C function:
voidmgl_perspective (HMGLgr,mreala) Add (switch on) the perspective to plot. The parameter a = Depth/(Depth+dz) \in [0,1). By default (
a=0) the perspective is off.
- MGL command: view
tetx tetz [tety=0] - Method on
mglGraph:voidView (mrealTetX,mrealTetZ,mrealTetY=0) - C function:
voidmgl_view (HMGLgr,mrealTetX,mrealTetZ,mrealTetY) Rotates a further plotting relative to each axis {x, z, y} consecutively on angles TetX, TetZ, TetY. Rotation is done independently on rotate. Attention! this settings can not be overwritten by
DefaultPlotParam(). UseZoom(0,0,1,1)to return default view.
- MGL command: zoom
x1 y1 x2 y2 - Method on
mglGraph(C++, Python):voidZoom (mrealx1,mrealy1,mrealx2,mrealy2) - C function:
voidmgl_set_zoom (HMGLgr,mrealx1,mrealy1,mrealx2,mrealy2) 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, including
DefaultPlotParam(). UseZoom(0,0,1,1)to return default view.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on March 21, 2014 using texi2html 5.0.
