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

4.8 Axis and Colorbar

These functions draw the “things for measuring”, like axis with ticks, colorbar with ticks, grid along axis, bounding box and labels for axis. For more information see Axis settings.

MGL command: axis ['dir'='xyz' 'stl'='']
Method on mglGraph: void Axis (const char *dir="xyz", const char *stl="", const char *opt="")
C function: void mgl_axis (HMGL gr, const char *dir, const char *stl, const char *opt)

Draws axes with ticks (see Axis settings). Parameter dir may contain:

  • xyz’ for drawing axis in corresponding direction;
  • XYZ’ for drawing axis in corresponding direction but with inverted positions of labels;
  • ~’ or ‘_’ for disabling tick labels;
  • U’ for disabling rotation of tick labels;
  • ^’ for inverting default axis origin;
  • AKDTVISO’ for drawing arrow at the end of axis;
  • a’ for forced adjusting of axis ticks.

Styles of ticks and axis can be overrided by using stl string. See section Axis and ticks, for sample code and picture.

MGL command: colorbar ['sch'='']
Method on mglGraph: void Colorbar (const char *sch="")
C function: void mgl_colorbar (HMGL gr, const char *sch)

Draws colorbar. Parameter sch may contain:

  • color scheme (see Color scheme);
  • <>^_’ for positioning at left, at right, at top or at bottom correspondingly;
  • I’ for positioning near bounding (by default, is positioned at edges of subplot);
  • A’ for using absolute coordinates;
  • ~’ for disabling tick labels.

See section Colorbars, for sample code and picture.

MGL command: colorbar vdat ['sch'='']
Method on mglGraph: void Colorbar (const mglDataA &v, const char *sch="")
C function: void mgl_colorbar_val (HMGL gr, HCDT v, const char *sch)

The same as previous but with sharp colors sch (current palette if sch="") for values v. See section ContD sample, for sample code and picture.

MGL command: colorbar 'sch' x y [w=1 h=1]
Method on mglGraph: void Colorbar (const char *sch, mreal x, mreal y, mreal w=1, mreal h=1)
C function: void mgl_colorbar_ext (HMGL gr, const char *sch, mreal x, mreal y, mreal w, mreal h)

The same as first one but at arbitrary position of subplot {x, y} (supposed to be in range [0,1]). Parameters w, h set the relative width and height of the colorbar.

MGL command: colorbar vdat 'sch' x y [w=1 h=1]
Method on mglGraph: void Colorbar (const mglDataA &v, const char *sch, mreal x, mreal y, mreal w=1, mreal h=1)
C function: void mgl_colorbar_val_ext (HMGL gr, HCDT v, const char *sch, mreal x, mreal y, mreal w, mreal h)

The same as previous but with sharp colors sch (current palette if sch="") for values v. See section ContD sample, for sample code and picture.

MGL command: grid ['dir'='xyz' 'pen'='B']
Method on mglGraph: void Grid (const char *dir="xyz", const char *pen="B", const char *opt="")
C function: void mgl_axis_grid (HMGL gr, const char *dir, const char *pen, const char *opt)

Draws grid lines perpendicular to direction determined by string parameter dir. The step of grid lines is the same as tick step for axis. The style of lines is determined by pen parameter (default value is dark blue solid line ‘B-’).

MGL command: box ['stl'='k' ticks=on]
Method on mglGraph: void Box (const char *col="", bool ticks=true)
C function: void mgl_box (HMGL gr, int ticks)
C function: void mgl_box_str (HMGL gr, const char *col, int ticks)

Draws bounding box outside the plotting volume with color col. If col contain ‘@’ then filled faces are drawn. At this first color is used for faces (default is light yellow), last one for edges. See section Bounding box, for sample code and picture.

MGL command: xlabel 'text' [pos=1]
MGL command: ylabel 'text' [pos=1]
MGL command: zlabel 'text' [pos=1]
MGL command: tlabel 'text' [pos=1]
Method on mglGraph: void Label (char dir, const char *text, mreal pos=1, const char *opt="")
Method on mglGraph: void Label (char dir, const wchar_t *text, mreal pos=1, const char *opt="")
C function: void mgl_label (HMGL gr, char dir, const char *text, mreal pos, const char *opt)
C function: void mgl_labelw (HMGL gr, char dir, const wchar_t *text, mreal pos, const char *opt)

Prints the label text for axis dir=‘x’,‘y’,‘z’,‘t’ (here ‘t’ is “ternary” axis t=1-x-y). The position of label is determined by pos parameter. If pos=0 then label is printed at the center of axis. If pos>0 then label is printed at the maximum of axis. If pos<0 then label is printed at the minimum of axis. Option value set additional shifting of the label. See section Text printing.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on March 21, 2014 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.