Function:s2slw
From S2PLOT
(Difference between revisions)
Revision as of 08:38, 27 October 2007 60.230.35.85 (Talk) ← Previous diff |
Current revision S2plot admin (Talk | contribs) |
||
Line 15: | Line 15: | ||
== See Also == | == See Also == | ||
<table> | <table> | ||
+ | <tr><td>[[Function:s2qlw| s2qlw]]</td><td>Query the line width. </td></tr> | ||
<tr><td>[[Function:s2sch | s2sch ]]</td><td>Set the character height in "arbitrary" units. </td></tr> | <tr><td>[[Function:s2sch | s2sch ]]</td><td>Set the character height in "arbitrary" units. </td></tr> | ||
</table> | </table> |
Current 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.