Function:s2env

From S2PLOT

Jump to: navigation, search

s2env

Convenience function which sets the plotting environment.

Prototype

void s2env(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax, int just, int axis);

Description

Convenience function which sets the plotting environment: Sets the viewport to the default; Sets the world coordinate range as requested; and Optionally labels the plot with a call to s2box. If just = 1, the scales of the x, y and z axes (in something like world coordinates per inch) will be equal and the plotting viewport may be a generic rectangular prism rather than a cube (the case for just = 0). Argument axis controls labelling as follows: axis = -2: no box, axes or labels axis = -1: draw box only axis = 0: draw box and label it with coordinates axis = 1: same as axis=0, but also draw the coordinate axes axis = 2: same as axis=1, but also draw grid lines at major intervals It is a requirement that xmin < xmax, ymin < ymax and zmin < zmax.

A call to s2sci can preceed the call to s2env so that the axis labels are drawn in the desired colour.


See Also

s2svp Set up the part of 3D space that is used for plotting.

PGPLOT Equivalent

PGENV

Code Example

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

int main(int argc, char *argv[])
{
   int just = 1;				/* Viewpoint not a cube */ 
   int axis = 2;				/* Draw box and grid lines */

   s2opend("/?",argc, argv);			/* Open the display */
   s2env(-5.0,5.0, -3.0,3.0, -1.0,1.0, just, axis);
						/* Set the plotting environment */
   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools