Image obtained by using color PostScript driver (psc) and then converted to animated gif using ImageMagick convert tool.
1 2 #ifdef MSDOS 3 #pragma optimize("",off) 4 #endif 5 6 #pragma _ipath "./" 7 #include "plcdemos.h" 8 9 static int base[17] = 10 {0, 200, 500, 600, 700, 800, 900, 11 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900}; 12 13 14 int 15 main(int argc, char *argv[]) 16 { 17 char text[10]; 18 int i, j, k, l; 19 PLFLT x, y; 20 21 22 (void) plParseOpts(&argc, argv, PL_PARSE_FULL); 23 24 25 plinit(); 26 27 plfontld(1); 28 for (l = 0; l < 17; l++) { 29 pladv(0); 30 31 32 plcol0(2); 33 plvpor(0.15, 0.95, 0.1, 0.9); 34 plwind(0.0, 1.0, 0.0, 1.0); 35 36 37 plbox("bcgt", 0.1, 0, "bcgt", 0.1, 0); 38 39 40 plcol0(15); 41 for (i = 0; i <= 9; i++) { 42 sprintf(text, "%d", i); 43 plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, text); 44 } 45 46 k = 0; 47 for (i = 0; i <= 9; i++) { 48 49 50 sprintf(text, "%d", base[l] + 10 * i); 51 plmtex("lv", 1.0, (0.95 - 0.1 * i), 1.0, text); 52 for (j = 0; j <= 9; j++) { 53 x = 0.1 * j + 0.05; 54 y = 0.95 - 0.1 * i; 55 56 57 plsym(1, &x, &y, base[l] + k); 58 k = k + 1; 59 } 60 } 61 62 plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols"); 63 } 64 plend(); 65 exit(0); 66 }
Code description
- 1
- $Id: x07c.c,v 1.17 2002/12/03 08:39:24 airwin Exp $ Font demo.
- 13
- --------------------------------------------------------------------------*\ * main * * Displays the entire "plsym" symbol (font) set. \*--------------------------------------------------------------------------
- 21
- Parse and process command line arguments
- 24
- Initialize plplot
- 31
- Set up viewport and window
- 36
- Draw the grid using plbox
- 39
- Write the digits below the frame
- 49
- Write the digits to the left of the frame
- 56
- Display the symbols