/usr/share/doc/libplplot11/examples/f77/x11f.f is in libplplot-dev 5.9.9-2ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | c $Id: x11f.fm4 11680 2011-03-27 17:57:51Z airwin $
c Mesh plot demo
c
c Copyright (C) 2004 Alan W. Irwin
c
c This file is part of PLplot.
c
c PLplot is free software; you can redistribute it and/or modify
c it under the terms of the GNU Library General Public License as
c published by the Free Software Foundation; either version 2 of the
c License, or (at your option) any later version.
c
c PLplot is distributed in the hope that it will be useful,
c but WITHOUT ANY WARRANTY; without even the implied warranty of
c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c GNU Library General Public License for more details.
c
c You should have received a copy of the GNU Library General Public
c License along with PLplot; if not, write to the Free Software
c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
implicit none
include 'plplot_parameters.h'
integer i, j, k, ifshade, xpts, ypts
parameter (xpts=35, ypts=46)
real*8 x(xpts), y(ypts), z(xpts,ypts), xx, yy
character*80 title(2)
real*8 alt(2),az(2)
integer opt(2)
data alt /33.0d0,17.0d0/
data az /24.0d0,115.0d0/
c DRAW_LINEXY = 3
data opt /2*3/
data title /'#frPLplot Example 11 - Alt=33, Az=24, Opt=3',
& '#frPLplot Example 11 - Alt=17, Az=115, Opt=3'/
integer nlevel
parameter (nlevel = 10)
real*8 zmin, zmax, step, clevel(nlevel)
c Process command-line arguments
call plparseopts(PL_PARSE_FULL)
do i = 1,xpts
x(i) = 3.d0*dble(i-1-(xpts/2))/dble (xpts/2)
enddo
do j = 1,ypts
y(j) = 3.d0*dble(j-1-(ypts/2))/dble (ypts/2)
enddo
do i=1,xpts
xx = x(i)
do j=1,ypts
yy = y(j)
z(i,j) = 3.d0 * (1.d0-xx)*(1.d0-xx) *
& exp(-(xx*xx) - (yy+1.d0)*(yy+1.d0)) -
& 10.d0 * (xx/5.d0 - xx**3 - yy**5) * exp(-xx*xx-yy*yy) -
& 1.d0/3.d0 * exp(-(xx+1.d0)*(xx+1.d0) - (yy*yy))
if(.false.) then
c Jungfraujoch/Interlaken
if(z(i,j).lt.-1.d0) z(i,j) = -1.d0
endif
enddo
enddo
call a2mnmx(z, xpts, ypts, zmin, zmax)
step = (zmax-zmin)/(nlevel+1)
do i = 1, nlevel
clevel(i) = zmin + step*i
enddo
call plinit()
call cmap1_init(0)
do k=1,2
do ifshade = 0, 3
call pladv(0)
call plcol0(1)
call plvpor(0.0d0, 1.0d0, 0.0d0, 0.9d0 )
call plwind(-1.0d0, 1.0d0, -1.0d0, 1.5d0 )
call plw3d(1.0d0, 1.0d0, 1.2d0, -3.0d0,
& 3.0d0, -3.0d0, 3.0d0, zmin, zmax, alt(k),az(k))
call plbox3('bnstu','x axis', 0.0d0, 0,
& 'bnstu', 'y axis', 0.0d0, 0,
& 'bcdmnstuv','z axis', 0.0d0, 0)
call plcol0(2)
if(ifshade.eq.0) then
c wireframe plot
call plmesh(x, y, z, xpts, ypts,
& opt(k),
& xpts)
elseif(ifshade.eq.1) then
c magnitude colored wireframe plot
call plmesh(x, y, z, xpts, ypts,
& ior(opt(k), MAG_COLOR),
& xpts)
elseif(ifshade.eq.2) then
c magnitude colored wireframe plot with sides
call plot3d(x, y, z, xpts, ypts,
& ior(opt(k), MAG_COLOR),
& 1, xpts)
elseif(ifshade.eq.3) then
c magnitude colored wireframe plot with base contour
call plmeshc(x, y, z, xpts, ypts,
& ior(opt(k), ior(MAG_COLOR, BASE_CONT)),
& clevel, nlevel, xpts)
else
stop 'x11f: bad logic'
endif
call plcol0(3)
call plmtex('t', 1.0d0, 0.5d0, 0.5d0, title(k))
enddo
enddo
call plend
end
c----------------------------------------------------------------------------
subroutine cmap1_init(gray)
c For gray.eq.1, basic grayscale variation from half-dark
c to light. Otherwise, hue variations around the front of the
c colour wheel from blue to green to red with constant lightness
c and saturation.
implicit none
integer gray
real*8 i(0:1), h(0:1), l(0:1), s(0:1)
integer rev(0:1)
c left boundary
i(0) = 0.d0
c right boundary
i(1) = 1.d0
if (gray.eq.1) then
c hue -- low: red (arbitrary if s=0)
h(0) = 0.0d0
c hue -- high: red (arbitrary if s=0)
h(1) = 0.0d0
c lightness -- low: half-dark
l(0) = 0.5d0
c lightness -- high: light
l(1) = 1.0d0
c minimum saturation
s(0) = 0.0d0
c minimum saturation
s(1) = 0.0d0
else
c This combination of hues ranges from blue to cyan to green to yellow
c to red (front of colour wheel) with constant lightness = 0.6
c and saturation = 0.8.
c hue -- low: blue
h(0) = 240.d0
c hue -- high: red
h(1) = 0.0d0
c lightness -- low:
l(0) = 0.6d0
c lightness -- high:
l(1) = 0.6d0
c saturation
s(0) = 0.8d0
c minimum saturation
s(1) = 0.8d0
endif
rev(0) = 0
rev(1) = 0
call plscmap1n(256)
call plscmap1l(0, 2, i, h, l, s, rev)
end
c----------------------------------------------------------------------------
c Subroutine a2mnmx
c Minimum and the maximum elements of a 2-d array.
subroutine a2mnmx(f, nx, ny, fmin, fmax)
implicit none
integer i, j, nx, ny
real*8 f(nx, ny), fmin, fmax
fmax = f(1, 1)
fmin = fmax
do j = 1, ny
do i = 1, nx
fmax = max(fmax, f(i, j))
fmin = min(fmin, f(i, j))
enddo
enddo
end
|