~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/examples/f77/x02f.fm4

  • 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
c      $Id: x02f.fm4 11680 2011-03-27 17:57:51Z airwin $
 
2
c      Demonstrates multiple windows and color map 0 
 
3
c
 
4
c      Copyright (C) 2004  Alan W. Irwin
 
5
c      Copyright (C) 2005  Andrew Ross
 
6
c
 
7
c      This file is part of PLplot.
 
8
c
 
9
c      PLplot is free software; you can redistribute it and/or modify
 
10
c      it under the terms of the GNU Library General Public License as
 
11
c      published by the Free Software Foundation; either version 2 of the
 
12
c      License, or (at your option) any later version.
 
13
c
 
14
c      PLplot is distributed in the hope that it will be useful,
 
15
c      but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
c      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
c      GNU Library General Public License for more details.
 
18
c
 
19
c      You should have received a copy of the GNU Library General Public
 
20
c      License along with PLplot; if not, write to the Free Software
 
21
c      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
22
 
 
23
      implicit none
 
24
 
 
25
      include 'plplot_parameters.h'
 
26
c      Process command-line arguments
 
27
      call plparseopts(PL_PARSE_FULL)
 
28
 
 
29
 
 
30
c     Initialize plplot
 
31
      call plinit()
 
32
 
 
33
c     Run demos
 
34
      call demo1
 
35
      call demo2
 
36
 
 
37
      call plend
 
38
 
 
39
      end
 
40
 
 
41
 
 
42
c--------------------------------------------------------------------------
 
43
c     demo1
 
44
c
 
45
c     Demonstrates multiple windows and default color map 0 palette.
 
46
c--------------------------------------------------------------------------
 
47
      subroutine demo1
 
48
      implicit none
 
49
      
 
50
      call plbop
 
51
 
 
52
c     Divide screen into 16 regions
 
53
      call plssub(4,4)
 
54
 
 
55
      call draw_windows(16, 0)
 
56
 
 
57
      call pleop
 
58
 
 
59
      end 
 
60
 
 
61
 
 
62
c--------------------------------------------------------------------------
 
63
c     demo2
 
64
c
 
65
c     Demonstrates multiple windows, user-modified color map 0 palette,
 
66
c     and HLS -> RGB translation. 
 
67
c--------------------------------------------------------------------------
 
68
      subroutine demo2
 
69
      implicit none
 
70
      integer r(116), g(116), b(116)
 
71
      real*8 lmin, lmax
 
72
      parameter (lmin = 0.15d0, lmax = 0.85d0)
 
73
      integer i
 
74
      real*8 h, l, s, r1, g1, b1
 
75
 
 
76
      call plbop
 
77
 
 
78
c     Divide screen into 100 regions
 
79
      call plssub(10,10)
 
80
 
 
81
 
 
82
      do i=0,99
 
83
c     Bounds on HLS, from plhlsrgb() commentary --
 
84
c     hue               [0., 360.]      degrees
 
85
c     lightness         [0., 1.]        magnitude
 
86
c     saturation        [0., 1.]        magnitude
 
87
 
 
88
c     Vary hue uniformly from left to right
 
89
         h = (360.d0/10.d0)*mod(i,10)
 
90
c     Vary lightness uniformly from top to bottom, between min and max
 
91
         l = lmin + (lmax - lmin) * (i / 10) / 9.d0
 
92
c     Use_ max saturation
 
93
         s = 1.d0
 
94
 
 
95
         call plhlsrgb(h, l, s, r1, g1, b1)
 
96
         
 
97
         r(i+17) = r1*255.001
 
98
         g(i+17) = g1*255.001
 
99
         b(i+17) = b1*255.001
 
100
      enddo
 
101
 
 
102
      do i=1,16
 
103
         call plgcol0(i-1,r(i),g(i),b(i))
 
104
      enddo
 
105
 
 
106
      call plscmap0(r, g, b, 116)
 
107
 
 
108
      call draw_windows(100, 16)
 
109
 
 
110
      call pleop
 
111
 
 
112
      end 
 
113
 
 
114
c--------------------------------------------------------------------------
 
115
c     draw_windows
 
116
c
 
117
c     Draws a set of numbered boxes with colors according to cmap0 entry.
 
118
c--------------------------------------------------------------------------
 
119
      subroutine draw_windows( nw, cmap0_offset )
 
120
      implicit none
 
121
      integer nw, cmap0_offset
 
122
      integer i,j
 
123
      real*8 vmin, vmax
 
124
      character*3 text
 
125
      
 
126
      
 
127
      call plschr(0.0d0, 3.5d0)
 
128
      call plfont(4)
 
129
 
 
130
      do i=0,nw-1
 
131
        call plcol0(i+cmap0_offset)
 
132
        write (text,'(i3)') i
 
133
        if (i .lt. 10) then
 
134
           text=text(3:3)
 
135
        elseif (i.lt.100) then
 
136
           text=text(2:3)
 
137
        endif
 
138
        call pladv(0)
 
139
        vmin = 0.1d0
 
140
        vmax = 0.9d0
 
141
        do j=1,3
 
142
          call plwid(j)
 
143
          call plvpor(vmin,vmax,vmin,vmax)
 
144
          call plwind(0.0d0, 1.0d0, 0.0d0, 1.0d0)
 
145
          call plbox('bc', 0.0d0, 0, 'bc', 0.0d0, 0)
 
146
          vmin = vmin + 0.1d0
 
147
          vmax = vmax - 0.1d0
 
148
        enddo
 
149
        call plwid(1)
 
150
        call plptex(0.5d0, 0.5d0, 1.0d0, 0.0d0, 0.5d0, text)
 
151
      enddo
 
152
 
 
153
      end