Function:s2slw
From S2PLOT
Revision as of 02:26, 23 November 2007; view current revision
←Older revision | Newer revision→
←Older revision | Newer revision→
s2slw
Set the linewidth in pixels.
Prototype
void s2slw(float width);
Description
Set the linewidth in pixels. The default is 1. Changing the line width affects lines and vector symbols. Unlike PGPLOT, text is not affected.
See Also
s2qlw | Query the line width. |
s2sch | Set the character height in "arbitrary" units. |
PGPLOT Equivalent
Code Example
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "s2plot.h"
int main(int argc, char *argv[])
{
float x[10], y[10], z[10]; /* Arrays of coordinate points */
int N = 10; /* Number of points */
int Nl = 3; /* Number of line widths */
int i, j; /* Loop variables */
float width = 1; /* Line width */
srand48((long)time(NULL)); /* Seed random numbers */
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 */
for (j=0;j<Nl;j++) {
for (i=0;i<N;i++) {
x[i] = drand48()*2.0 - 1.0; /* Random (x,y,z) coordinates */
y[i] = drand48()*2.0 - 1.0;
z[i] = drand48()*2.0 - 1.0;
}
s2sci((j%15)+1); /* Set colour */
width = 2.0*(float)(j+1); /* Line width */
s2slw(width); /* Set line width */
s2line(N, x, y, z); /* Draw the poly-line */
}
s2show(1); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.