1
! $Id: x03f.f90,v 1.1 2006/05/16 20:24:12 airwin Exp $
2
! Generates polar plot with, 1-1 scaling
4
! Copyright (C) 2004 Alan W. Irwin
6
! This file is part of PLplot.
8
! PLplot is free software; you can redistribute it and/or modify
9
! it under the terms of the GNU General Library Public License as
10
! published by the Free Software Foundation; either version 2 of the
11
! License, or (at your option) any later version.
13
! PLplot is distributed in the hope that it will be useful,
14
! but WITHOUT ANY WARRANTY; without even the implied warranty of
15
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
! GNU Library General Public License for more details.
18
! You should have received a copy of the GNU Library General Public
19
! License along with PLplot; if not, write to the Free Software
20
! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
use plplot, PI => PL_PI
26
real(kind=plflt) x0(0:360), y0(0:360)
27
real(kind=plflt) x(0:360), y(0:360), dtr, theta, dx, dy, r
29
! Process command-line arguments
30
call plparseopts(PL_PARSE_FULL)
35
x0(i) = cos(dtr * dble (i))
36
y0(i) = sin(dtr * dble (i))
43
! Set up viewport and window, but do not draw box
45
call plenv(-1.3_plflt, 1.3_plflt, -1.3_plflt, 1.3_plflt, 1, -2)
48
x(j) = 0.1_plflt*i*x0(j)
49
y(j) = 0.1_plflt*i*y0(j)
51
! Draw circles for polar grid
61
! Draw radial spokes for polar grid
63
call pljoin(0.0_plflt, 0.0_plflt, dx, dy)
64
write (text,'(i3)') nint(theta)
66
! Write labels for angle
68
text = text(nsp(text):)
69
! Slightly off zero to avoid floating point logic flips at
71
if (dx.ge.-0.00001_plflt) then
72
call plptex(dx, dy, dx, dy, -0.15_plflt, text)
74
call plptex(dx, dy, -dx, -dy, 1.15_plflt, text)
80
r = sin(dtr*dble (5*i))
88
call plmtex('t', 2.0_plflt, 0.5_plflt, 0.5_plflt, &
89
'#frPLplot Example 3 - r(#gh)=sin 5#gh')
91
! Close the plot at end
96
integer function nsp(text)
99
! Find first non-space character
108
do while(text(nsp:nsp).eq.' ' .and. nsp.lt.l)