Function:s2sch

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 08:39, 27 October 2007
60.230.35.85 (Talk)

← Previous diff
Revision as of 02:27, 23 November 2007
S2plot admin (Talk | contribs)

Next diff →
Line 15: Line 15:
== See Also == == See Also ==
<table> <table>
 +<tr><td>[[Function:s2qch | s2qch ]]</td><td>Query the character height. </td></tr>
<tr><td>[[Function:s2slw | s2slw ]]</td><td>Set the linewidth in pixels. </td></tr> <tr><td>[[Function:s2slw | s2slw ]]</td><td>Set the linewidth in pixels. </td></tr>
</table> </table>

Revision as of 02:27, 23 November 2007

s2sch

Set the character height in "arbitrary" units.

Prototype

void s2sch(float size);

Description

Set the character height in "arbitrary" units. The default character size is 1.0, corresponding to a character about 15 pixels in size. Changing the character height also changes the scale of tick marks and symbols.

See Also

s2qch Query the character height.
s2slw Set the linewidth in pixels.

PGPLOT Equivalent

PGSCH

Code Example

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

int main(int argc, char *argv[])
{
   float x = 0.0;				/* Text location */
   float y = 0.0;
   float z = 0.0; 
   int N = 4;					/* Number of strings */
   int i;					/* Loop variable */
   float height;				/* Height of text */
   char string[32];				/* String of text */

   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 (i=0;i<N;i++) {
      s2sci((i%15)+1);				/* Set the colour */
      height = (i+1)*0.3;			
      sprintf(string,"Height = %.1f\n",height);	/* Create the string */
      x = drand48()*1.6 - 0.8;			/* Random text location */
      y = drand48()*1.6 - 0.8;
      z = drand48()*1.6 - 0.8;
      s2sch(height);			/* Set text height */
      s2textxy(x,y,z,string);			/* Write some text in x-y plane */
   }

   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools