Function:s2box

From S2PLOT

Revision as of 08:40, 27 October 2007; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

s2box

Draw a labelled box around the world space.

Prototype

void s2box(char *xopt, float xtick, int nxsub, char *yopt, float ytick, int nysub, char *zopt, float ztick, int nzsub);

Description

Draw a labelled box around the world space. Arguments xtick, ytick and ztick specify the major tick intervals on each axis (0.0 means let S2PLOT figure out the "best" value/s); nxsub, nysub and nzsub indicate how many subdivisions the major intervals should comprise and are ignored when S2PLOT is determining major intervals itself. If nxsub, nysub or nzsub are 0, then they are automatically determined.

xopt is a character string, with any of the following flags:

  • B = draw front bottom (-Y,-Z) edge
  • C = draw front top (-Y,+Z) edge
  • D = draw back bottom (+Y,-Z) edge
  • E = draw back top (+Y,+Z) edge
  • T = draw major tick marks
  • S = draw minor tick marks [not yet implemented]
  • M = numeric labels in conventional location/s
  • N = numeric labels in non-conventional location/s
  • O = draw labels on an opaque panel so they are never seen in reverse - this is always done if both M and N options are requested
  • Q = make panel larger to fit axis titles drawn by s2lab function
  • G = draw grid lines at major tick intervals
  • L = written label is 10^(coordval), ie. logarithmic labels
  • 1 = force decimal labels (this is default: redundant option)
  • 2 = force exponential (scientific notation) labels

yopt is a character string as for xopt, but with following changes:

  • B = draw bottom left (-Z,-X) edge
  • C = draw bottom right (-Z,+X) edge
  • D = draw top left (+Z,-X) edge
  • E = draw top right (+Z,+X) edge

zopt is a character string as for xopt, but with following changes:

  • B = draw left front (-X,-Y) edge
  • C = draw right front (-X,+Y) edge
  • D = draw left back (+X,-Y) edge
  • E = draw right back (+X,+Y) edge

See Also

s2lab Draw labels along the edges of bounding box.

PGPLOT Equivalent

PGBOX

Code Example

#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"

int main(int argc, char *argv[])
{
   char xopt[] = "BCDETMNOPQ";
   char yopt[] = "BCDETMNOPQ";
   char zopt[] = "BCDETMNOPQ";

   s2opend("/?",argc, argv);			/* Open the display */
   s2swin(-1.,1., -1.,1., -1.,1.);		/* Set the window coordinates */
   s2box(xopt, 0,0, yopt, 0,0, zopt, 0,0);	/* Draw the coordinate box */
   s2lab("X-axis","Y-axis","Z-axis","Plot");	/* Write some labels */
   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools