home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 344b.lha / plplot_v2.6 / examples / example07.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-27  |  1.1 KB  |  60 lines

  1. /* Displays the plotter symbols for PLSYM */
  2.  
  3. #include "plplot.h"
  4. #include <stdio.h>
  5.  
  6. static int  base[17] = { 0, 200, 500, 600, 700, 800, 900,
  7.    2000,2100,2200,2300,2400,2500,2600,2700,2800,2900 };
  8.  
  9. main()
  10. {
  11.    char text[4];
  12.    int i, j, k, l;
  13.    float x, y;
  14.  
  15.    /* Full sized page for display */
  16.  
  17.    plstar(1,1);
  18.    plfontld(1);
  19.    for (l=0; l<17; l++)  {
  20.      pladv(0);
  21.  
  22.      /* Set up viewport and window */
  23.  
  24.      plvpor(0.1,1.0,0.1,0.9);
  25.      plwind(0.0,1.0,0.0,1.0);
  26.  
  27.      /* Draw the grid using plbox */
  28.  
  29.      plbox("bcgt",0.1,0,"bcgt",0.1,0);
  30.  
  31.      /* Write the digits below the frame */
  32.  
  33.      for (i=0; i<=9; i++)  {
  34.        sprintf(text,"%d",i);
  35.        plmtex("b",1.5,0.1*i+0.05,0.5,text);
  36.      }
  37.  
  38.      k=0;
  39.      for (i=0; i<=9; i++)  {
  40.  
  41.      /* Write the digits to the left of the frame */
  42.  
  43.        sprintf(text,"%d",base[l]+10*i);
  44.        plmtex("lv",1.0,0.95-0.1*i,1.0,text);
  45.        for (j=0; j<=9; j++) {
  46.          x=0.1*j+0.05;
  47.          y=0.95-0.1*i;
  48.  
  49.          /* Display the symbols */
  50.  
  51.          plsym(1,&x,&y,base[l]+k);
  52.          k=k+1;
  53.        }
  54.      }
  55.  
  56.      plmtex("t",1.5,0.5,0.5,"PLPLOT Example 7 - PLSYM symbols");
  57.    }
  58.    plend();
  59. }
  60.