~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/examples/ada/x06a.adb

  • Committer: Joachim Erfle
  • Date: 2013-07-24 13:53:41 UTC
  • Revision ID: joachim.erfle@desy.de-20130724135341-1qojpp701zsn009p
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- $Id: x06a.adb 11680 2011-03-27 17:57:51Z airwin $
 
2
 
 
3
-- Displays the entire "plpoin" symbol (font) set.
 
4
 
 
5
-- Copyright (C) 2010 Jerry Bauck
 
6
 
 
7
-- This file is part of PLplot.
 
8
 
 
9
-- PLplot is free software; you can redistribute it and/or modify
 
10
-- it under the terms of the GNU Library General Public License as published
 
11
-- by the Free Software Foundation; either version 2 of the License, or
 
12
-- (at your option) any later version.
 
13
 
 
14
-- PLplot is distributed in the hope that it will be useful,
 
15
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
-- GNU Library General Public License for more details.
 
18
 
 
19
-- You should have received a copy of the GNU Library General Public License
 
20
-- along with PLplot; if not, write to the Free Software
 
21
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
22
 
 
23
with
 
24
    Ada.Strings,
 
25
    Ada.Strings.Fixed,
 
26
    Ada.Numerics,
 
27
    Ada.Numerics.Long_Elementary_Functions,
 
28
    PLplot_Auxiliary,
 
29
    PLplot_Traditional;
 
30
use
 
31
    Ada.Strings,
 
32
    Ada.Strings.Fixed,
 
33
    Ada.Numerics,
 
34
    Ada.Numerics.Long_Elementary_Functions,
 
35
    PLplot_Auxiliary,
 
36
    PLplot_Traditional;
 
37
 
 
38
 
 
39
 
 
40
procedure x06a is
 
41
 
 
42
    k, maxfont : Integer;
 
43
    x, y : Real_Vector(1 .. 1);
 
44
 
 
45
begin
 
46
    -- Parse and process command line arguments
 
47
    plparseopts(PL_PARSE_FULL); 
 
48
 
 
49
    -- Initialize plplot
 
50
    plinit;
 
51
 
 
52
    for Kind_Font in 0 .. 1 loop
 
53
        plfontld(Kind_Font);
 
54
        if Kind_Font = 0 then
 
55
            maxfont := 1;
 
56
        else
 
57
            maxfont := 4;
 
58
        end if;
 
59
 
 
60
        for font in 0 .. maxfont - 1 loop
 
61
            plfont(font + 1);
 
62
            pladv(0);
 
63
 
 
64
            -- Set up viewport and window
 
65
            plcol0(2);
 
66
            plvpor(0.1, 1.0, 0.1, 0.9);
 
67
            plwind(0.0, 1.0, 0.0, 1.3);
 
68
 
 
69
            -- Draw the grid using plbox
 
70
            plbox("bcg", 0.1, 0, "bcg", 0.1, 0);
 
71
 
 
72
            -- Write the digits below the frame
 
73
            plcol0(15);
 
74
            for i in 0 .. 9 loop
 
75
                plmtex("b", 1.5, (0.1 * Long_Float(i) + 0.05), 0.5, Trim(Integer'image(i), Left));
 
76
            end loop;
 
77
 
 
78
            k := 0;
 
79
            for i in 0 .. 12 loop
 
80
 
 
81
                -- Write the digits to the left of the frame
 
82
                plmtex("lv", 1.0, (1.0 - (2.0 * Long_Float(i) + 1.0) / 26.0), 1.0, Trim(Integer'image(10 * i), Left));
 
83
                for j in 0 .. 9 loop
 
84
                    x(1) := 0.1 * Long_Float(j) + 0.05;
 
85
                    y(1) := 1.25 - 0.1 * Long_Float(i);
 
86
 
 
87
                    -- Display the symbols (plpoin expects that x and y are arrays so
 
88
                    -- pass pointers)
 
89
                    if k < 128 then
 
90
                        plpoin(x, y, k);
 
91
                    end if;
 
92
                    k := k + 1;
 
93
                end loop;
 
94
            end loop;
 
95
 
 
96
            if Kind_Font = 0 then
 
97
                plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (compact)");
 
98
            else
 
99
                plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (extended)");
 
100
            end if;
 
101
        end loop; -- font
 
102
    end loop; -- Kind_Font
 
103
    plend;
 
104
 
 
105
end x06a;