HowToC:DrawPoints

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 22:42, 10 December 2007
S2plot admin (Talk | contribs)

← Previous diff
Revision as of 22:43, 10 December 2007
S2plot admin (Talk | contribs)

Next diff →
Line 34: Line 34:
For more information on the functions we have introduced so far, see: For more information on the functions we have introduced so far, see:
-[[Function:s2pt1|s2pt1] Draw a single point with a given symbol. +* [[Function:s2pt1|s2pt1]]
-[[Function:s2pt|s2pt]] Draw a set of points with a given symbol.+* [[Function:s2pt|s2pt]]
-[[Function:s2pnts|s2pnts]] Draw a set of points with different markers.+* [[Function:s2pnts|s2pnts]]
-[[Function:ns2m|ns2m]] Draw a marker +* [[Function:ns2m|ns2m]]
-[[Function:ns2vm|ns2vm]] Draw a marker - vector input+* [[Function:ns2vm|ns2vm]]
-[[Function:ns2vpoint|ns2vpoint]] Draw a point at the given position and colour - vector input. +* [[Function:ns2vpoint|ns2vpoint]]
-[[Function:ns2vnpoint|ns2vnpoint]] Draw multiple points at the given positions with one colour - vector input. +* [[Function:ns2vnpoint|ns2vnpoint]]
-[[Function:ns2thpoint|ns2thpoint]] Draw a thick point at given position, in colour and thickness in pixels (not world coords). +* [[Function:ns2thpoint|ns2thpoint]]
-[[Function:ns2vthpoint|ns2vthpoint]] Draw a thick point at given position, in colour and thickness in pixels (not world coords) - vector input.+* [[Function:ns2vthpoint|ns2vthpoint]]
-[[Function:Colours|Colours]] Useful colour definitions based on PGPlot default settings.+* [[Function:Colours|Colours]]
-[[Function:struct_COLOUR|struct COLOUR]] Data structure for (r,g,b) colour indices.+* [[Function:struct_COLOUR|struct COLOUR]]
=== Common Problems=== === Common Problems===

Revision as of 22:43, 10 December 2007

Contents

Drawing Points

Points example

Copy and paste the following code, and save the file as s2points.c

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

int main(int argc, char *argv[])
{
   float xmin = -1, xmax = +1;          /* X data range */
   float ymin = -1, ymax = +1;          /* Y data range */
   float zmin = -1, zmax = +1;          /* Z data range */

   s2opend("/?",argc,argv);             /* Which S2PLOT device to open? */
   s2swin(xmin, xmax, ymin, ymax, zmin, zmax);  /* Set the display coordinates */

   s2show(1);                           /* Hand over to the display */

   return 1;
}

Compile using: cbuild.csh s2example<tt> and then run by typing <tt>s2example at the command prompt.

Experiment for yourself

Function Overview

For more information on the functions we have introduced so far, see:

Common Problems

Test code: s2points.c

This is the full test code for the point-drawing example.

Where to Next?

Personal tools