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

  1. /* Defines a "standard" viewport with seven character heights for   */
  2. /* the left margin and four character heights everywhere else       */
  3.  
  4. #include "plplot.h"
  5.  
  6. void plvsta()
  7. {
  8.     PLFLT xmin, xmax, ymin, ymax;
  9.     PLFLT chrdef, chrht, spdxmi, spdxma, spdymi, spdyma;
  10.     PLINT level;
  11.  
  12.     glev(&level);
  13.     if (level < 1) plexit("Please call plstar before calling plvsta.");
  14.  
  15.     gchr(&chrdef,&chrht);
  16.     gspd(&spdxmi,&spdxma,&spdymi,&spdyma);
  17.  
  18. /*  Find out position of subpage boundaries in millimetres, reduce by */
  19. /*  the desired border, and convert back into normalized subpage */
  20. /*  coordinates */
  21.  
  22.     xmin = dcscx(mmdcx((PLFLT)(dcmmx(spdxmi) + 7 * chrht)));
  23.     xmax = dcscx(mmdcx((PLFLT)(dcmmx(spdxma) - 4 * chrht)));
  24.     ymin = dcscy(mmdcy((PLFLT)(dcmmy(spdymi) + 4 * chrht)));
  25.     ymax = dcscy(mmdcy((PLFLT)(dcmmy(spdyma) - 4 * chrht)));
  26.  
  27.     plvpor(xmin,xmax,ymin,ymax);
  28. }
  29.