Create a 32×32
array Z
, where
Z(x,y) = exp(-((x/15)^2+(y/12)^2))
for -5 ≤ x ≤ 26
and -10 ≤ y ≤ 10
.
Display as a contour plot and as density plots.
The following script will perform the desired operations:
generate x -5,,26 32
generate y -10,,10 32
matrix z 32 32
do j=[1:32]
do k=[1:32]
z[k,j] = exp(-((x[j]/15)^2+(y[k]/12)^2))
enddo
enddo
window 5
contour\legend x y z 20
window 6
set colormap thermal
density x y z
window 7
density\diffusion x y z
window 8
density\dithering x y z
Read 32×24
elevation data from file e.dat.
Display as a contour map and as density plots.
read\matrix e.dat elevation 32 24
window 5
contour\legend elevation 15
window 6
set colormap topo256
density elevation
window 7
set colormap gray256
density elevation
window 8
density\diffusion elevation