From: <and...@us...> - 2008-12-16 14:13:52
|
Revision: 9134 http://plplot.svn.sourceforge.net/plplot/?rev=9134&view=rev Author: andrewross Date: 2008-12-16 14:13:49 +0000 (Tue, 16 Dec 2008) Log Message: ----------- Update f77 and f95 examples to reflect recent changes and to include the new example 31. Modified Paths: -------------- trunk/examples/f77/CMakeLists.txt trunk/examples/f77/x01f.fm4 trunk/examples/f77/x03f.fm4 trunk/examples/f77/x09f.fm4 trunk/examples/f77/x13f.fm4 trunk/examples/f77/x15f.fm4 trunk/examples/f77/x29f.fm4 trunk/examples/f95/CMakeLists.txt trunk/examples/f95/x01f.f90 trunk/examples/f95/x03f.f90 trunk/examples/f95/x09f.f90 trunk/examples/f95/x13f.f90 trunk/examples/f95/x15f.f90 trunk/examples/f95/x29f.f90 trunk/plplot_test/test_f77.sh.in trunk/plplot_test/test_f95.sh.in Added Paths: ----------- trunk/examples/f77/x31f.fm4 Modified: trunk/examples/f77/CMakeLists.txt =================================================================== --- trunk/examples/f77/CMakeLists.txt 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f77/CMakeLists.txt 2008-12-16 14:13:49 UTC (rev 9134) @@ -52,6 +52,7 @@ "28" "29" "30" +"31" ) foreach(STRING_INDEX ${f77_STRING_INDICES}) Modified: trunk/examples/f77/x01f.fm4 =================================================================== --- trunk/examples/f77/x01f.fm4 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f77/x01f.fm4 2008-12-16 14:13:49 UTC (rev 9134) @@ -35,16 +35,14 @@ C Process command-line arguments call plparseopts(PL_PARSE_FULL) -C Divide page into 2x2 plots - call plssub(2, 2) - C Print plplot version call plgver(version) write (*,'(a,a)') 'PLplot library version: ', & version(:lnblnk(version)) C Initialize plplot - call plinit() +C Divide page into 2x2 plots + call plstar(2,2) C Set up the data C Original case Modified: trunk/examples/f77/x03f.fm4 =================================================================== --- trunk/examples/f77/x03f.fm4 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f77/x03f.fm4 2008-12-16 14:13:49 UTC (rev 9134) @@ -32,6 +32,9 @@ C Process command-line arguments call plparseopts(PL_PARSE_FULL) +C Set orientation to landscape - note not all device drivers +C support this, in particular most interactive drivers do not. + call plsori(1) dtr = PI/180.0d0 do i=0,360 Modified: trunk/examples/f77/x09f.fm4 =================================================================== --- trunk/examples/f77/x09f.fm4 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f77/x09f.fm4 2008-12-16 14:13:49 UTC (rev 9134) @@ -87,6 +87,7 @@ call plinit C Plot using identity transform + call pl_setcontlabelformat(4,3) call pl_setcontlabelparam(0.006d0, 0.3d0, 0.1d0, 1) call plenv(-1.0d0, 1.0d0, -1.0d0, 1.0d0, 0, 0) call plcol0(2) Modified: trunk/examples/f77/x13f.fm4 =================================================================== --- trunk/examples/f77/x13f.fm4 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f77/x13f.fm4 2008-12-16 14:13:49 UTC (rev 9134) @@ -42,7 +42,12 @@ call plinit() - call plenv( 0.d0, 10.d0, 0.d0, 10.d0, 1, -2 ) + call pladv(0) +C Ensure window has aspect ratio of one so circle is +C plotted as a circle. + call plvasp(1.0d0) + call plwind(0.d0, 10.d0, 0.d0, 10.d0) +C call plenv( 0.d0, 10.d0, 0.d0, 10.d0, 1, -2 ) call plcol0(2) C n.b. all theta quantities scaled by 2*pi/500 to be integers to avoid Modified: trunk/examples/f77/x15f.fm4 =================================================================== --- trunk/examples/f77/x15f.fm4 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f77/x15f.fm4 2008-12-16 14:13:49 UTC (rev 9134) @@ -59,6 +59,7 @@ call plot1(z, XPTS, YPTS, zmin, zmax, xdim) call plot2(z, XPTS, YPTS, zmin, zmax, xdim) + call plot3() call plend() end @@ -226,8 +227,20 @@ real*8 shade_min, shade_max, sh_color integer sh_cmap, sh_width integer min_color, min_width, max_color, max_width - integer i + integer i,j + integer nlin(10), inc(2,10), del(2,10) + data nlin /1, 1, 1, 1, 1, 2, 2, 2, 2, 2/ + data ( (inc(i,j), i=1,2), j=1,10) / + & 450, 0, -450, 0, 0, 0, 900, 0, + & 300, 0, 450,-450, 0, 900, 0, 450, + & 450, -450, 0, 900/ + data ( (del(i,j), i=1,2), j=1,10) / + & 2000, 2000, 2000, 2000, 2000, 2000, + & 2000, 2000, 2000, 2000, 2000, 2000, + & 2000, 2000, 2000, 2000, 4000, 4000, + & 4000, 2000/ + sh_cmap = 0 min_color = 0 min_width = 0 @@ -245,7 +258,7 @@ shade_min = zmin + (zmax - zmin) * (i-1) / 10.0d0 shade_max = zmin + (zmax - zmin) * i / 10.0d0 sh_color = i+5 - call plpsty(mod((i + 1),8) + 1) + call plpat(nlin(i),inc(1,i),del(1,i)) C Use_ plshade0 instead of plshade1 - identity mapping call plshade0(z, XPTS, YPTS, undefined, & -1.d0, 1.d0, -1.d0, 1.d0, @@ -258,7 +271,48 @@ call plbox('bcnst', 0.0d0, 0, 'bcnstv', 0.0d0, 0) call plcol0(2) call pllab('distance', 'altitude', 'Bogon flux') + + end +C-------------------------------------------------------------------------- +C plot3 +C +C Illustrates shaded regions in 3d, using a different fill pattern for +C each region. +C-------------------------------------------------------------------------- + + subroutine plot3 + implicit none + real*8 xx1(5), xx2(5), yy1(5), yy2(5), zz1(5), zz2(5) + data xx1 / -1.0d0, 1.0d0, 1.0d0, -1.0d0, -1.0d0/ + data xx2 / -1.0d0, 1.0d0, 1.0d0, -1.0d0, -1.0d0/ + data yy1 /1.0d0, 1.0d0, 0.0d0, 0.0d0, 1.0d0/ + data yy2 / -1.0d0, -1.0d0, 0.0d0, 0.0d0, -1.0d0/ + data zz1 / 0.0d0, 0.0d0, 1.0d0, 1.0d0, 0.0d0/ + data zz2 / 0.0d0, 0.0d0, 1.0d0, 1.0d0, 0.0d0/ + + call pladv(0) + call plvpor(0.1d0, 0.9d0, 0.1d0, 0.9d0) + call plwind(-1.0d0, 1.0d0, -1.0d0, 1.0d0) + call plw3d(1.d0, 1.d0, 1.d0, -1.0d0, 1.0d0, -1.0d0, 1.0d0, 0.0d0, + & 1.5d0, 30.d0, -40.d0) + +C Plot using identity transform + + call plcol0(1) + call plbox3("bntu", "X", 0.0d0, 0, "bntu", "Y", 0.0d0, 0, + & "bcdfntu", "Z", 0.5d0, 0) + call plcol0(2) + call pllab("","","3-d polygon filling") + + call plcol0(3) + call plpsty(1) + call plline3(5, xx1, yy1, zz1) + call plfill3(4, xx1, yy1, zz1) + call plpsty(2) + call plline3(5, xx2, yy2, zz2) + call plfill3(4, xx2, yy2, zz2) + end C---------------------------------------------------------------------------- Modified: trunk/examples/f77/x29f.fm4 =================================================================== --- trunk/examples/f77/x29f.fm4 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f77/x29f.fm4 2008-12-16 14:13:49 UTC (rev 9134) @@ -25,8 +25,9 @@ implicit none - real*8 x(365), y(365) - common /plotdat/ x, y + real*8 x(365), y(365), xerr1(365), xerr2(365), yerr1(365), + & yerr2(365) + common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 integer PL_PARSE_FULL parameter(PL_PARSE_FULL = 1) @@ -35,6 +36,9 @@ call plinit() +C This is the ASCII value for character @ + call plsesc(64) + call plot1() call plot2() call plot3() @@ -49,13 +53,14 @@ subroutine plot1() implicit none - real*8 x(365), y(365) - common /plotdat/ x, y + real*8 x(365), y(365), xerr1(365), xerr2(365), yerr1(365), + & yerr2(365) + common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 integer i, npts real*8 xmin, xmax, ymin, ymax - parameter(npts = 145) + parameter(npts = 73) parameter(xmin = 0.0d0) parameter(xmax = 60.0d0*60.0d0*24.0d0) parameter(ymin = 10.0d0) @@ -67,9 +72,21 @@ do i = 1,npts x(i) = xmax*(dble(i-1)/dble(npts)) y(i) = 15.0d0 - 5.0d0*cos(2.0d0*PI*dble(i-1)/dble(npts)) +C Set x error bars to +/- 5 minute + xerr1(i) = x(i)-60.0d0*5.0d0 + xerr2(i) = x(i)+60.0d0*5.0d0 +C Set y error bars to +/- 0.1 deg C + yerr1(i) = y(i)-0.1d0 + yerr2(i) = y(i)+0.1d0 enddo call pladv(0) + +C Rescale major ticks marks by 0.5 + call plsmaj(0.0d0,0.5d0) +C Rescale minor ticks and error bar marks by 0.5 + call plsmin(0.0d0,0.5d0) + call plvsta() call plwind(xmin, xmax, ymin, ymax) @@ -81,12 +98,20 @@ call plcol0(3) call pllab("Time (hours:mins)", "Temperature (degC)", - & "#frPLplot Example 29 - Daily temperature") + & "@frPLplot Example 29 - Daily temperature") call plcol0(4) call plline(npts, x, y) + call plcol0(2) + call plerrx(npts, xerr1, xerr2, y) + call plcol0(3) + call plerry(npts, x, yerr1, yerr2) +C Rescale major / minor tick marks back to default + call plsmin(0.0d0,1.0d0) + call plsmaj(0.0d0,1.0d0) + end c @@ -98,8 +123,9 @@ integer j, npts real*8 xmin, xmax, ymin, ymax real*8 lat, p, d - real*8 x(365), y(365) - common /plotdat/ x, y + real*8 x(365), y(365), xerr1(365), xerr2(365), yerr1(365), + & yerr2(365) + common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 c Latitude for London @@ -131,15 +157,18 @@ call plcol0(1) c Set time format to be abbreviated month name followed by day of month call pltimefmt("%b %d") + call plprec(1,1) call plenv(xmin, xmax, ymin, ymax, 0, 40) call plcol0(3) call pllab("Date", "Hours of daylight", - & "#frPLplot Example 29 - Hours of daylight at 51.5N") + & "@frPLplot Example 29 - Hours of daylight at 51.5N") call plcol0(4) call plline(npts, x, y) + + call plprec(0,0) end @@ -153,8 +182,9 @@ real*8 xmin, xmax, ymin, ymax integer tstart, t1, t2 real*8 toff; - real*8 x(365), y(365) - common /plotdat/ x, y + real*8 x(365), y(365), xerr1(365), xerr2(365), yerr1(365), + & yerr2(365) + common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 real*8 PI parameter (PI = 3.1415926535897932384d0) @@ -194,11 +224,12 @@ call plcol0(3) call pllab("Date", "Hours of television watched", - & "#frPLplot Example 29 - Hours of television watched in " // - & "Dec 2005 / Jan 2006"); + & "@frPLplot Example 29 - Hours of television watched in " // + & "Dec 2005 / Jan 2006") call plcol0(4) + call plssym(0.0d0,0.5d0) call plpoin(npts, x, y, 2) call plline(npts, x, y) Added: trunk/examples/f77/x31f.fm4 =================================================================== --- trunk/examples/f77/x31f.fm4 (rev 0) +++ trunk/examples/f77/x31f.fm4 2008-12-16 14:13:49 UTC (rev 9134) @@ -0,0 +1,220 @@ +C $Id:$ +C set / get tester. +C +C Copyright (C) 2008 Alan W. Irwin +C Copyright (C) 2008 Andrew Ross +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 General Library 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 + +C-------------------------------------------------------------------------- +C main +C +C Demonstrates absolute positioning of graphs on a page. +C-------------------------------------------------------------------------- + + implicit none + real*8 xmin, xmax, ymin, ymax, wx, wy + real*8 mar, aspect, jx, jy, ori + integer win, level, digmax, digits, compression + real*8 xp, yp, xp2, yp2 + integer xleng, yleng, xoff, yoff, xleng2, yleng2 + integer fam, num, bmax, fam1, num1, bmax1, r, g, b + real*8 a + integer r1(2), g1(2), b1(2) + data r1 /0, 255/ + data g1 /255, 0/ + data b1 /0, 0/ + real*8 a1(2) + data a1 /1.0d0, 1.0d0/ + character*80 fnam + +C Parse and process command line arguments + + integer PL_PARSE_FULL + parameter(PL_PARSE_FULL = 1) + real*8 PL_NOTSET + parameter(PL_NOTSET = -42.0d0) + call plparseopts(PL_PARSE_FULL) + +C Test setting / getting page size + call plgpage(xp, yp, xleng, yleng, xoff, yoff) + xp2 = xp*0.9d0 + yp2 = yp*0.9d0 + xleng2 = int(xleng*0.9d0) + yleng2 = int(yleng*0.9d0) + call plspage(xp2, yp2, xleng2, yleng2, xoff, yoff) + call plgpage(xp, yp, xleng, yleng, xoff, yoff) + if (xp.ne.xp2 .or. yp .ne. yp2 .or. xleng .ne. xleng2 .or. + & yleng .ne. yleng2) then + write (0,*) "plgpage test failed" + call plend() + call exit(1) + endif + + call plscompression(1) + call plgcompression(compression) + if (compression .ne. 1) then + write (0,*) "plgcompression test failed" + call plend() + call exit(1) + endif + + call plgfam(fam, num, bmax) + call plsfam(1,1,100000) + call plgfam(fam1, num1, bmax1) + if (fam1 .ne. 1 .or. num1 .ne. 1 .or. bmax1 .ne. 100000) then + write (0,*) "plgfam test failed" + call plend() + call exit(1) + endif + call plsfam(fam, num, bmax) + +C Initialize plplot + + call plinit() + + call plscolor(1) + + call plscol0(1, 255, 0, 0) + + call plscmap1(r1,g1,b1,2) + call plscmap1a(r1,g1,b1,a1,2) + + call plglevel(level) + if (level .ne. 1) then + write(0,*) "plglevel test failed. Level is ",level, + & ", but 1 expected." + call plend() + call exit(1) + endif + + call pladv(0) + call plvpor(0.0d0, 1.0d0, 0.0d0, 1.0d0) + + call plwind(0.2d0, 0.3d0, 0.4d0, 0.5d0) + call plgvpw(xmin, xmax, ymin, ymax) + if (xmin .ne. 0.2d0 .or. xmax .ne. 0.3d0 .or. ymin .ne. 0.4d0 .or. + & ymax .ne. 0.5d0) then + write (0,*) "plgvpw test failed",xmin,xmax,ymin,ymax + call plend() + call exit(1) + endif + + call plgvpd(xmin, xmax, ymin, ymax) + if (xmin .ne. 0.0d0 .or. xmax .ne. 1.0d0 .or. ymin .ne. 0.0d0 .or. + & ymax .ne. 1.0d0) then + write (0,*) "plgvpd test failed" + call plend() + call exit(1) + endif + +C Get world coordinates for 0.5,0.5 which is in the middle of +C the window + call plcalc_world(0.5d0,0.5d0,wx,wy,win) + if (abs(wx-0.25d0).gt.1.0d-5 .or. abs(wy-0.45d0).gt.1.0d-5) then + write (0,*) "plcalc_world test failed" + call plend() + call exit(1) + endif + +C Retrieve and print the name of the output file (if any) + call plgfnam(fnam) + print *,"Output file name is ",fnam + +C Set and get the number of digits used to display axis labels +C Note digits is currently ignored in pls[xyz]ax and +C therefore it does not make sense to test the returned +C value + call plsxax(3,0) + call plgxax(digmax,digits) + if (digmax .ne. 3) then + write (0,*) "plgxax test failed" + call plend() + call exit(1) + endif + + call plsyax(3,0) + call plgyax(digmax,digits) + if (digmax .ne. 3) then + write (0,*) "plgyax test failed" + call plend() + call exit(1) + endif + + call plszax(3,0) + call plgzax(digmax,digits) + if (digmax .ne. 3) then + write(0,*) "plgzax test failed" + call plend() + call exit(1) + endif + + call plsdidev(0.05d0, PL_NOTSET, 0.0d0, 0.0d0) + call plgdidev(mar, aspect, jx, jy) + if (mar .ne. 0.05d0 .or. jx .ne. 0.0d0 .or. jy .ne. 0.0d0) then + write(0,*) "plgdidev test failed" + call plend() + call exit(1) + endif + + call plsdiori(1.0d0) + call plgdiori(ori) + if (ori .ne. 1.0d0) then + write(0,*) "plgdiori test failed" + call plend() + call exit(1) + endif + + call plsdiplt(0.1d0, 0.1d0, 0.9d0, 0.9d0) + call plgdiplt(xmin, ymin, xmax, ymax) + if (xmin .ne. 0.1d0 .or. xmax .ne. 0.9d0 .or. ymin .ne. 0.1d0 .or. + & ymax .ne. 0.9d0) then + write(0,*) "plgdiplt test failed" + call plend() + call exit(1) + endif + + call plsdiplz(0.1d0, 0.1d0, 0.9d0, 0.9d0) + call plgdiplt(xmin, ymin, xmax, ymax) + if (xmin .ne. 0.1d0+0.8d0*0.1d0 .or. + & xmax .ne. 0.1d0+0.8d0*0.9d0 .or. + & ymin .ne. 0.1d0+0.8d0*0.1d0 .or. + & ymax .ne. 0.1d0+0.8d0*0.9d0) then + write(0,*) "plsdiplz test failed" + call plend() + call exit(1) + endif + + call plscolbg(0,0,0) + call plgcolbg(r, g, b) + if (r .ne. 0 .or. g .ne. 0 .or. b .ne. 0) then + write(0,*) "plgcolbg test failed" + call plend() + call exit(1) + endif + + call plscolbga(0,0,0,1.0d0) + call plgcolbga(r, g, b, a) + if (r .ne. 0 .or. g .ne. 0 .or. b .ne. 0 .or. a .ne. 1.0d0) then + write(0,*) "plgcolbga test failed" + call plend() + call exit(1) + endif + + call plend() + call exit(0) + end Property changes on: trunk/examples/f77/x31f.fm4 ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/examples/f95/CMakeLists.txt =================================================================== --- trunk/examples/f95/CMakeLists.txt 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f95/CMakeLists.txt 2008-12-16 14:13:49 UTC (rev 9134) @@ -52,6 +52,7 @@ "28" "29" "30" +"31" ) # Process fortran header file to define isnan Modified: trunk/examples/f95/x01f.f90 =================================================================== --- trunk/examples/f95/x01f.f90 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f95/x01f.f90 2008-12-16 14:13:49 UTC (rev 9134) @@ -31,15 +31,13 @@ ! Process command-line arguments call plparseopts(PL_PARSE_FULL) -! Divide page into 2x2 plots - call plssub(2, 2) - ! Print plplot version call plgver(version) write (*,'(a,a)') 'PLplot library version: ', trim(version) ! Initialize plplot - call plinit() +! Divide page into 2x2 plots + call plstar(2,2) ! Set up the data ! Original case Modified: trunk/examples/f95/x03f.f90 =================================================================== --- trunk/examples/f95/x03f.f90 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f95/x03f.f90 2008-12-16 14:13:49 UTC (rev 9134) @@ -29,6 +29,9 @@ ! Process command-line arguments call plparseopts(PL_PARSE_FULL) +! Set orientation to landscape - note not all device drivers +! support this, in particular most interactive drivers do not. + call plsori(1) dtr = PI/180.0_plflt do i=0,360 Modified: trunk/examples/f95/x09f.f90 =================================================================== --- trunk/examples/f95/x09f.f90 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f95/x09f.f90 2008-12-16 14:13:49 UTC (rev 9134) @@ -84,6 +84,7 @@ call plinit ! Plot using identity transform + call pl_setcontlabelformat(4,3) call pl_setcontlabelparam(0.006_plflt, 0.3_plflt, 0.1_plflt, 1) call plenv(-1.0_plflt, 1.0_plflt, -1.0_plflt, 1.0_plflt, 0, 0) call plcol0(2) Modified: trunk/examples/f95/x13f.f90 =================================================================== --- trunk/examples/f95/x13f.f90 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f95/x13f.f90 2008-12-16 14:13:49 UTC (rev 9134) @@ -39,7 +39,12 @@ call plinit() - call plenv( 0._plflt, 10._plflt, 0._plflt, 10._plflt, 1, -2 ) + call pladv(0) +! Ensure window has aspect ratio of one so circle is +! plotted as a circle. + call plvasp(1.0_plflt) + call plwind(0._plflt, 10._plflt, 0._plflt, 10._plflt) +! call plenv( 0._plflt, 10._plflt, 0._plflt, 10._plflt, 1, -2 ) call plcol0(2) ! n.b. all theta quantities scaled by 2*pi/500 to be integers to avoid Modified: trunk/examples/f95/x15f.f90 =================================================================== --- trunk/examples/f95/x15f.f90 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f95/x15f.f90 2008-12-16 14:13:49 UTC (rev 9134) @@ -58,6 +58,7 @@ call plot1(z, XPTS, YPTS, zmin, zmax, xdim) call plot2(z, XPTS, YPTS, zmin, zmax, xdim) + call plot3() call plend() end @@ -217,8 +218,20 @@ real(kind=plflt) shade_min, shade_max, sh_color integer sh_cmap, sh_width integer min_color, min_width, max_color, max_width - integer i + integer i, j + integer nlin(10), inc(2,10), del(2,10) + data nlin /1, 1, 1, 1, 1, 2, 2, 2, 2, 2/ + data ( (inc(i,j), i=1,2), j=1,10) / & + 450, 0, -450, 0, 0, 0, 900, 0, & + 300, 0, 450,-450, 0, 900, 0, 450, & + 450, -450, 0, 900/ + data ( (del(i,j), i=1,2), j=1,10) / & + 2000, 2000, 2000, 2000, 2000, 2000, & + 2000, 2000, 2000, 2000, 2000, 2000, & + 2000, 2000, 2000, 2000, 4000, 4000, & + 4000, 2000/ + sh_cmap = 0 min_color = 0 min_width = 0 @@ -236,7 +249,7 @@ shade_min = zmin + (zmax - zmin) * (i-1) / 10.0_plflt shade_max = zmin + (zmax - zmin) * i / 10.0_plflt sh_color = i+5 - call plpsty(mod((i + 1),8) + 1) + call plpat(nlin(i),inc(1,i),del(1,i)) ! Use_ plshade0 instead of plshade1 - identity mapping call plshade(z(:XPTS,:YPTS), undefined, & -1._plflt, 1._plflt, -1._plflt, 1._plflt, & @@ -251,7 +264,49 @@ call pllab('distance', 'altitude', 'Bogon flux') end +!-------------------------------------------------------------------------- +! plot3 +! +! Illustrates shaded regions in 3d, using a different fill pattern for +! each region. +!-------------------------------------------------------------------------- + subroutine plot3 + use plplot + implicit none + + real(kind=plflt) xx1(5), xx2(5), yy1(5), yy2(5), zz1(5), zz2(5) + data xx1 / -1.0_plflt, 1.0_plflt, 1.0_plflt, -1.0_plflt, -1.0_plflt/ + data xx2 / -1.0_plflt, 1.0_plflt, 1.0_plflt, -1.0_plflt, -1.0_plflt/ + data yy1 /1.0_plflt, 1.0_plflt, 0.0_plflt, 0.0_plflt, 1.0_plflt/ + data yy2 / -1.0_plflt, -1.0_plflt, 0.0_plflt, 0.0_plflt, -1.0_plflt/ + data zz1 / 0.0_plflt, 0.0_plflt, 1.0_plflt, 1.0_plflt, 0.0_plflt/ + data zz2 / 0.0_plflt, 0.0_plflt, 1.0_plflt, 1.0_plflt, 0.0_plflt/ + + call pladv(0) + call plvpor(0.1_plflt, 0.9_plflt, 0.1_plflt, 0.9_plflt) + call plwind(-1.0_plflt, 1.0_plflt, -1.0_plflt, 1.0_plflt) + call plw3d(1._plflt, 1._plflt, 1._plflt, -1.0_plflt, 1.0_plflt, & + -1.0_plflt, 1.0_plflt, 0.0_plflt,1.5_plflt, 30._plflt, -40._plflt) + +! Plot using identity transform + + call plcol0(1) + call plbox3("bntu", "X", 0.0_plflt, 0, "bntu", "Y", 0.0_plflt, 0, & + "bcdfntu", "Z", 0.5_plflt, 0) + call plcol0(2) + call pllab("","","3-d polygon filling") + + call plcol0(3) + call plpsty(1) + call plline3(xx1, yy1, zz1) + call plfill3(xx1(1:4), yy1(1:4), zz1(1:4)) + call plpsty(2) + call plline3(xx2, yy2, zz2) + call plfill3(xx2(1:4), yy2(1:4), zz2(1:4)) + + end + !---------------------------------------------------------------------------- ! Subroutine a2mnmx ! Minimum and the maximum elements of a 2-d array. Modified: trunk/examples/f95/x29f.f90 =================================================================== --- trunk/examples/f95/x29f.f90 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/examples/f95/x29f.f90 2008-12-16 14:13:49 UTC (rev 9134) @@ -26,12 +26,15 @@ implicit none - real(kind=plflt), dimension(365) :: x, y - common /plotdat/ x, y + real(kind=plflt), dimension(365) :: x, y, xerr1, xerr2, yerr1, yerr2 + common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 call plparseopts(PL_PARSE_FULL) call plinit() + +! This is the ASCII value for character @ + call plsesc(64) call plot1() call plot2() @@ -48,13 +51,13 @@ use plplot, PI => PL_PI implicit none - real(kind=plflt), dimension(365) :: x, y - common /plotdat/ x, y + real(kind=plflt), dimension(365) :: x, y, xerr1, xerr2, yerr1, yerr2 + common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 integer :: i, npts real(kind=plflt) :: xmin, xmax, ymin, ymax - parameter(npts = 145) + parameter(npts = 73) parameter(xmin = 0.0_plflt) parameter(xmax = 60.0_plflt*60.0_plflt*24.0_plflt) parameter(ymin = 10.0_plflt) @@ -63,9 +66,21 @@ do i = 1,npts x(i) = xmax*(dble(i-1)/dble(npts)) y(i) = 15.0_plflt - 5.0_plflt*cos(2.0_plflt*PI*dble(i-1)/dble(npts)) +! Set x error bars to +/- 5 minute + xerr1(i) = x(i)-60.0_plflt*5.0_plflt + xerr2(i) = x(i)+60.0_plflt*5.0_plflt +! Set y error bars to +/- 0.1 deg C + yerr1(i) = y(i)-0.1_plflt + yerr2(i) = y(i)+0.1_plflt enddo call pladv(0) + +! Rescale major ticks marks by 0.5 + call plsmaj(0.0_plflt,0.5_plflt) +! Rescale minor ticks and error bar marks by 0.5 + call plsmin(0.0_plflt,0.5_plflt) + call plvsta() call plwind(xmin, xmax, ymin, ymax) @@ -78,11 +93,19 @@ call plcol0(3) call pllab("Time (hours:mins)", "Temperature (degC)", & - "#frPLplot Example 29 - Daily temperature") + "@frPLplot Example 29 - Daily temperature") call plcol0(4) call plline(x(1:npts), y(1:npts)) + call plcol0(2) + call plerrx(xerr1(1:npts), xerr2(1:npts), y(1:npts)) + call plcol0(3) + call plerry(x(1:npts), yerr1(1:npts), yerr2(1:npts)) + +! Rescale major / minor tick marks back to default + call plsmin(0.0_plflt,1.0_plflt) + call plsmaj(0.0_plflt,1.0_plflt) end subroutine plot1 @@ -97,8 +120,8 @@ integer :: j, npts real(kind=plflt) :: xmin, xmax, ymin, ymax real(kind=plflt) :: lat, p, d - real(kind=plflt), dimension(365) :: x, y - common /plotdat/ x, y + real(kind=plflt), dimension(365) :: x, y, xerr1, xerr2, yerr1, yerr2 + common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 ! Latitude for London @@ -128,16 +151,19 @@ call plcol0(1) ! Set time format to be abbreviated month name followed by day of month call pltimefmt("%b %d") + call plprec(1,1) call plenv(xmin, xmax, ymin, ymax, 0, 40) call plcol0(3) call pllab("Date", "Hours of daylight", & - "#frPLplot Example 29 - Hours of daylight at 51.5N") + "@frPLplot Example 29 - Hours of daylight at 51.5N") call plcol0(4) call plline(x, y) + call plprec(0,0) + end subroutine plot2 ! @@ -151,8 +177,8 @@ real(kind=plflt) :: xmin, xmax, ymin, ymax integer :: tstart, t1, t2 ! real(kind=plflt) :: toff; - real(kind=plflt), dimension(365) :: x, y - common /plotdat/ x, y + real(kind=plflt), dimension(365) :: x, y, xerr1, xerr2, yerr1, yerr2 + common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 ! integer tm(9) @@ -189,11 +215,12 @@ call plcol0(3) call pllab("Date", "Hours of television watched", & - "#frPLplot Example 29 - Hours of television watched in " // & + "@frPLplot Example 29 - Hours of television watched in " // & "Dec 2005 / Jan 2006"); call plcol0(4) + call plssym(0.0_plflt, 0.5_plflt) call plpoin(x(1:npts), y(1:npts), 2) call plline(x(1:npts), y(1:npts)) Modified: trunk/plplot_test/test_f77.sh.in =================================================================== --- trunk/plplot_test/test_f77.sh.in 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/plplot_test/test_f77.sh.in 2008-12-16 14:13:49 UTC (rev 9134) @@ -55,7 +55,7 @@ # Do the standard non-interactive examples. # skip 14 and 17 because they are interactive. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ; do if [ "$verbose_test" ]; then echo "x${index}f" fi @@ -100,7 +100,7 @@ # Do the standard non-interactive examples. # skip 14 and 17 because they are interactive. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ; do if [ "$verbose_test" ]; then echo "x${index}f" fi Modified: trunk/plplot_test/test_f95.sh.in =================================================================== --- trunk/plplot_test/test_f95.sh.in 2008-12-16 14:12:45 UTC (rev 9133) +++ trunk/plplot_test/test_f95.sh.in 2008-12-16 14:13:49 UTC (rev 9134) @@ -56,7 +56,7 @@ # Do the standard non-interactive examples. # skip 14 and 17 because they are interactive. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30; do + for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do if [ "$verbose_test" ]; then echo "x${index}f" fi @@ -101,7 +101,7 @@ # Do the standard non-interactive examples. # skip 14 and 17 because they are interactive. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30; do + for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do if [ "$verbose_test" ]; then echo "x${index}f" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |