1
! $Id: x02f.f90 11680 2011-03-27 17:57:51Z airwin $
2
! Demonstrates multiple windows and color map 0
4
! Copyright (C) 2004 Alan W. Irwin
5
! Copyright (C) 2005 Andrew Ross
7
! This file is part of PLplot.
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
11
! published by the Free Software Foundation; either version 2 of the
12
! License, or (at your option) any later version.
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.
19
! You should have received a copy of the GNU Library General Public
20
! License along with PLplot; if not, write to the Free Software
21
! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26
! Process command-line arguments
27
call plparseopts(PL_PARSE_FULL)
42
!--------------------------------------------------------------------------
45
! Demonstrates multiple windows and default color map 0 palette.
46
!--------------------------------------------------------------------------
53
! Divide screen into 16 regions
56
call draw_windows(16, 0)
63
!--------------------------------------------------------------------------
66
! Demonstrates multiple windows, user-modified color map 0 palette,
67
! and HLS -> RGB translation.
68
!--------------------------------------------------------------------------
72
integer r(116), g(116), b(116)
73
real(kind=plflt) lmin, lmax
74
parameter (lmin = 0.15_plflt, lmax = 0.85_plflt)
76
real(kind=plflt) h, l, s, r1, g1, b1
80
! Divide screen into 100 regions
85
! Bounds on HLS, from plhlsrgb() commentary --
86
! hue [0., 360.] degrees
87
! lightness [0., 1.] magnitude
88
! saturation [0., 1.] magnitude
90
! Vary hue uniformly from left to right
91
h = (360._plflt/10._plflt)*mod(i,10)
92
! Vary lightness uniformly from top to bottom, between min and max
93
l = lmin + (lmax - lmin) * (i / 10) / 9._plflt
97
call plhlsrgb(h, l, s, r1, g1, b1)
105
call plgcol0(i-1,r(i),g(i),b(i))
108
call plscmap0(r, g, b)
110
call draw_windows(100, 16)
116
!--------------------------------------------------------------------------
119
! Draws a set of numbered boxes with colors according to cmap0 entry.
120
!--------------------------------------------------------------------------
121
subroutine draw_windows( nw, cmap0_offset )
124
integer nw, cmap0_offset
126
real(kind=plflt) vmin, vmax
130
call plschr(0.0_plflt, 3.5_plflt)
134
call plcol0(i+cmap0_offset)
135
write (text,'(i3)') i
138
elseif (i.lt.100) then
146
call plvpor(vmin,vmax,vmin,vmax)
147
call plwind(0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt)
148
call plbox('bc', 0.0_plflt, 0, 'bc', 0.0_plflt, 0)
149
vmin = vmin + 0.1_plflt
150
vmax = vmax - 0.1_plflt
153
call plptex(0.5_plflt, 0.5_plflt, 1.0_plflt, 0.0_plflt, 0.5_plflt, text)