Image obtained by using pbm driver and then converted to png.
1 #pragma package "../" 2 #include <chplplot.h> 3 4 5 int 6 main(int argc, char *argv[]) 7 { 8 int i, j; 9 PLFLT vmin, vmax; 10 char text[3]; 11 12 13 plssub(4, 4); 14 15 16 (void) plParseOpts(&argc, argv, PL_PARSE_FULL); 17 18 19 plinit(); 20 21 plschr(0.0, 3.5); 22 plfont(4); 23 24 for (i = 0; i <= 15; i++) { 25 plcol0(i); 26 sprintf(text, "%d", i); 27 pladv(0); 28 vmin = 0.1; 29 vmax = 0.9; 30 for (j = 0; j <= 2; j++) { 31 plwid(j + 1); 32 plvpor(vmin, vmax, vmin, vmax); 33 plwind(0.0, 1.0, 0.0, 1.0); 34 plbox("bc", 0.0, 0, "bc", 0.0, 0); 35 vmin = vmin + 0.1; 36 vmax = vmax - 0.1; 37 } 38 plwid(1); 39 plptex(0.5, 0.5, 1.0, 0.0, 0.5, text); 40 } 41 42 plend(); 43 exit(0); 44 }
Code description
- 1
- $Id: x02c.c,v 1.14 2002/12/03 08:39:24 airwin Exp $ Multiple window and color map 0 demo.
- 4
- --------------------------------------------------------------------------*\ * main * * Demonstrates multiple windows and default color map 0 palette. \*--------------------------------------------------------------------------
- 12
- Divide screen into 16 regions
- 15
- Parse and process command line arguments
- 18
- Initialize plplot