Function:s2icm

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 03:02, 28 October 2007
S2plot admin (Talk | contribs)

← Previous diff
Revision as of 03:03, 28 October 2007
S2plot admin (Talk | contribs)

Next diff →
Line 14: Line 14:
<table width=50%> <table width=50%>
-<tr><td>[[IMG:rainbow_cm.jpg]]</td><td width=40%>rainbow</td>+<tr><td>[IMG:rainbow_cm.jpg]</td><td width=40%>rainbow</td>
<td><img src="colmaps/0002.jpg"></td><td width=40%>grey, gray</td></tr> <td><img src="colmaps/0002.jpg"></td><td width=40%>grey, gray</td></tr>
<tr><td><img src="colmaps/0004.jpg"></td><td>terrain, topo</td> <tr><td><img src="colmaps/0004.jpg"></td><td>terrain, topo</td>

Revision as of 03:03, 28 October 2007

s2icm

Install various colour maps.

Prototype

int s2icm(char *mapname, int idx1, int idx2);

Description

Install various colour maps. Give map name as a string, and index range where you want the map installed. Available maps are:

</table>


and may be preceeded by the exact string "inverse " (note the space is significant) to reverse the map direction.

See Also

[IMG:rainbow_cm.jpg]rainbow <img src="colmaps/0002.jpg">grey, gray
<img src="colmaps/0004.jpg">terrain, topo <img src="colmaps/0006.jpg">iron, heated, hot
<img src="colmaps/0008.jpg">astro <img src="colmaps/0010.jpg">alt, zebra
<img src="colmaps/0012.jpg">mgreen
struct_COLOUR Data structure for (r,g,b) colour indices.
ss2lcm Load a colourmap into memory.

PGPLOT Equivalent

PGSITF

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 = 100;					/* Number of points */
   float x[100], y[100], z[100];		/* Coordinates of points */
   int symbol = 1;				/* Point symbol */
   int col1, col2;				/* Colour index range */

   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 */

   s2slw(5);					/* Sets size of point */
   s2qcir(&col1, &col2);			/* Query the colour range */
   
   col1 = col2;				
   col2 = col2 + N;
   s2scir(col1, col2);				/* Set the colour index range */
   s2icm("mgreen", col1, col2);			/* Install a colour map */

   for (i=0;i<N;i++) {
      s2sci(col1+i);				/* Set the colour */
      s2pt1(x[i],y[i],z[i],symbol);		/* Draw a single point */
   }
   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.

Personal tools