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

  1. /* Displays the plotter symbols for PLPOIN */
  2.  
  3. #include "plplot.h"
  4. #include <stdio.h>
  5.  
  6. main()
  7. {
  8.    char text[3];
  9.    PLINT i, j, k;
  10.    PLFLT x, y;
  11.  
  12.    /* Full sized page for display */
  13.  
  14.    plstar(1,1);
  15.    pladv(0);
  16.  
  17.    /* Set up viewport and window */
  18.  
  19.    plvpor((PLFLT)0.1,(PLFLT)1.0,(PLFLT)0.1,(PLFLT)0.9);
  20.    plwind((PLFLT)0.0,(PLFLT)1.0,(PLFLT)0.0,(PLFLT)1.3);
  21.  
  22.    /* Draw the grid using plbox */
  23.  
  24.    plbox("bcgt",(PLFLT)0.1,0,"bcgt",(PLFLT)0.1,0);
  25.  
  26.    /* Write the digits below the frame */
  27.  
  28.    for (i=0; i<=9; i++) {
  29.      sprintf(text,"%d",i);
  30.      plmtex("b",(PLFLT)1.5,(PLFLT)(0.1*i+0.05),(PLFLT)0.5,text);
  31.    }
  32.  
  33.    k=0;
  34.    for (i=0; i<=12; i++)  {
  35.  
  36.       /* Write the digits to the left of the frame */
  37.  
  38.       sprintf(text,"%d",10*i);
  39.       plmtex("lv",1.0,1.0-(2*i+1)/26.0,1.0,text);
  40.       for (j=0; j<=9; j++) {
  41.         x=0.1*j+0.05;
  42.         y=1.25-0.1*i;
  43.  
  44.         /* Display the symbols (plpoin expects that x and y are arrays so */
  45.         /* pass pointers) */
  46.  
  47.         if (k < 128) plpoin(1,&x,&y,k);
  48.         k=k+1;
  49.       }
  50.    }
  51.  
  52.    plmtex("t",1.5,0.5,0.5,"PLPLOT Example 6 - PLPOIN symbols");
  53.    plend();
  54. }
  55.  
  56.  
  57.  
  58.  
  59.