2. 2次元配列を用いた等高色分布図



ソースプログラム(Fortran 90,自動倍精度利用)
!******************************** ! 2D Graphic Sample No. 2 * ! Color Distribution * !******************************** program gsample2 implicit none integer, parameter :: imax = 20, jmax = 20 real f(0:imax,0:jmax) real xmin,xmax,ymax,dx,dy,x0,y0,x,y,ymin integer i,j call fr_ginit call fr_opencanvas(1,'gsample2',101) xmin = -3 xmax = 3 ymin = -2 ymax = 2 dx = (xmax - xmin)/imax dy = (ymax - ymin)/jmax x0 = 1 y0 = 0 do j = 0, jmax do i = 0, imax x=dx*i+xmin y=dy*j+ymin f(i,j)=exp(-0.5*((x-x0)**2+(y-y0)**2))-exp(-1.2*((x-1.5)**2+(y-0.5)**2)) enddo enddo call fr_margin2d(80,80,80,80) call fr_aspect2d(1.0,1.0,0) call fr_frame2d(xmin,xmax,ymin,ymax,0) call fr_xyname('re','im') call fr_contour(f,imax+1,jmax+1,20,-2) call fr_2dmove(1.0,0.5,3) call fr_colorbar(10,0,20,200,132) call fr_2dmove(0.5,1.0,3) call fr_colorbar(0,10,200,20,132) call fr_gend end program gsample2


Copyright (C) Toshihiro Taguchi, Setsunan University, 2000-2012 All rights reserved.