ソースコードの所在: /home/kizu/pgplot/samples/pgex12.f
(このプログラムで描ける絵は、こちら)
PROGRAM PGEX12
C-----------------------------------------------------------------------
C Test routine for PGPLOT: draw arrows with PGARRO.
C-----------------------------------------------------------------------
INTEGER NV, I, K, PGOPEN
REAL A, D, X, Y, XT, YT
C
C Number of arrows.
C
NV =16
C
C Call PGOPEN to initiate PGPLOT and open the output device; PGOPEN
C will prompt the user to supply the device name and type. Always
C check the return code from PGOPEN.
C
IF (PGOPEN('?') .LE. 0) STOP
C
C Select a square viewport.
C
CALL PGBBUF
CALL PGSAVE
CALL PGSCH(0.7)
CALL PGSCI(2)
CALL PGENV(-1.05,1.05,-1.05,1.05,1,-1)
CALL PGLAB(' ', ' ', 'PGPLOT Example 12: PGARRO')
CALL PGSCI(1)
C
C Draw the arrows
C
K = 1
D = 360.0/57.29577951/NV
A = -D
DO 20 I=1,NV
A = A+D
X = COS(A)
Y = SIN(A)
XT = 0.2*COS(A-D)
YT = 0.2*SIN(A-D)
CALL PGSAH(K, 80.0-3.0*I, 0.5*REAL(I)/REAL(NV))
CALL PGSCH(0.25*I)
CALL PGARRO(XT, YT, X, Y)
K = K+1
IF (K.GT.2) K=1
20 CONTINUE
C
CALL PGUNSA
CALL PGEBUF
C
C Finally, call PGCLOS to terminate things properly.
C
CALL PGCLOS
C
END