Function:s2pt

From S2PLOT

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

s2pt

Draw a set of points with a given symbol.

Prototype

void s2pt(int np, float *xpts, float *ypts, float *zpts, int symbol);

Description

Draw a set of npts points. Symbol value 1 produces a single pixel, independent of distance to the point. Symbols are drawn in the current colour. Markers taking finite size are scaled by the current character height. The current linewidth does not affect markers.

Argument symbol should be one of: 0 = wireframe box 1 = point 2 = wireframe 3D cross 4 = shaded sphere 6 = shaded box


See Also

s2pt1 Draw a single point with a given symbol.
s2pnts Draw a set of points with different markers.

PGPLOT Equivalent

PGPT

Code Example

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

int main(int argc, char *argv[])
{
   int i;					/* Loop variable */
   int N = 50;					/* Number of points */
   float x[50], y[50], z[50];			/* Coordinates of points */
   int symbol = 4;				/* Shaded sphere symbol */

   srand48((long)time(NULL));			/* Seed random numbers */
   for (i=0;i<N;i++) {
      x[i] = drand48()*2.0 - 1.0;
      y[i] = drand48()*2.0 - 1.0;
      z[i] = drand48()*2.0 - 1.0;
   }

   s2opend("/?",argc, argv);			/* Open the display */
   s2swin(-1.,1., -1.,1., -1.,1.);		/* Set the window coordinates */
   s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0);	/* Draw coordinate box */

   s2sch(2);					/* Sets size of symbol */
   s2pt(N,x,y,z,symbol);			/* Draw a single point */
   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools