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

  1. /* Demonstrates multiple windows */
  2.  
  3. #include "plplot.h"
  4. #include <stdio.h>
  5. #include <math.h>
  6.  
  7. main()
  8. {
  9.       PLINT i,j;
  10.       PLFLT vmin,vmax;
  11.       char text[3];
  12.  
  13.      /* Divide screen into 16 regions */
  14.       plstar(4,4);
  15.       plschr((PLFLT)0.0,(PLFLT)3.5);
  16.       plfont(4);
  17.  
  18.       for (i=0; i<=15; i++) {
  19.         plcol(i/4+1);
  20.         sprintf(text,"%d",i);
  21.         pladv(0);
  22.         vmin = 0.1;
  23.         vmax = 0.9;
  24.         for (j=0; j<=2; j++) {
  25.           plwid(j+1);
  26.           plvpor(vmin,vmax,vmin,vmax);
  27.           plwind((PLFLT)0.0,(PLFLT)1.0,(PLFLT)0.0,(PLFLT)1.0);
  28.           plbox("bc",(PLFLT)0.0,0,"bc",(PLFLT)0.0,0);
  29.           vmin = vmin + 0.1;
  30.           vmax = vmax - 0.1;
  31.         }
  32.         plwid(1);
  33.         plptex((PLFLT)0.5,(PLFLT)0.5,(PLFLT)1.0,(PLFLT)0.0,(PLFLT)0.5,text);
  34.       }
  35.  
  36.       plend();
  37. }
  38.  
  39.