Function:s2icm
From S2PLOT
(Difference between revisions)
Revision as of 03:03, 28 October 2007 S2plot admin (Talk | contribs) ← Previous diff |
Current revision S2plot admin (Talk | contribs) |
||
Line 13: | Line 13: | ||
Install various colour maps. Give map name as a string, and index range where you want the map installed. Available maps are: | Install various colour maps. Give map name as a string, and index range where you want the map installed. Available maps are: | ||
- | <table width=50%> | + | <table border=0> |
- | <tr><td>[[image:rainbow_cm.jpg]]</td><td width=40%>rainbow</td> | + | <tr> |
- | <td><img src="colmaps/0002.jpg"></td><td width=40%>grey, gray</td></tr> | + | <td>[[image:rainbow_cm.jpg]]</td><td width=40%>rainbow</td> |
- | <tr><td><img src="colmaps/0004.jpg"></td><td>terrain, topo</td> | + | <td>[[image:grey_cm.jpg]]</td><td width=40%>grey, gray</td> |
- | <td><img src="colmaps/0006.jpg"></td><td>iron, heated, hot</td></tr> | + | </tr> |
- | <tr><td><img src="colmaps/0008.jpg"></td><td>astro</td> | + | <tr> |
- | <td><img src="colmaps/0010.jpg"></td><td>alt, zebra</td> | + | <td>[[image:terrain_cm.jpg]]</td><td>terrain, topo</td> |
- | <tr><td><img src="colmaps/0012.jpg"></td><td>mgreen</td></tr> | + | <td>[[image:iron_cm.jpg]]</td><td>iron, heated, hot</td> |
+ | </tr> | ||
+ | <tr> | ||
+ | <td>[[image:astro_cm.jpg]]</td><td>astro</td> | ||
+ | <td>[[image:alt_cm.jpg]]</td><td>alt, zebra</td> | ||
+ | </tr> | ||
+ | <tr><td>[[image:mgreen_cm.jpg]]</td><td>mgreen</td></tr> | ||
</table> | </table> | ||
- | + | and may be preceeded by the exact string "<tt>inverse </tt>" (note the space is significant) to reverse the map direction. | |
- | + | ||
- | and may be preceeded by the exact string "inverse " (note the space is significant) to reverse the map direction. | + | |
== See Also == | == See Also == |
Current revision
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:
rainbow | grey, gray | ||
terrain, topo | iron, heated, hot | ||
astro | alt, zebra | ||
mgreen |
and may be preceeded by the exact string "inverse " (note the space is significant) to reverse the map direction.
See Also
struct_COLOUR | Data structure for (r,g,b) colour indices. |
ss2lcm | Load a colourmap into memory. |
PGPLOT Equivalent
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.