Image obtained by using pbm driver and then converted to png.
1 2 #include "plcdemos.h" 3 4 5 int 6 main(int argc, char *argv[]) 7 { 8 char text[10]; 9 int i, j, k; 10 PLFLT x, y; 11 12 13 (void) plParseOpts(&argc, argv, PL_PARSE_FULL); 14 15 16 plinit(); 17 18 pladv(0); 19 20 21 plcol0(2); 22 plvpor(0.1, 1.0, 0.1, 0.9); 23 plwind(0.0, 1.0, 0.0, 1.3); 24 25 26 plbox("bcgt", 0.1, 0, "bcgt", 0.1, 0); 27 28 29 plcol0(15); 30 for (i = 0; i <= 9; i++) { 31 sprintf(text, "%d", i); 32 plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, text); 33 } 34 35 k = 0; 36 for (i = 0; i <= 12; i++) { 37 38 39 sprintf(text, "%d", 10 * i); 40 plmtex("lv", 1.0, (1.0 - (2 * i + 1) / 26.0), 1.0, text); 41 for (j = 0; j <= 9; j++) { 42 x = 0.1 * j + 0.05; 43 y = 1.25 - 0.1 * i; 44 45 46 if (k < 128) 47 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 exit(0); 55 }
Code description
- 1
- $Id: x06c.c,v 1.15 2002/12/03 08:39:24 airwin Exp $ Font demo.
- 4
- --------------------------------------------------------------------------*\ * main * * Displays the entire "plpoin" symbol (font) set. \*--------------------------------------------------------------------------
- 12
- Parse and process command line arguments
- 15
- Initialize plplot
- 20
- Set up viewport and window
- 25
- Draw the grid using plbox
- 28
- Write the digits below the frame
- 38
- Write the digits to the left of the frame
- 45
- Display the symbols (plpoin expects that x and y are arrays so
- 45
- pass pointers)