|
From: <and...@us...> - 2008-07-22 10:57:00
|
Revision: 8553
http://plplot.svn.sourceforge.net/plplot/?rev=8553&view=rev
Author: andrewross
Date: 2008-07-22 10:57:10 +0000 (Tue, 22 Jul 2008)
Log Message:
-----------
Remove unused time related functions from C and java versions of example
21.
Modified Paths:
--------------
trunk/examples/c/x21c.c
trunk/examples/java/x21.java
Modified: trunk/examples/c/x21c.c
===================================================================
--- trunk/examples/c/x21c.c 2008-07-22 10:56:25 UTC (rev 8552)
+++ trunk/examples/c/x21c.c 2008-07-22 10:57:10 UTC (rev 8553)
@@ -22,7 +22,6 @@
*/
#include "plcdemos.h"
-#include <time.h>
#if !defined(HAVE_ISNAN)
# define isnan(x) ((x) != (x))
@@ -156,7 +155,6 @@
PLFLT *x, *y, *z, *clev;
PLFLT *xg, *yg, **zg;
PLFLT zmin, zmax, lzm, lzM;
- long ct;
int i, j, k;
PLINT alg;
char *title[] = {"Cubic Spline Approximation",
@@ -211,10 +209,7 @@
pladv(0);
for (alg=1; alg<7; alg++) {
- ct = clock();
plgriddata(x, y, z, pts, xg, xp, yg, yp, zg, alg, opt[alg-1]);
- /* printf("time=%ld ms", (clock() - ct)/1000); */
- /* printf("opt=%.3f", opt[alg-1]); */
/* - CSA can generate NaNs (only interpolates?!).
* - DTLI and NNI can generate NaNs for points outside the convex hull
Modified: trunk/examples/java/x21.java
===================================================================
--- trunk/examples/java/x21.java 2008-07-22 10:56:25 UTC (rev 8552)
+++ trunk/examples/java/x21.java 2008-07-22 10:57:10 UTC (rev 8553)
@@ -135,10 +135,8 @@
double xg[], yg[], zg[][];
double xg0[][], yg0[][];
double zmin, zmax, lzm[], lzM[];
- long ct;
int i, j, k;
int alg;
- String ylab, xlab;
String title[] = {"Cubic Spline Approximation",
"Delaunay Linear Interpolation",
"Natural Neighbors Interpolation",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-07-31 12:39:55
|
Revision: 8599
http://plplot.svn.sourceforge.net/plplot/?rev=8599&view=rev
Author: andrewross
Date: 2008-07-31 12:40:03 +0000 (Thu, 31 Jul 2008)
Log Message:
-----------
Change function name from isnan to myisnan to avoid confusion with
intrinsic on some compilers. Also remove logical from function
definition since some compilers don't like this (gfortran didn't
complain but an old version of ifort did).
Modified Paths:
--------------
trunk/examples/f77/x21f.fm4
trunk/examples/f95/x21f.f90
Modified: trunk/examples/f77/x21f.fm4
===================================================================
--- trunk/examples/f77/x21f.fm4 2008-07-30 21:28:06 UTC (rev 8598)
+++ trunk/examples/f77/x21f.fm4 2008-07-31 12:40:03 UTC (rev 8599)
@@ -45,8 +45,8 @@
external plrandd
real*8 plrandd
- external isnan
- logical isnan
+ external myisnan
+ logical myisnan
integer pts, xp, yp, nl, knn_order, randn, rosen
real*8 threshold, wmin
@@ -166,7 +166,7 @@
do i=1,xp
do j=1,yp
- if (isnan(zg(i,j))) then
+ if (myisnan(zg(i,j))) then
c average (IDW) over the 8 neighbors
zg(i,j) = 0.d0
@@ -177,7 +177,7 @@
jj = j-1
do while ((jj.le.j+1).and.(jj.le.yp))
if ((ii.ge.1) .and. (jj.ge.1) .and.
- & (.not.isnan(zg(ii,jj))) ) then
+ & (.not.myisnan(zg(ii,jj))) ) then
if (abs(ii-i) + abs(jj-j) .eq. 1) then
d = 1.d0
else
@@ -272,13 +272,13 @@
end subroutine
- logical function isnan(x)
+ function myisnan(x)
implicit none
- logical isnan
+ logical myisnan
real*8 x
- isnan = (x.ne.x)
+ myisnan = (x.ne.x)
return
end function
Modified: trunk/examples/f95/x21f.f90
===================================================================
--- trunk/examples/f95/x21f.f90 2008-07-30 21:28:06 UTC (rev 8598)
+++ trunk/examples/f95/x21f.f90 2008-07-31 12:40:03 UTC (rev 8599)
@@ -1,4 +1,4 @@
-! $Id:$
+! $Id$
! Grid data demo.
!
! Copyright (C) 2004 Joao Cardoso
@@ -40,8 +40,8 @@
parameter(MAG_COLOR = 4)
parameter(BASE_CONT = 8)
- external isnan
- logical isnan
+ external myisnan
+ logical myisnan
integer pts, xp, yp, nl, knn_order, randn, rosen
real(kind=plflt) threshold, wmin
@@ -160,7 +160,7 @@
do i=1,xp
do j=1,yp
- if (isnan(zg(i,j))) then
+ if (myisnan(zg(i,j))) then
! average (IDW) over the 8 neighbors
zg(i,j) = 0._plflt
@@ -171,7 +171,7 @@
jj = j-1
do while ((jj.le.j+1).and.(jj.le.yp))
if ((ii.ge.1) .and. (jj.ge.1) .and. &
- (.not.isnan(zg(ii,jj))) ) then
+ (.not.myisnan(zg(ii,jj))) ) then
if (abs(ii-i) + abs(jj-j) .eq. 1) then
d = 1._plflt
else
@@ -267,16 +267,16 @@
end subroutine cmap1_init
- logical function isnan(x)
+ function myisnan(x)
use plplot
implicit none
- logical isnan
+ logical myisnan
real(kind=plflt) x
- isnan = (x.ne.x)
+ myisnan = (x.ne.x)
return
- end function isnan
+ end function myisnan
!----------------------------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2008-08-07 22:04:12
|
Revision: 8613
http://plplot.svn.sourceforge.net/plplot/?rev=8613&view=rev
Author: airwin
Date: 2008-08-07 22:04:18 +0000 (Thu, 07 Aug 2008)
Log Message:
-----------
Change colour multiplier from 255 to 255.001 to avoid close truncation
decisions that will vary with different floating point implementations.
Modified Paths:
--------------
trunk/examples/ada/x02a.adb.cmake
trunk/examples/ada/xthick02a.adb.cmake
trunk/examples/c/x02c.c
trunk/examples/c++/x02.cc
trunk/examples/f77/x02f.fm4
trunk/examples/f95/x02f.f90
trunk/examples/java/x02.java
trunk/examples/ocaml/x02.ml
trunk/examples/perl/x02.pl
trunk/examples/python/xw02.py
trunk/examples/tcl/x02.tcl
Modified: trunk/examples/ada/x02a.adb.cmake
===================================================================
--- trunk/examples/ada/x02a.adb.cmake 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/ada/x02a.adb.cmake 2008-08-07 22:04:18 UTC (rev 8613)
@@ -138,9 +138,9 @@
-- number to use appears to be about 0.5 - 10^-16 which _might_
-- be an exact fix for 64-bit floats since they have about 16 digits
-- of accuracy.
- r(i+16) := Integer((r1 * 255.0) - 0.499999999999999);
- g(i+16) := Integer((g1 * 255.0) - 0.499999999999999);
- b(i+16) := Integer((b1 * 255.0) - 0.499999999999999);
+ r(i+16) := Integer((r1 * 255.001) - 0.499999999999999);
+ g(i+16) := Integer((g1 * 255.001) - 0.499999999999999);
+ b(i+16) := Integer((b1 * 255.001) - 0.499999999999999);
end loop;
-- Load default cmap0 colors into our custom set.
Modified: trunk/examples/ada/xthick02a.adb.cmake
===================================================================
--- trunk/examples/ada/xthick02a.adb.cmake 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/ada/xthick02a.adb.cmake 2008-08-07 22:04:18 UTC (rev 8613)
@@ -136,9 +136,9 @@
-- approximately like C to match that example. -0.5 produces
-- at least one -1 result (rather than zero) so we subtract
-- something with a slightly smaller absolute value.
- r(i+16) := Integer((r1 * 255.0) - 0.499999999999999);
- g(i+16) := Integer((g1 * 255.0) - 0.499999999999999);
- b(i+16) := Integer((b1 * 255.0) - 0.499999999999999);
+ r(i+16) := Integer((r1 * 255.001) - 0.499999999999999);
+ g(i+16) := Integer((g1 * 255.001) - 0.499999999999999);
+ b(i+16) := Integer((b1 * 255.001) - 0.499999999999999);
end loop;
-- Load default cmap0 colors into our custom set.
Modified: trunk/examples/c/x02c.c
===================================================================
--- trunk/examples/c/x02c.c 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/c/x02c.c 2008-08-07 22:04:18 UTC (rev 8613)
@@ -93,16 +93,21 @@
s = 1.0;
plhlsrgb(h, l, s, &r1, &g1, &b1);
+ /*printf("%3d %15.9f %15.9f %15.9f %15.9f %15.9f %15.9f\n",
+ i+16,h,l,s,r1,g1,b1); */
- r[i+16] = r1 * 255;
- g[i+16] = g1 * 255;
- b[i+16] = b1 * 255;
+ /* Use 255.001 to avoid close truncation decisions in this example. */
+ r[i+16] = r1 * 255.001;
+ g[i+16] = g1 * 255.001;
+ b[i+16] = b1 * 255.001;
}
/* Load default cmap0 colors into our custom set */
for (i = 0; i <= 15; i++)
plgcol0(i, &r[i], &g[i], &b[i]);
+/* for (i = 0; i < 116; i++)
+ printf("%3d %3d %3d %3d \n", i, r[i], g[i], b[i]); */
/* Now set cmap0 all at once (faster, since fewer driver calls) */
plscmap0(r, g, b, 116);
Modified: trunk/examples/c++/x02.cc
===================================================================
--- trunk/examples/c++/x02.cc 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/c++/x02.cc 2008-08-07 22:04:18 UTC (rev 8613)
@@ -109,9 +109,9 @@
pls->hlsrgb(h, l, s, &r1, &g1, &b1);
- r[i+16] = (PLINT)(r1 * 255);
- g[i+16] = (PLINT)(g1 * 255);
- b[i+16] = (PLINT)(b1 * 255);
+ r[i+16] = (PLINT)(r1 * 255.001);
+ g[i+16] = (PLINT)(g1 * 255.001);
+ b[i+16] = (PLINT)(b1 * 255.001);
}
// Load default cmap0 colors into our custom set
Modified: trunk/examples/f77/x02f.fm4
===================================================================
--- trunk/examples/f77/x02f.fm4 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/f77/x02f.fm4 2008-08-07 22:04:18 UTC (rev 8613)
@@ -95,9 +95,9 @@
call plhlsrgb(h, l, s, r1, g1, b1)
- r(i+17) = r1*255
- g(i+17) = g1*255
- b(i+17) = b1*255
+ r(i+17) = r1*255.001
+ g(i+17) = g1*255.001
+ b(i+17) = b1*255.001
enddo
do i=1,16
Modified: trunk/examples/f95/x02f.f90
===================================================================
--- trunk/examples/f95/x02f.f90 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/f95/x02f.f90 2008-08-07 22:04:18 UTC (rev 8613)
@@ -96,9 +96,9 @@
call plhlsrgb(h, l, s, r1, g1, b1)
- r(i+17) = r1*255
- g(i+17) = g1*255
- b(i+17) = b1*255
+ r(i+17) = r1*255.001
+ g(i+17) = g1*255.001
+ b(i+17) = b1*255.001
enddo
do i=1,16
Modified: trunk/examples/java/x02.java
===================================================================
--- trunk/examples/java/x02.java 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/java/x02.java 2008-08-07 22:04:18 UTC (rev 8613)
@@ -117,9 +117,9 @@
pls.hlsrgb(h, l, s, r1, g1, b1);
- r[i+16] = (int)(r1[0] * 255);
- g[i+16] = (int)(g1[0] * 255);
- b[i+16] = (int)(b1[0] * 255);
+ r[i+16] = (int)(r1[0] * 255.001);
+ g[i+16] = (int)(g1[0] * 255.001);
+ b[i+16] = (int)(b1[0] * 255.001);
}
// Load default cmap0 colors into our custom set
Modified: trunk/examples/ocaml/x02.ml
===================================================================
--- trunk/examples/ocaml/x02.ml 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/ocaml/x02.ml 2008-08-07 22:04:18 UTC (rev 8613)
@@ -101,9 +101,9 @@
let (r1, g1, b1) = plhlsrgb h l s in
- r.(i+16) <- int_of_float (r1 *. 255.);
- g.(i+16) <- int_of_float (g1 *. 255.);
- b.(i+16) <- int_of_float (b1 *. 255.);
+ r.(i+16) <- int_of_float (r1 *. 255.001);
+ g.(i+16) <- int_of_float (g1 *. 255.001);
+ b.(i+16) <- int_of_float (b1 *. 255.001);
done;
(* Load default cmap0 colors into our custom set *)
Modified: trunk/examples/perl/x02.pl
===================================================================
--- trunk/examples/perl/x02.pl 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/perl/x02.pl 2008-08-07 22:04:18 UTC (rev 8613)
@@ -109,9 +109,9 @@
($r1, $g1, $b1) = plhlsrgb($h, $l, $s);
- set $r, i+16, r1 * 255;
- set $g, i+16, g1 * 255;
- set $b, i+16, b1 * 255;
+ set $r, i+16, r1 * 255.001;
+ set $g, i+16, g1 * 255.001;
+ set $b, i+16, b1 * 255.001;
}
# Load default cmap0 colors into our custom set
Modified: trunk/examples/python/xw02.py
===================================================================
--- trunk/examples/python/xw02.py 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/python/xw02.py 2008-08-07 22:04:18 UTC (rev 8613)
@@ -54,9 +54,9 @@
rgb = plhlsrgb(h, l, s)
- r[i+16] = rgb[0]*255
- g[i+16] = rgb[1]*255
- b[i+16] = rgb[2]*255
+ r[i+16] = rgb[0]*255.001
+ g[i+16] = rgb[1]*255.001
+ b[i+16] = rgb[2]*255.001
# Load default cmap0 colors into out custom set
for i in range(16):
Modified: trunk/examples/tcl/x02.tcl
===================================================================
--- trunk/examples/tcl/x02.tcl 2008-08-07 21:10:21 UTC (rev 8612)
+++ trunk/examples/tcl/x02.tcl 2008-08-07 22:04:18 UTC (rev 8613)
@@ -72,20 +72,37 @@
set s 1.0
plhlsrgb $h $l $s r1 g1 b1
+ # puts [format "%3d %15.9f %15.9f %15.9f %15.9f %15.9f %15.9f" $i1 $h $l $s $r1 $g1 $b1]
if $see_the_bug {
- r $i1 = [expr int($r1 * 255)]
- g $i1 = [expr int($g1 * 255)]
- b $i1 = [expr int($b1 * 255)]
+ r $i1 = [expr int($r1 * 255.001)]
+ g $i1 = [expr int($g1 * 255.001)]
+ b $i1 = [expr int($b1 * 255.001)]
} else {
- set r2 [expr int($r1 * 255)]
- set g2 [expr int($g1 * 255)]
- set b2 [expr int($b1 * 255)]
+ set r2 [expr int($r1 * 255.001)]
+ set g2 [expr int($g1 * 255.001)]
+ set b2 [expr int($b1 * 255.001)]
+ # puts [format "%3d %3d %3d %3d" $i1 $r2 $g2 $b2]
plscol0 $i1 $r2 $g2 $b2
}
}
if $see_the_bug {
- plscmap0 r g b $ntot
+ # Load default cmap0 colors into our custom set
+ for {set i 0} {$i < $offset} {incr i} {
+ plgcol0 $i r1 g1 b1
+ r $i = [expr int($r1)]
+ g $i = [expr int($g1)]
+ b $i = [expr int($b1)]
+ }
+ # temporary
+ for {set i 0} {$i < $ntot} {incr i} {
+ set r1 [expr [r $i]]
+ set g1 [expr [g $i]]
+ set b1 [expr [b $i]]
+ puts [format "%3d %3d %3d %3d" $i $r1 $g1 $b1]
+ }
+ # The following call currently segfaults.
+ plscmap0 r g b $ntot
}
x02_draw_windows $w 100 $offset
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2008-08-12 17:09:36
|
Revision: 8635
http://plplot.svn.sourceforge.net/plplot/?rev=8635&view=rev
Author: airwin
Date: 2008-08-12 17:09:44 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
Change incorrect properties that were set when these files were first added
to svn. As a result of this change execution permissions will no longer be
forced for these files, the correct line endings for their platform
will be checked out by
everybody, and keyword substitution will work properly within these files.
Modified Paths:
--------------
trunk/examples/f77/x20f.fm4
trunk/examples/f77/x25f.fm4
trunk/examples/f77/x26f.fm4
trunk/examples/f77/x27f.fm4
trunk/examples/f95/x20f.f90
Property Changed:
----------------
trunk/examples/f77/x20f.fm4
trunk/examples/f77/x24f.fm4
trunk/examples/f77/x25f.fm4
trunk/examples/f77/x26f.fm4
trunk/examples/f77/x27f.fm4
trunk/examples/f95/x20f.f90
Modified: trunk/examples/f77/x20f.fm4
===================================================================
--- trunk/examples/f77/x20f.fm4 2008-08-12 13:15:10 UTC (rev 8634)
+++ trunk/examples/f77/x20f.fm4 2008-08-12 17:09:44 UTC (rev 8635)
@@ -1,4 +1,4 @@
-C $Id: x20c.c 8033 2007-11-23 15:28:09Z andrewross $
+C $Id$
C
C Copyright (C) 2004 Alan W. Irwin
C Copyright (C) 2008 Andrew Ross
Property changes on: trunk/examples/f77/x20f.fm4
___________________________________________________________________
Deleted: svn:executable
- *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/examples/f77/x24f.fm4
___________________________________________________________________
Deleted: svn:executable
- *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/examples/f77/x25f.fm4
===================================================================
--- trunk/examples/f77/x25f.fm4 2008-08-12 13:15:10 UTC (rev 8634)
+++ trunk/examples/f77/x25f.fm4 2008-08-12 17:09:44 UTC (rev 8635)
@@ -1,4 +1,4 @@
-C $Id: x25c.c 8033 2007-11-23 15:28:09Z andrewross $
+C $Id$
C
C Filling and clipping polygons.
C
Property changes on: trunk/examples/f77/x25f.fm4
___________________________________________________________________
Deleted: svn:executable
- *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/examples/f77/x26f.fm4
===================================================================
--- trunk/examples/f77/x26f.fm4 2008-08-12 13:15:10 UTC (rev 8634)
+++ trunk/examples/f77/x26f.fm4 2008-08-12 17:09:44 UTC (rev 8635)
@@ -1,6 +1,6 @@
C -*- coding: utf-8; -*-
C
-C $Id: x26c.c 8033 2007-11-23 15:28:09Z andrewross $
+C $Id$
C
C Multi-lingual version of the first page of example 4.
C
Property changes on: trunk/examples/f77/x26f.fm4
___________________________________________________________________
Deleted: svn:executable
- *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/examples/f77/x27f.fm4
===================================================================
--- trunk/examples/f77/x27f.fm4 2008-08-12 13:15:10 UTC (rev 8634)
+++ trunk/examples/f77/x27f.fm4 2008-08-12 17:09:44 UTC (rev 8635)
@@ -1,4 +1,4 @@
-C $Id: x27c.c 8033 2007-11-23 15:28:09Z andrewross $
+C $Id$
C
C Drawing "spirograph" curves - epitrochoids, cycolids, roulettes
C
Property changes on: trunk/examples/f77/x27f.fm4
___________________________________________________________________
Deleted: svn:executable
- *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/examples/f95/x20f.f90
===================================================================
--- trunk/examples/f95/x20f.f90 2008-08-12 13:15:10 UTC (rev 8634)
+++ trunk/examples/f95/x20f.f90 2008-08-12 17:09:44 UTC (rev 8635)
@@ -1,4 +1,4 @@
-! $Id:$
+! $Id$
!
! Copyright (C) 2004 Alan W. Irwin
! Copyright (C) 2008 Andrew Ross
Property changes on: trunk/examples/f95/x20f.f90
___________________________________________________________________
Deleted: svn:executable
- *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-08-13 12:29:50
|
Revision: 8638
http://plplot.svn.sourceforge.net/plplot/?rev=8638&view=rev
Author: andrewross
Date: 2008-08-13 12:29:59 +0000 (Wed, 13 Aug 2008)
Log Message:
-----------
Update python and perl versions of example 21 consistent with C
version.
Modified Paths:
--------------
trunk/examples/perl/x21.pl
trunk/examples/python/xw21.py
Modified: trunk/examples/perl/x21.pl
===================================================================
--- trunk/examples/perl/x21.pl 2008-08-13 12:04:56 UTC (rev 8637)
+++ trunk/examples/perl/x21.pl 2008-08-13 12:29:59 UTC (rev 8638)
@@ -61,7 +61,7 @@
my $pts = 500;
my $xp = 25;
my $yp = 20;
- my $nl = 15;
+ my $nl = 16;
my $knn_order = 20;
my $threshold = 1.001;
my $wmin = -1e3;
@@ -104,7 +104,7 @@
@opt = (0., 0., 0., 0., 0., 0.);
$xm = $ym = -0.2;
- $xM = $yM = 0.8;
+ $xM = $yM = 0.6;
plParseOpts (\@ARGV, PL_PARSE_PARTIAL);
@@ -123,11 +123,10 @@
my ($xg, $yg) = create_grid ($xp, $yp); # grid the data at
# the output grided data
- my $xlab = "Npts=$pts gridx=$xp gridy=$yp";
plcol0 (1);
plenv ($xm, $xM, $ym, $yM, 2, 0);
plcol0 (15);
- pllab ($xlab, "", "The original data");
+ pllab ("X", "Y", "The original data sampling");
plcol0 (2);
plpoin ($x, $y, 5);
pladv (0);
@@ -138,10 +137,7 @@
pladv (0);
for (my $alg = 1; $alg < 7; $alg++) {
- my $ct = clock ();
$zg = plgriddata ($x, $y, $z, $xg, $yg, $alg, $opt [$alg - 1]);
- $xlab = sprintf ("time=\%d ms", (clock () - $ct) / 1000);
- $ylab = sprintf ("opt=\%.3f", $opt [$alg - 1]);
# - CSA can generate NaNs (only interpolates?!).
# - DTLI and NNI can generate NaNs for points outside the convex hull
@@ -187,19 +183,22 @@
my $lzM = max ($zg);
my $lzm = min ($zg);
+ $lzm = min pdl ([$lzm, $zmin]);
+ $lzM = max pdl ([$lzM, $zmax]);
+
+ $lzm = $lzm - 0.01;
+ $lzM = $lzM + 0.01;
+
plcol0 (1);
pladv ($alg);
if ($k == 0) {
- $lzm = min pdl ([$lzm, $zmin]);
- $lzM = max pdl ([$lzM, $zmax]);
-
$clev = $lzm + ($lzM - $lzm) * sequence ($nl)/ ($nl - 1);
plenv0 ($xm, $xM, $ym, $yM, 2, 0);
plcol0 (15);
- pllab ($xlab, $ylab, $title [$alg - 1]);
+ pllab ("X", "Y", $title [$alg - 1]);
plshades ($zg, $xm, $xM, $ym, $yM,
$clev, 1, 0, 1, 1, 0, 0, 0);
plcol0 (2);
@@ -210,7 +209,7 @@
cmap1_init ();
plvpor (0.0, 1.0, 0.0, 0.9);
- plwind (-1.0, 1.0, -1.0, 1.5);
+ plwind (-1.1, 0.75, -0.65, 1.20);
#
# For the comparition to be fair, all plots should have the
# same z values, but to get the max/min of the data generated
@@ -219,9 +218,9 @@
# plw3d(1., 1., 1., xm, xM, ym, yM, zmin, zmax, 30, -60);
#
- plw3d (1., 1., 1., $xm, $xM, $ym, $yM, $lzm, $lzM, 30, -60);
- plbox3 (0.0, 0, 0.0, 0, 0.0, 4,
- "bnstu", $ylab, "bnstu", $xlab, "bcdmnstuv", "");
+ plw3d (1., 1., 1., $xm, $xM, $ym, $yM, $lzm, $lzM, 30.0, -40.0);
+ plbox3 (0.0, 0, 0.0, 0, 0.5, 0,
+ "bntu", "X", "bntu", "Y", "bcdfntu", "Z");
plcol0 (15);
pllab ("", "", $title [$alg - 1]);
plot3dc ($xg, $yg, $zg, DRAW_LINEXY | MAG_COLOR | BASE_CONT, $clev);
Modified: trunk/examples/python/xw21.py
===================================================================
--- trunk/examples/python/xw21.py 2008-08-13 12:04:56 UTC (rev 8637)
+++ trunk/examples/python/xw21.py 2008-08-13 12:29:59 UTC (rev 8638)
@@ -8,7 +8,7 @@
pts = 500
xp = 25
yp = 20
-nl = 15
+nl = 16
knn_order = 20
threshold = 1.001
wmin = -1e3
@@ -44,16 +44,23 @@
xm = -0.2
ym = -0.2
- xM = 0.8
- yM = 0.8
+ xM = 0.6
+ yM = 0.6
opt[2] = wmin
opt[3] = knn_order
opt[4] = threshold
# Create the sampled data
- xt = random(pts)
- yt = random(pts)
+ # random is an efficient way of generating random numbers in
+ # python, but for consistency across languages we use plrandd
+ #xt = random(pts)
+ #yt = random(pts)
+ xt = zeros(pts)
+ yt = zeros(pts)
+ for i in range(pts) :
+ xt[i] = (xM-xm)*plrandd()
+ yt[i] = (yM-ym)*plrandd()
if randn == 0 :
x = xt + xm
y = yt + ym
@@ -74,11 +81,10 @@
xg = xm + (xM-xm)*arange(xp)/(xp-1.)
yg = ym + (yM-ym)*arange(yp)/(yp-1.)
- xlab = 'Npts='+`pts`+' gridx='+`xp`+' gridy='+`yp`
plcol0(1)
plenv(xm,xM,ym,yM,2,0)
plcol0(15)
- pllab(xlab,'','The original data')
+ pllab('X','Y','The original data sampling')
plcol0(2)
plpoin(x,y,5)
pladv(0)
@@ -88,11 +94,8 @@
for k in range(2):
pladv(0)
for alg in range(1,7):
- ct = time.clock()
zg = reshape(zeros(xp*yp),(xp,yp))
plgriddata(x, y, z, xg, yg, zg, alg, opt[alg-1])
- xlab = 'time='+`int((time.clock()-ct)*1000)`+' ms'
- ylab = 'opt='+`opt[alg-1]`
if alg == GRID_CSA or alg == GRID_DTLI or alg == GRID_NNLI or alg == GRID_NNI:
for i in range(xp):
@@ -118,25 +121,29 @@
lzM = max(zg.flat)
lzm = min(zg.flat)
+ lzm = min(lzm,zmin)
+ lzM = max(lzM,zmax)
+
+ lzm = lzm - 0.01
+ lzM = lzM + 0.01
+
plcol0(1)
pladv(alg)
if (k == 0):
- lzm = min(lzm,zmin)
- lzM = max(lzM,zmax)
clev = lzm + (lzM-lzm)*arange(nl)/(nl-1)
plenv0(xm,xM,ym,yM,2,0)
plcol0(15)
- pllab(xlab,ylab,title[alg-1])
+ pllab('X','Y',title[alg-1])
plshades(zg, xm, xM, ym, yM, clev, 1, 1)
plcol0(2)
else:
clev = lzm + (lzM-lzm)*arange(nl)/(nl-1)
cmap1_init()
plvpor(0.0, 1.0, 0.0, 0.9)
- plwind(-1.0, 1.0, -1.0, 1.5)
- plw3d(1.0, 1.0, 1.0, xm, xM, ym, yM, lzm, lzM, 30, -60)
- plbox3('bnstu', ylab, 0.0, 0,'bnstu', xlab, 0.0, 0,'bcdmnstuv', '', 0.0, 4)
+ plwind(-1.1, 0.75, -0.65, 1.20)
+ plw3d(1.0, 1.0, 1.0, xm, xM, ym, yM, lzm, lzM, 30.0, -40.0)
+ plbox3('bntu', 'X', 0.0, 0,'bntu', 'Y', 0.0, 0,'bcdfntu', 'Z', 0.5, 0)
plcol0(15)
pllab('','',title[alg-1])
plot3dc(xg, yg, zg, DRAW_LINEXY | MAG_COLOR | BASE_CONT, clev)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-08-14 15:00:21
|
Revision: 8654
http://plplot.svn.sourceforge.net/plplot/?rev=8654&view=rev
Author: andrewross
Date: 2008-08-14 15:00:30 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
Fix incorrect array size for the sombrero data in example 20 (f77 and
f95 versions). Now produces identical results to C version.
Modified Paths:
--------------
trunk/examples/f77/x20f.fm4
trunk/examples/f95/x20f.f90
Modified: trunk/examples/f77/x20f.fm4
===================================================================
--- trunk/examples/f77/x20f.fm4 2008-08-14 14:42:11 UTC (rev 8653)
+++ trunk/examples/f77/x20f.fm4 2008-08-14 15:00:30 UTC (rev 8654)
@@ -72,7 +72,7 @@
integer XDIM, YDIM
real*8 XDIMR, YDIMR
- parameter(XDIM = 260, YDIM = 260)
+ parameter(XDIM = 260, YDIM = 220)
parameter(XDIMR = XDIM, YDIMR = YDIM)
real*8 PI
parameter(PI = 3.1415926535897932384d0)
Modified: trunk/examples/f95/x20f.f90
===================================================================
--- trunk/examples/f95/x20f.f90 2008-08-14 14:42:11 UTC (rev 8653)
+++ trunk/examples/f95/x20f.f90 2008-08-14 15:00:30 UTC (rev 8654)
@@ -73,7 +73,7 @@
implicit none
- integer, parameter :: XDIM = 260, YDIM = 260
+ integer, parameter :: XDIM = 260, YDIM = 220
real(kind=plflt), parameter :: XDIMR = XDIM, YDIMR = YDIM
real(kind=plflt) :: x(XDIM), y(YDIM), z(XDIM,YDIM), r(XDIM,YDIM)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-12-16 19:09:59
|
Revision: 9145
http://plplot.svn.sourceforge.net/plplot/?rev=9145&view=rev
Author: andrewross
Date: 2008-12-16 19:09:55 +0000 (Tue, 16 Dec 2008)
Log Message:
-----------
Update python and tcl versions of example 9.
Modified Paths:
--------------
trunk/examples/python/xw09.py
trunk/examples/tcl/x09.tcl
Modified: trunk/examples/python/xw09.py
===================================================================
--- trunk/examples/python/xw09.py 2008-12-16 18:41:35 UTC (rev 9144)
+++ trunk/examples/python/xw09.py 2008-12-16 19:09:55 UTC (rev 9145)
@@ -221,6 +221,7 @@
# plcol0(1)
# pllab("X Coordinate", "Y Coordinate", "Streamlines of flow")
+ pl_setcontlabelformat(4,3)
pl_setcontlabelparam(0.006, 0.3, 0.1, 1)
plenv(-1.0, 1.0, -1.0, 1.0, 0, 0)
plcol0(2)
Modified: trunk/examples/tcl/x09.tcl
===================================================================
--- trunk/examples/tcl/x09.tcl 2008-12-16 18:41:35 UTC (rev 9144)
+++ trunk/examples/tcl/x09.tcl 2008-12-16 19:09:55 UTC (rev 9145)
@@ -85,6 +85,7 @@
# $w cmd plcol0 1
# $w cmd pllab "X Coordinate" "Y Coordinate" "Streamlines of flow"
+ $w cmd pl_setcontlabelformat 4 3
$w cmd pl_setcontlabelparam 0.006 0.3 0.1 1
$w cmd plenv -1.0 1.0 -1.0 1.0 0 0
$w cmd plcol0 2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-12-17 15:50:24
|
Revision: 9165
http://plplot.svn.sourceforge.net/plplot/?rev=9165&view=rev
Author: andrewross
Date: 2008-12-17 15:50:18 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Fix some differences in text output between different versions of
example 23.
Modified Paths:
--------------
trunk/examples/ada/x23a.adb.cmake
trunk/examples/c++/x23.cc
trunk/examples/java/x23.java
Modified: trunk/examples/ada/x23a.adb.cmake
===================================================================
--- trunk/examples/ada/x23a.adb.cmake 2008-12-17 15:35:45 UTC (rev 9164)
+++ trunk/examples/ada/x23a.adb.cmake 2008-12-17 15:50:18 UTC (rev 9165)
@@ -367,7 +367,7 @@
Put("For example 23 prior to page 12 the FCI is ");
Put(fci_old, Base => 16, Width => 0);
New_Line;
- Put("For example 23 prior to page 12 the font family, style and weight are "
+ Put("For example 23 prior to page 12 the font family, style and weight are "
& family(ifamily) & " " & style(istyle) & " " & weight(iweight));
New_Line;
Modified: trunk/examples/c++/x23.cc
===================================================================
--- trunk/examples/c++/x23.cc 2008-12-17 15:35:45 UTC (rev 9164)
+++ trunk/examples/c++/x23.cc 2008-12-17 15:50:18 UTC (rev 9165)
@@ -312,7 +312,7 @@
pls->gfci(fci_old);
pls->gfont(ifamily, istyle, iweight);
cout << "For example 23 prior to page 12 the FCI is 0x" << hex << fci_old << endl;
- cout << "For example 23 prior to page 12 the family, style and weight are " << family[ifamily] << " " << style[istyle] << " " << weight[iweight] << endl;
+ cout << "For example 23 prior to page 12 the font family, style and weight are " << family[ifamily] << " " << style[istyle] << " " << weight[iweight] << endl;
for (page=11; page<16; page++) {
PLFLT dy = 0.030;
Modified: trunk/examples/java/x23.java
===================================================================
--- trunk/examples/java/x23.java 2008-12-17 15:35:45 UTC (rev 9164)
+++ trunk/examples/java/x23.java 2008-12-17 15:50:18 UTC (rev 9165)
@@ -298,7 +298,7 @@
pls.gfci(fci_old);
pls.gfont(ifamily, istyle, iweight);
System.out.println("For example 23 prior to page 12 the FCI is 0x"+Long.toHexString(fci_old[0]));
- System.out.println("For example 23 prior to page 12 the family, style and weight are "+family[ifamily[0]]+" "+ style[istyle[0]]+ " "+ weight[iweight[0]]);;
+ System.out.println("For example 23 prior to page 12 the font family, style and weight are "+family[ifamily[0]]+" "+ style[istyle[0]]+ " "+ weight[iweight[0]]);;
for (page=11; page<16; page++) {
double dy = 0.030;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-12-17 16:20:02
|
Revision: 9168
http://plplot.svn.sourceforge.net/plplot/?rev=9168&view=rev
Author: andrewross
Date: 2008-12-17 16:19:58 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Trim excess whitespace in output from fortran versions of example 23.
Modified Paths:
--------------
trunk/examples/f77/x23f.fm4
trunk/examples/f95/x23f.f90
Modified: trunk/examples/f77/x23f.fm4
===================================================================
--- trunk/examples/f77/x23f.fm4 2008-12-17 15:59:05 UTC (rev 9167)
+++ trunk/examples/f77/x23f.fm4 2008-12-17 16:19:58 UTC (rev 9168)
@@ -314,8 +314,8 @@
& ,fci_old
write (*,'(a)') 'For example 23 prior to page 12 the '//
& 'font family, style and weight are '//
- & family(ifamily+1)//' '//style(istyle+1)//' '//
- & weight(iweight+1)
+ & trim(family(ifamily+1))//' '//trim(style(istyle+1))//' '//
+ & trim(weight(iweight+1))
do 140 page=11,15
dy = 0.030d0
Modified: trunk/examples/f95/x23f.f90
===================================================================
--- trunk/examples/f95/x23f.f90 2008-12-17 15:59:05 UTC (rev 9167)
+++ trunk/examples/f95/x23f.f90 2008-12-17 16:19:58 UTC (rev 9168)
@@ -303,7 +303,7 @@
call plgfont(ifamily, istyle, iweight)
write (*,'(a,z8)') 'For example 23 prior to page 12 the FCI is 0x',fci_old
write (*,'(a)') 'For example 23 prior to page 12 the font family, style and weight are '// &
- family(ifamily+1)//' '//style(istyle+1)//' '//weight(iweight+1)
+ trim(family(ifamily+1))//' '//trim(style(istyle+1))//' '//trim(weight(iweight+1))
do page=11,15
dy = 0.030_plflt
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2008-12-17 20:27:38
|
Revision: 9172
http://plplot.svn.sourceforge.net/plplot/?rev=9172&view=rev
Author: airwin
Date: 2008-12-17 20:27:34 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Move Makefile.examples to Makefile.examples.in so we can configure it.
Modified Paths:
--------------
trunk/examples/CMakeLists.txt
Added Paths:
-----------
trunk/examples/Makefile.examples.in
Removed Paths:
-------------
trunk/examples/Makefile.examples
Modified: trunk/examples/CMakeLists.txt
===================================================================
--- trunk/examples/CMakeLists.txt 2008-12-17 19:59:43 UTC (rev 9171)
+++ trunk/examples/CMakeLists.txt 2008-12-17 20:27:34 UTC (rev 9172)
@@ -84,7 +84,13 @@
add_subdirectory(ocaml)
endif(ENABLE_ocaml)
-install(FILES Makefile.examples
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples
+ @ONLY
+ )
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples
DESTINATION ${DATA_DIR}/examples
RENAME Makefile
)
Deleted: trunk/examples/Makefile.examples
===================================================================
--- trunk/examples/Makefile.examples 2008-12-17 19:59:43 UTC (rev 9171)
+++ trunk/examples/Makefile.examples 2008-12-17 20:27:34 UTC (rev 9172)
@@ -1,36 +0,0 @@
-# examples/Makefile.examples.in for PLplot
-###
-### Process this file with configure to produce Makefile.examples
-###
-# Copyright (C) 2004 Alan W. Irwin
-#
-# This file is part of PLplot.
-#
-# PLplot is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# PLplot is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with the file PLplot; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-# This Makefile should not be used in the build tree. It is meant for use
-# only in the install tree. It is first configured, then installed
-# (with the name Makefile) in the _installed_ examples directory as a
-# convenience to the user for building all the examples without having
-# to invoke make in the individual sub-directories of examples.
-
-SUBDIRS = c c++ f77 f95 tk java ada ocaml
-all clean:
- target=`echo $@`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test -d "$$subdir"; then \
- echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $$target); \
- fi; \
- done
Copied: trunk/examples/Makefile.examples.in (from rev 9170, trunk/examples/Makefile.examples)
===================================================================
--- trunk/examples/Makefile.examples.in (rev 0)
+++ trunk/examples/Makefile.examples.in 2008-12-17 20:27:34 UTC (rev 9172)
@@ -0,0 +1,36 @@
+# examples/Makefile.examples.in for PLplot
+###
+### Process this file with configure to produce Makefile.examples
+###
+# Copyright (C) 2004 Alan W. Irwin
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with the file PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This Makefile should not be used in the build tree. It is meant for use
+# only in the install tree. It is first configured, then installed
+# (with the name Makefile) in the _installed_ examples directory as a
+# convenience to the user for building all the examples without having
+# to invoke make in the individual sub-directories of examples.
+
+SUBDIRS = c c++ f77 f95 tk java ada ocaml
+all clean:
+ target=`echo $@`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test -d "$$subdir"; then \
+ echo "Making $$target in $$subdir"; \
+ (cd $$subdir && $(MAKE) $$target); \
+ fi; \
+ done
Property changes on: trunk/examples/Makefile.examples.in
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-12-17 21:54:01
|
Revision: 9175
http://plplot.svn.sourceforge.net/plplot/?rev=9175&view=rev
Author: andrewross
Date: 2008-12-17 21:53:57 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Update C and python versions of example 31 to avoid testing for
equality of real numbers. Rounding errors on some system could cause
these tests to fail erroneously.
Modified Paths:
--------------
trunk/examples/c/x31c.c
trunk/examples/python/xw31.py
Modified: trunk/examples/c/x31c.c
===================================================================
--- trunk/examples/c/x31c.c 2008-12-17 21:52:41 UTC (rev 9174)
+++ trunk/examples/c/x31c.c 2008-12-17 21:53:57 UTC (rev 9175)
@@ -213,7 +213,10 @@
plsdiplz(0.1, 0.1, 0.9, 0.9);
plgdiplt(&zxmin, &zymin, &zxmax, &zymax);
printf("zoomed plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f \n", zxmin, zymin, zxmax, zymax);
- if (zxmin != xmin + (xmax-xmin)*0.1 || zxmax != xmin+(xmax-xmin)*0.9 || zymin != ymin+(ymax-ymin)*0.1 || zymax != ymin+(ymax-ymin)*0.9) {
+ if ( fabs(zxmin -(xmin + (xmax-xmin)*0.1)) > 1.0E-5 ||
+ fabs(zxmax -(xmin+(xmax-xmin)*0.9)) > 1.0E-5 ||
+ fabs(zymin -(ymin+(ymax-ymin)*0.1)) > 1.0E-5 ||
+ fabs(zymax -(ymin+(ymax-ymin)*0.9)) > 1.0E-5 ) {
fputs("plsdiplz test failed\n",stderr);
plend();
exit(1);
Modified: trunk/examples/python/xw31.py
===================================================================
--- trunk/examples/python/xw31.py 2008-12-17 21:52:41 UTC (rev 9174)
+++ trunk/examples/python/xw31.py 2008-12-17 21:53:57 UTC (rev 9175)
@@ -187,7 +187,7 @@
plsdiplz(0.1, 0.1, 0.9, 0.9)
(zxmin, zymin, zxmax, zymax) = plgdiplt()
sys.stdout.write("zoomed plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f \n" % (zxmin, zymin, zxmax, zymax))
- if zxmin != xmin+(xmax-xmin)*0.1 or zxmax != xmin+(xmax-xmin)*0.9 or zymin != ymin+(ymax-ymin)*0.1 or zymax != ymin+(ymax-ymin)*0.9:
+ if abs(zxmin -(xmin + (xmax-xmin)*0.1)) > 1.0E-5 or abs(zxmax -(xmin+(xmax-xmin)*0.9)) > 1.0E-5 or abs(zymin -(ymin+(ymax-ymin)*0.1)) > 1.0E-5 or abs(zymax -(ymin+(ymax-ymin)*0.9)) > 1.0E-5 :
sys.stderr.write("plsdiplz test failed\n")
plend()
sys.exit(1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2008-12-18 00:37:43
|
Revision: 9176
http://plplot.svn.sourceforge.net/plplot/?rev=9176&view=rev
Author: airwin
Date: 2008-12-18 00:37:32 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
Configure install-tree examples overall Makefile to have a test_interactive
target (to run automatic tests) and a test target (to run the same
plplot-test.sh combinations that ctest does in the build tree). The
advantage here for multiprocessor boxes is you can do these tests in
parallel by using the -j option on the "make test" command.
Modified Paths:
--------------
trunk/examples/CMakeLists.txt
trunk/examples/Makefile.examples.in
Modified: trunk/examples/CMakeLists.txt
===================================================================
--- trunk/examples/CMakeLists.txt 2008-12-17 21:53:57 UTC (rev 9175)
+++ trunk/examples/CMakeLists.txt 2008-12-18 00:37:32 UTC (rev 9176)
@@ -84,6 +84,74 @@
add_subdirectory(ocaml)
endif(ENABLE_ocaml)
+# Configure Makefile.examples with some specific variables
+
+if(PLD_ps)
+ set(PSC_ALL x01c.psc)
+else(PLD_ps)
+ set(PSC_ALL_COMMENT "#")
+endif(PLD_ps)
+
+if(PLD_pdfcairo)
+ set(PDFCAIRO x01c.pdfcairo)
+else(PLD_pdfcairo)
+ set(PDFCAIRO_COMMENT "#")
+endif(PLD_pdfcairo)
+
+if(PLD_pngcairo)
+ set(PNGCAIRO x01c01.pngcairo)
+else(PLD_pngcairo)
+ set(PNGCAIRO_COMMENT "#")
+endif(PLD_pngcairo)
+
+if(PLD_pscairo)
+ set(PSCAIRO x01c.pscairo)
+else(PLD_pscairo)
+ set(PSCAIRO_COMMENT "#")
+endif(PLD_pscairo)
+
+if(PLD_svgcairo)
+ set(SVGCAIRO x01c01.svgcairo)
+else(PLD_svgcairo)
+ set(SVGCAIRO_COMMENT "#")
+endif(PLD_svgcairo)
+
+if(PLD_gif)
+ set(GIF x01c01.gif)
+else(PLD_gif)
+ set(GIF_COMMENT "#")
+endif(PLD_gif)
+
+if(PLD_jpeg)
+ set(JPEG x01c01.jpeg)
+else(PLD_jpeg)
+ set(JPEG_COMMENT "#")
+endif(PLD_jpeg)
+
+if(PLD_png)
+ set(PNG x01c01.png)
+else(PLD_png)
+ set(PNG_COMMENT "#")
+endif(PLD_png)
+
+if(PLD_psttf)
+ set(PSTTFC x01c.psttfc)
+else(PLD_psttf)
+ set(PSTTFC_COMMENT "#")
+endif(PLD_psttf)
+
+if(PLD_svg)
+ set(SVG x01c01.svg)
+else(PLD_svg)
+ set(SVG_COMMENT "#")
+endif(PLD_svg)
+
+if(PLD_xfig)
+ set(XFIG x01c01.xfig)
+else(PLD_xfig)
+ set(XFIG_COMMENT "#")
+endif(PLD_xfig)
+
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in
${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples
Modified: trunk/examples/Makefile.examples.in
===================================================================
--- trunk/examples/Makefile.examples.in 2008-12-17 21:53:57 UTC (rev 9175)
+++ trunk/examples/Makefile.examples.in 2008-12-18 00:37:32 UTC (rev 9176)
@@ -1,8 +1,8 @@
# examples/Makefile.examples.in for PLplot
-###
-### Process this file with configure to produce Makefile.examples
-###
-# Copyright (C) 2004 Alan W. Irwin
+# configured by our CMake-based build system to examples/Makefile.examples
+# in the build tree and installed as examples/Makefile in the install tree.
+
+# Copyright (C) 2004, 2008 Alan W. Irwin
#
# This file is part of PLplot.
#
@@ -26,11 +26,81 @@
# to invoke make in the individual sub-directories of examples.
SUBDIRS = c c++ f77 f95 tk java ada ocaml
-all clean:
+all: c/x01c@EXEEXT@
+
+# Need real file here as target so that tests don't depend on all (which means
+# they would always be out of date).
+
+c/x01c@EXEEXT@:
target=`echo $@`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test -d "$$subdir"; then \
echo "Making $$target in $$subdir"; \
+ (cd $$subdir && $(MAKE)); \
+ fi; \
+ done
+
+test: @PSC_ALL@ @PDFCAIRO@ @PNGCAIRO@ @PSCAIRO@ @SVGCAIRO@ \
+ @GIF@ @JPEG@ @PNG@ @PSTTFC@ @SVG@ @XFIG@
+
+@PSC_ALL_COMMENT@@PSC_ALL@: c/x01c@EXEEXT@
+@PSC_ALL_COMMENT@ echo psc all front-ends
+@PSC_ALL_COMMENT@ ./plplot-test.sh --device=psc
+
+@PDFCAIRO_COMMENT@@PDFCAIRO@: c/x01c@EXEEXT@
+@PDFCAIRO_COMMENT@ echo pdfcairo
+@PDFCAIRO_COMMENT@ ./plplot-test.sh --front-end=c --device=pdfcairo
+
+@PNGCAIRO_COMMENT@@PNGCAIRO@: c/x01c@EXEEXT@
+@PNGCAIRO_COMMENT@ echo pngcairo
+@PNGCAIRO_COMMENT@ ./plplot-test.sh --front-end=c --device=pngcairo
+
+@PSCAIRO_COMMENT@@PSCAIRO@: c/x01c@EXEEXT@
+@PSCAIRO_COMMENT@ echo pscairo
+@PSCAIRO_COMMENT@ ./plplot-test.sh --front-end=c --device=pscairo
+
+@SVGCAIRO_COMMENT@@SVGCAIRO@: c/x01c@EXEEXT@
+@SVGCAIRO_COMMENT@ echo svgcairo
+@SVGCAIRO_COMMENT@ ./plplot-test.sh --front-end=c --device=svgcairo
+
+@GIF_COMMENT@@GIF@: c/x01c@EXEEXT@
+@GIF_COMMENT@ echo gif
+@GIF_COMMENT@ ./plplot-test.sh --front-end=c --device=gif
+
+@JPEG_COMMENT@@JPEG@: c/x01c@EXEEXT@
+@JPEG_COMMENT@ echo jpeg
+@JPEG_COMMENT@ ./plplot-test.sh --front-end=c --device=jpeg
+
+@PNG_COMMENT@@PNG@: c/x01c@EXEEXT@
+@PNG_COMMENT@ echo png
+@PNG_COMMENT@ ./plplot-test.sh --front-end=c --device=png
+
+@PSTTFC_COMMENT@@PSTTFC@: c/x01c@EXEEXT@
+@PSTTFC_COMMENT@ echo psttfc
+@PSTTFC_COMMENT@ ./plplot-test.sh --front-end=c --device=psttfc
+
+@SVG_COMMENT@@SVG@: c/x01c@EXEEXT@
+@SVG_COMMENT@ echo svg
+@SVG_COMMENT@ ./plplot-test.sh --front-end=c --device=svg
+
+@XFIG_COMMENT@@XFIG@: c/x01c@EXEEXT@
+@XFIG_COMMENT@ echo xfig
+@XFIG_COMMENT@ ./plplot-test.sh --front-end=c --device=xfig
+
+test_interactive:
+ ./plplot-test-interactive.sh
+
+clean: test_clean
+ target=`echo $@`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test -d "$$subdir"; then \
+ echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target); \
fi; \
done
+
+test_clean:
+ rm -f *.psc *.pdfcairo *.pngcairo *.pscairo *.svgcairo \
+ *.gif *.jpeg *.png *.psttfc *.svg *.xfig *.txt test.error
+
+.PHONY : all clean test test_clean test_interactive
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2008-12-18 01:03:56
|
Revision: 9177
http://plplot.svn.sourceforge.net/plplot/?rev=9177&view=rev
Author: airwin
Date: 2008-12-18 01:03:52 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
Add the compare test to those that are run in the install tree.
Modified Paths:
--------------
trunk/examples/CMakeLists.txt
trunk/examples/Makefile.examples.in
Modified: trunk/examples/CMakeLists.txt
===================================================================
--- trunk/examples/CMakeLists.txt 2008-12-18 00:37:32 UTC (rev 9176)
+++ trunk/examples/CMakeLists.txt 2008-12-18 01:03:52 UTC (rev 9177)
@@ -152,6 +152,12 @@
set(XFIG_COMMENT "#")
endif(PLD_xfig)
+if(DIFF_EXECUTABLE AND TAIL_EXECUTABLE)
+ set(COMPARE compare)
+else(DIFF_EXECUTABLE AND TAIL_EXECUTABLE)
+ set(COMPARE_COMMENT "#")
+endif(DIFF_EXECUTABLE AND TAIL_EXECUTABLE)
+
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in
${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples
Modified: trunk/examples/Makefile.examples.in
===================================================================
--- trunk/examples/Makefile.examples.in 2008-12-18 00:37:32 UTC (rev 9176)
+++ trunk/examples/Makefile.examples.in 2008-12-18 01:03:52 UTC (rev 9177)
@@ -41,7 +41,7 @@
done
test: @PSC_ALL@ @PDFCAIRO@ @PNGCAIRO@ @PSCAIRO@ @SVGCAIRO@ \
- @GIF@ @JPEG@ @PNG@ @PSTTFC@ @SVG@ @XFIG@
+ @GIF@ @JPEG@ @PNG@ @PSTTFC@ @SVG@ @XFIG@ @COMPARE@
@PSC_ALL_COMMENT@@PSC_ALL@: c/x01c@EXEEXT@
@PSC_ALL_COMMENT@ echo psc all front-ends
@@ -87,6 +87,11 @@
@XFIG_COMMENT@ echo xfig
@XFIG_COMMENT@ ./plplot-test.sh --front-end=c --device=xfig
+@COMPARE_COMMENT@@COMPARE@: @PSC_ALL@ @PDFCAIRO@ @PNGCAIRO@ @PSCAIRO@ @SVGCAIRO@ \
+ @GIF@ @JPEG@ @PNG@ @PSTTFC@ @SVG@ @XFIG@
+@COMPARE_COMMENT@ echo compare
+@COMPARE_COMMENT@ ./test_diff.sh
+
test_interactive:
./plplot-test-interactive.sh
@@ -103,4 +108,4 @@
rm -f *.psc *.pdfcairo *.pngcairo *.pscairo *.svgcairo \
*.gif *.jpeg *.png *.psttfc *.svg *.xfig *.txt test.error
-.PHONY : all clean test test_clean test_interactive
+.PHONY : all clean test test_clean test_interactive @COMPARE@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-12-18 13:54:25
|
Revision: 9192
http://plplot.svn.sourceforge.net/plplot/?rev=9192&view=rev
Author: andrewross
Date: 2008-12-18 13:54:22 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
Update C and python versions of example 31 to remove extraneous
whitespace and to only call plend at the end of the example, even if one
of the get / set tests fails.
Modified Paths:
--------------
trunk/examples/c/x31c.c
trunk/examples/python/xw31.py
Modified: trunk/examples/c/x31c.c
===================================================================
--- trunk/examples/c/x31c.c 2008-12-18 13:53:22 UTC (rev 9191)
+++ trunk/examples/c/x31c.c 2008-12-18 13:54:22 UTC (rev 9192)
@@ -78,7 +78,6 @@
printf("compression parameter = %d\n", compression2);
if (compression2 != compression1) {
fputs("plgcompression test failed\n",stderr);
- plend();
status = 1;
}
@@ -88,7 +87,6 @@
printf("family parameters: fam, num, bmax = %d %d %d\n", fam2, num2, bmax2);
if (fam2 != fam1 || num2 != num1 || bmax2 != bmax1) {
fputs("plgfam test failed\n",stderr);
- plend();
status = 1;
}
@@ -99,7 +97,6 @@
if (xp2 != xp1 || yp2 != yp1 || xleng2 != xleng1 || yleng2 != yleng1 ||
xoff2 != xoff1 || yoff2 != yoff1 ) {
fputs("plgpage test failed\n",stderr);
- plend();
status = 1;
}
@@ -115,17 +112,15 @@
printf("level parameter = %d\n", level2);
if (level2 != 1) {
fputs("plglevel test failed.\n",stderr);
- plend();
status = 1;
}
pladv(0);
plvpor(0.01, 0.99, 0.02, 0.49);
plgvpd(&xmin, &xmax, &ymin, &ymax);
- printf("plvpor: xmin, xmax, ymin, ymax = %f %f %f %f \n", xmin, xmax, ymin, ymax);
+ printf("plvpor: xmin, xmax, ymin, ymax = %f %f %f %f\n", xmin, xmax, ymin, ymax);
if (xmin != 0.01 || xmax != 0.99 || ymin != 0.02 || ymax != 0.49) {
fputs("plgvpd test failed\n",stderr);
- plend();
status = 1;
}
xmid = 0.5*(xmin+xmax);
@@ -133,19 +128,17 @@
plwind(0.2, 0.3, 0.4, 0.5);
plgvpw(&xmin, &xmax, &ymin, &ymax);
- printf("plwind: xmin, xmax, ymin, ymax = %f %f %f %f \n", xmin, xmax, ymin, ymax);
+ printf("plwind: xmin, xmax, ymin, ymax = %f %f %f %f\n", xmin, xmax, ymin, ymax);
if (xmin != 0.2 || xmax != 0.3 || ymin != 0.4 || ymax != 0.5) {
fputs("plgvpw test failed\n",stderr);
- plend();
status = 1;
}
/* Get world coordinates for middle of viewport */
plcalc_world(xmid,ymid,&wx,&wy,&win);
- printf("world parameters: wx, wy, win = %f %f %d \n", wx, wy, win);
+ printf("world parameters: wx, wy, win = %f %f %d\n", wx, wy, win);
if (fabs(wx-0.5*(xmin+xmax))>1.0E-5 || fabs(wy-0.5*(ymin+ymax))>1.0E-5) {
fputs("plcalc_world test failed\n",stderr);
- plend();
status = 1;
}
@@ -167,85 +160,76 @@
value */
plsxax(3,0);
plgxax(&digmax,&digits);
- printf("x axis parameters: digmax, digits = %d %d \n", digmax, digits);
+ printf("x axis parameters: digmax, digits = %d %d\n", digmax, digits);
if (digmax != 3) {
fputs("plgxax test failed\n",stderr);
- plend();
status = 1;
}
plsyax(4,0);
plgyax(&digmax,&digits);
- printf("y axis parameters: digmax, digits = %d %d \n", digmax, digits);
+ printf("y axis parameters: digmax, digits = %d %d\n", digmax, digits);
if (digmax != 4) {
fputs("plgyax test failed\n",stderr);
- plend();
status = 1;
}
plszax(5,0);
plgzax(&digmax,&digits);
- printf("z axis parameters: digmax, digits = %d %d \n", digmax, digits);
+ printf("z axis parameters: digmax, digits = %d %d\n", digmax, digits);
if (digmax != 5) {
fputs("plgzax test failed\n",stderr);
- plend();
status = 1;
}
plsdidev(0.05, PL_NOTSET, 0.1, 0.2);
plgdidev(&mar, &aspect, &jx, &jy);
- printf("device-space window parameters: mar, aspect, jx, jy = %f %f %f %f \n" , mar, aspect, jx, jy);
+ printf("device-space window parameters: mar, aspect, jx, jy = %f %f %f %f\n" , mar, aspect, jx, jy);
if (mar != 0.05 || jx != 0.1 || jy != 0.2) {
fputs("plgdidev test failed\n",stderr);
- plend();
status = 1;
}
plsdiori(1.0);
plgdiori(&ori);
- printf("ori parameter = %f \n", ori);
+ printf("ori parameter = %f\n", ori);
if (ori != 1.0) {
fputs("plgdiori test failed\n",stderr);
- plend();
status = 1;
}
plsdiplt(0.1, 0.2, 0.9, 0.8);
plgdiplt(&xmin, &ymin, &xmax, &ymax);
- printf("plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f \n", xmin, ymin, xmax, ymax);
+ printf("plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f\n", xmin, ymin, xmax, ymax);
if (xmin != 0.1 || xmax != 0.9 || ymin != 0.2 || ymax != 0.8) {
fputs("plgdiplt test failed\n",stderr);
- plend();
status = 1;
}
plsdiplz(0.1, 0.1, 0.9, 0.9);
plgdiplt(&zxmin, &zymin, &zxmax, &zymax);
- printf("zoomed plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f \n", zxmin, zymin, zxmax, zymax);
+ printf("zoomed plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f\n", zxmin, zymin, zxmax, zymax);
if ( fabs(zxmin -(xmin + (xmax-xmin)*0.1)) > 1.0E-5 ||
fabs(zxmax -(xmin+(xmax-xmin)*0.9)) > 1.0E-5 ||
fabs(zymin -(ymin+(ymax-ymin)*0.1)) > 1.0E-5 ||
fabs(zymax -(ymin+(ymax-ymin)*0.9)) > 1.0E-5 ) {
fputs("plsdiplz test failed\n",stderr);
- plend();
status = 1;
}
plscolbg(10,20,30);
plgcolbg(&r, &g, &b);
- printf("background colour parameters: r, g, b = %d %d %d \n", r, g, b);
+ printf("background colour parameters: r, g, b = %d %d %d\n", r, g, b);
if (r != 10 || g != 20 || b != 30) {
fputs("plgcolbg test failed\n",stderr);
- plend();
status = 1;
}
plscolbga(20,30,40,0.5);
plgcolbga(&r, &g, &b, &a);
- printf("background/transparency colour parameters: r, g, b, a = %d %d %d %f \n", r, g, b, a);
+ printf("background/transparency colour parameters: r, g, b, a = %d %d %d %f\n", r, g, b, a);
if (r != 20 || g != 30 || b != 40 || a != 0.5) {
fputs("plgcolbga test failed\n",stderr);
- plend();
status = 1;
}
Modified: trunk/examples/python/xw31.py
===================================================================
--- trunk/examples/python/xw31.py 2008-12-18 13:53:22 UTC (rev 9191)
+++ trunk/examples/python/xw31.py 2008-12-18 13:54:22 UTC (rev 9192)
@@ -65,7 +65,6 @@
sys.stdout.write("compression parameter = %d\n" % compression2)
if compression2 != compression1:
sys.stderr.write("plgcompression test failed\n")
- plend()
status = 1
# Test if device initialization screwed around with any of the
@@ -74,7 +73,6 @@
sys.stdout.write("family parameters: fam, num, bmax = %d %d %d\n" % (fam2, num2, bmax2))
if fam2 != fam1 or num2 != num1 or bmax2 != bmax1:
sys.stderr.write("plgfam test failed\n")
- plend()
status = 1
# Test if device initialization screwed around with any of the
@@ -83,7 +81,6 @@
sys.stdout.write("page parameters: xp, yp, xleng, yleng, xoff, yoff = %f %f %d %d %d %d\n" % (xp2, yp2, xleng2, yleng2, xoff2, yoff2))
if xp2 != xp1 or yp2 != yp1 or xleng2 != xleng1 or yleng2 != yleng1 or xoff2 != xoff1 or yoff2 != yoff1:
sys.stderr.write("plgpage test failed\n")
- plend()
status = 1
# Exercise plscolor, plscol0, plscmap1, and plscmap1a to make sure
@@ -101,34 +98,30 @@
sys.stdout.write("level parameter = %d\n" % level2)
if level2 != 1:
sys.stderr.write("plglevel test failed.\n")
- plend()
status = 1
pladv(0)
plvpor(0.01, 0.99, 0.02, 0.49)
(xmin, xmax, ymin, ymax) = plgvpd()
- sys.stdout.write("plvpor: xmin, xmax, ymin, ymax = %f %f %f %f \n" % (xmin, xmax, ymin, ymax))
+ sys.stdout.write("plvpor: xmin, xmax, ymin, ymax = %f %f %f %f\n" % (xmin, xmax, ymin, ymax))
if xmin != 0.01 or xmax != 0.99 or ymin != 0.02 or ymax != 0.49:
sys.stderr.write("plgvpd test failed\n")
- plend()
status = 1
xmid = 0.5*(xmin+xmax)
ymid = 0.5*(ymin+ymax)
plwind(0.2, 0.3, 0.4, 0.5)
(xmin, xmax, ymin, ymax) = plgvpw()
- sys.stdout.write("plwind: xmin, xmax, ymin, ymax = %f %f %f %f \n" % (xmin, xmax, ymin, ymax))
+ sys.stdout.write("plwind: xmin, xmax, ymin, ymax = %f %f %f %f\n" % (xmin, xmax, ymin, ymax))
if xmin != 0.2 or xmax != 0.3 or ymin != 0.4 or ymax != 0.5:
sys.stderr.write("plgvpw test failed\n")
- plend()
status = 1
# Get world coordinates for middle of viewport
(wx, wy, win) = plcalc_world(xmid,ymid)
- sys.stdout.write("world parameters: wx, wy, win = %f %f %d \n" % (wx, wy, win))
+ sys.stdout.write("world parameters: wx, wy, win = %f %f %d\n" % (wx, wy, win))
if abs(wx-0.5*(xmin+xmax)) > 1.0E-5 or abs(wy-0.5*(ymin+ymax)) > 1.0E-5:
sys.stderr.write("plcalc_world test failed\n")
- plend()
status = 1
# Retrieve and print the name of the output file (if any)
@@ -144,74 +137,65 @@
# therefore it does not make sense to test the returned value.
plsxax(3,0)
(digmax, digits) = plgxax()
- sys.stdout.write("x axis parameters: digmax, digits = %d %d \n" % (digmax, digits))
+ sys.stdout.write("x axis parameters: digmax, digits = %d %d\n" % (digmax, digits))
if digmax != 3:
sys.stderr.write("plgxax test failed\n")
- plend()
status = 1
plsyax(4,0)
(digmax, digits) = plgyax()
- sys.stdout.write("y axis parameters: digmax, digits = %d %d \n" % (digmax, digits))
+ sys.stdout.write("y axis parameters: digmax, digits = %d %d\n" % (digmax, digits))
if digmax != 4:
sys.stderr.write("plgyax test failed\n")
- plend()
status = 1
plszax(5,0)
(digmax, digits) = plgzax()
- sys.stdout.write("z axis parameters: digmax, digits = %d %d \n" % (digmax, digits))
+ sys.stdout.write("z axis parameters: digmax, digits = %d %d\n" % (digmax, digits))
if digmax != 5:
sys.stderr.write("plgzax test failed\n")
- plend()
status = 1
plsdidev(0.05, PL_NOTSET, 0.1, 0.2)
(mar, aspect, jx, jy) = plgdidev()
- sys.stdout.write("device-space window parameters: mar, aspect, jx, jy = %f %f %f %f \n" % (mar, aspect, jx, jy))
+ sys.stdout.write("device-space window parameters: mar, aspect, jx, jy = %f %f %f %f\n" % (mar, aspect, jx, jy))
if mar != 0.05 or jx != 0.1 or jy != 0.2:
sys.stderr.write("plgdidev test failed\n")
- plend()
status = 1
plsdiori(1.0)
ori = plgdiori()
- sys.stdout.write("ori parameter = %f \n" % ori)
+ sys.stdout.write("ori parameter = %f\n" % ori)
if ori != 1.0 :
sys.stderr.write("plgdiori test failed\n")
- plend()
status = 1
plsdiplt(0.1, 0.2, 0.9, 0.8)
(xmin, ymin, xmax, ymax) = plgdiplt()
- sys.stdout.write("plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f \n" % (xmin, ymin, xmax, ymax))
+ sys.stdout.write("plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f\n" % (xmin, ymin, xmax, ymax))
if xmin != 0.1 or xmax != 0.9 or ymin != 0.2 or ymax != 0.8:
sys.stderr.write("plgdiplt test failed\n")
- plend()
status = 1
plsdiplz(0.1, 0.1, 0.9, 0.9)
(zxmin, zymin, zxmax, zymax) = plgdiplt()
- sys.stdout.write("zoomed plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f \n" % (zxmin, zymin, zxmax, zymax))
+ sys.stdout.write("zoomed plot-space window parameters: xmin, ymin, xmax, ymax = %f %f %f %f\n" % (zxmin, zymin, zxmax, zymax))
if abs(zxmin -(xmin + (xmax-xmin)*0.1)) > 1.0E-5 or abs(zxmax -(xmin+(xmax-xmin)*0.9)) > 1.0E-5 or abs(zymin -(ymin+(ymax-ymin)*0.1)) > 1.0E-5 or abs(zymax -(ymin+(ymax-ymin)*0.9)) > 1.0E-5 :
sys.stderr.write("plsdiplz test failed\n")
- plend()
status = 1
plscolbg(10,20,30)
(r, g, b) = plgcolbg()
- sys.stdout.write("background colour parameters: r, g, b = %d %d %d \n" % (r, g, b))
+ sys.stdout.write("background colour parameters: r, g, b = %d %d %d\n" % (r, g, b))
if r != 10 or g != 20 or b != 30:
sys.stderr.write("plgcolbg test failed\n")
- plend()
status = 1
plscolbga(20, 30, 40, 0.5)
(r, g, b, a) = plgcolbga()
- sys.stdout.write("background/transparency colour parameters: r, g, b, a = %d %d %d %f \n" % (r, g, b, a))
+ sys.stdout.write("background/transparency colour parameters: r, g, b, a = %d %d %d %f\n" % (r, g, b, a))
if r != 20 or g != 30 or b != 40 or a != 0.5:
sys.stderr.write("plgcolbga test failed\n")
- plend()
status = 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2008-12-20 01:14:25
|
Revision: 9212
http://plplot.svn.sourceforge.net/plplot/?rev=9212&view=rev
Author: airwin
Date: 2008-12-20 01:14:22 +0000 (Sat, 20 Dec 2008)
Log Message:
-----------
Tweak fortran formats to make example 31 stdout results consistent with C.
Modified Paths:
--------------
trunk/examples/f77/x31f.fm4
trunk/examples/f95/x31f.f90
Modified: trunk/examples/f77/x31f.fm4
===================================================================
--- trunk/examples/f77/x31f.fm4 2008-12-20 00:57:35 UTC (rev 9211)
+++ trunk/examples/f77/x31f.fm4 2008-12-20 01:14:22 UTC (rev 9212)
@@ -83,7 +83,7 @@
C compression parameter.
call plgcompression(compression2)
write(*,'(A)') 'Output various PLplot parameters'
- write(*,'(A,I3)') 'compression parameter = ', compression2
+ write(*,'(A,I2)') 'compression parameter = ', compression2
if (compression2 .ne. compression1) then
write(stderr,*) 'plgcompression test failed'
status = 1;
Modified: trunk/examples/f95/x31f.f90
===================================================================
--- trunk/examples/f95/x31f.f90 2008-12-20 00:57:35 UTC (rev 9211)
+++ trunk/examples/f95/x31f.f90 2008-12-20 01:14:22 UTC (rev 9212)
@@ -82,7 +82,7 @@
! compression parameter.
call plgcompression(compression2)
write(*,'(A)') 'Output various PLplot parameters'
- write(*,'(A,I3)') 'compression parameter = ', compression2
+ write(*,'(A,I2)') 'compression parameter = ', compression2
if (compression2 .ne. compression1) then
write(stderr,*) 'plgcompression test failed'
status = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2009-01-07 16:11:06
|
Revision: 9273
http://plplot.svn.sourceforge.net/plplot/?rev=9273&view=rev
Author: andrewross
Date: 2009-01-07 16:10:59 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
Update example 14 to consistently get and set the familying properties
for the second stream in all languages.
Modified Paths:
--------------
trunk/examples/ada/x14a.adb.cmake
trunk/examples/ada/xthick14a.adb.cmake
trunk/examples/c/x14c.c
trunk/examples/c++/x14.cc
trunk/examples/f77/x14f.fm4
trunk/examples/f95/x14f.f90
trunk/examples/java/x14.java
trunk/examples/ocaml/x14.ml
trunk/examples/perl/x14.pl
trunk/examples/python/xw14.py
trunk/examples/tcl/x14.tcl
Modified: trunk/examples/ada/x14a.adb.cmake
===================================================================
--- trunk/examples/ada/x14a.adb.cmake 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/ada/x14a.adb.cmake 2009-01-07 16:10:59 UTC (rev 9273)
@@ -69,6 +69,8 @@
mark0 : Integer_Array_1D(1 .. 1) := (Others => 0);
space1 : Integer_Array_1D(1 .. 1) := (Others => 1500);
mark1 : Integer_Array_1D(1 .. 1) := (Others => 1500);
+ fam : Boolean;
+ num, bmax : Integer;
procedure plot1 is
xmin, xmax, ymin, ymax : Long_Float;
@@ -295,6 +297,7 @@
plparseopts(PL_PARSE_FULL);
driver := To_Unbounded_String(plgdev);
+ plgfam(fam, num, bmax);
Put_Line("Demo of multiple output streams via the " & plgdev & " driver.");
Put_Line("Running with the second stream as slave to the first.");
@@ -313,6 +316,8 @@
-- Turn off pause to make this a slave (must follow master)
plsetopt("geometry", geometry_slave);
plspause(False);
+ plgfam(fam, num, bmax);
+ plsetopt("fflen","2");
plsdev(To_String(driver));
plinit;
Modified: trunk/examples/ada/xthick14a.adb.cmake
===================================================================
--- trunk/examples/ada/xthick14a.adb.cmake 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/ada/xthick14a.adb.cmake 2009-01-07 16:10:59 UTC (rev 9273)
@@ -2,8 +2,8 @@
-- Demo of multiple stream/window capability (requires Tk or Tcl-DP).
--- Maurice LeBrun
--- IFS, University of Texas at Austin
+-- Maurice LeBrun
+-- IFS, University of Texas at Austin
-- Copyright (C) 2008 Jerry Bauck
@@ -43,7 +43,7 @@
PLplot_Auxiliary,
PLplot;
--- COMMENT THIS LINE IF YOUR COMPILER DOES NOT INCLUDE THESE
+-- COMMENT THIS LINE IF YOUR COMPILER DOES NOT INCLUDE THESE
-- DEFINITIONS, FOR EXAMPLE, IF IT IS NOT ADA 2005 WITH ANNEX G.3 COMPLIANCE.
--with Ada.Numerics.Long_Real_Arrays; use Ada.Numerics.Long_Real_Arrays;
@Ada_Is_2007_With_and_Use_Numerics@
@@ -52,13 +52,13 @@
-- Plots several simple functions from other example programs.
--
-- This version sends the output of the first 4 plots (one page) to two
--- independent streams.
+-- independent streams.
------------------------------------------------------------------------------
procedure xthick14a is
- -- Select either TK or DP driver and use a small window
- -- Using DP results in a crash at the end due to some odd cleanup problems
- -- The geometry strings MUST be in writable memory
+ -- Select either TK or DP driver and use a small window
+ -- Using DP results in a crash at the end due to some odd cleanup problems
+ -- The geometry strings MUST be in writable memory
geometry_master : String := "500x410+100+200";
geometry_slave : String := "500x410+650+200";
driver : Unbounded_String;
@@ -69,6 +69,8 @@
mark0 : Integer_Array_1D(1 .. 1) := (Others => 0);
space1 : Integer_Array_1D(1 .. 1) := (Others => 1500);
mark1 : Integer_Array_1D(1 .. 1) := (Others => 1500);
+ fam : Boolean;
+ num, bmax : Integer;
procedure plot1 is
xmin, xmax, ymin, ymax : Long_Float;
@@ -89,26 +91,26 @@
ys(i) := y(i * 10 + 3);
end loop;
- -- Set up the viewport and window using PLENV. The range in X is
- -- 0.0 to 6.0, and the range in Y is 0.0 to 30.0. The axes are
- -- scaled separately (just := 0), and we just draw a labelled
- -- box (axis := 0).
+ -- Set up the viewport and window using PLENV. The range in X is
+ -- 0.0 to 6.0, and the range in Y is 0.0 to 30.0. The axes are
+ -- scaled separately (just := 0), and we just draw a labelled
+ -- box (axis := 0).
Set_Pen_Color(Red);
Set_Environment(xmin, xmax, ymin, ymax, Not_Justified, Linear_Box_Plus);
Set_Pen_Color(Wheat);
Write_Labels("(x)", "(y)", "#frPLplot Example 1 - y=x#u2");
- -- Plot the data points
+ -- Plot the data points
Set_Pen_Color(Blue);
Draw_Points(xs, ys, 9);
- -- Draw the line through the data
+ -- Draw the line through the data
Set_Pen_Color(Aquamarine);
Draw_Curve(x, y);
Flush_Output_Stream;
end plot1;
- -- ================================================================
+ -- ================================================================
procedure plot2 is
@@ -116,13 +118,13 @@
begin
-- Set up the viewport and window using PLENV. The range in X is -2.0 to
-- 10.0, and the range in Y is -0.4 to 2.0. The axes are scaled separately
- -- (just = 0), and we draw a box with axes (axis = 1).
+ -- (just = 0), and we draw a box with axes (axis = 1).
Set_Pen_Color(Red);
Set_Environment(-2.0, 10.0, -0.4, 1.2, Not_Justified, Linear_Zero_Axes);
Set_Pen_Color(Yellow);
Write_Labels("(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function");
- -- Fill up the arrays
+ -- Fill up the arrays
for i in x'range loop
x(i) := (Long_Float(i) - 19.0) / 6.0;
y(i) := 1.0;
@@ -131,33 +133,33 @@
end if;
end loop;
- -- Draw the line
+ -- Draw the line
Set_Pen_Color(Green);
Draw_Curve(x, y);
Flush_Output_Stream;
end plot2;
- -- ================================================================
+ -- ================================================================
procedure plot3 is
x, y : Real_Vector(0 .. 100);
begin
-- For the final graph we wish to override the default tick intervals, and
- -- so do not use PLENV
+ -- so do not use PLENV
Advance_To_Subpage(Next_Subpage);
-- Use standard viewport, and define X range from 0 to 360 degrees, Y range
- -- from -1.2 to 1.2.
+ -- from -1.2 to 1.2.
Set_Viewport_Standard;
Set_Viewport_World(0.0, 360.0, -1.2, 1.2);
- -- Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y.
+ -- Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y.
Set_Pen_Color(Red);
Box_Around_Viewport("bcnst", 60.0, 2, "bcnstv", 0.2, 2);
- -- Superimpose a dashed line grid, with 1.5 mm marks and spaces.
+ -- Superimpose a dashed line grid, with 1.5 mm marks and spaces.
Set_Line_Style(mark1, space1);
Set_Pen_Color(Yellow);
Box_Around_Viewport("g", 30.0, 0, "g", 0.2, 0);
@@ -176,7 +178,7 @@
Flush_Output_Stream;
end plot3;
- -- ================================================================
+ -- ================================================================
procedure plot4 is
@@ -189,7 +191,7 @@
y0(i) := sin(dtr * Long_Float(i));
end loop;
- -- Set up viewport and window, but do not draw box
+ -- Set up viewport and window, but do not draw box
Set_Environment(-1.3, 1.3, -1.3, 1.3, Justified, No_Box);
for i in 1 .. 10 loop
for j in x'range loop
@@ -197,7 +199,7 @@
y(j) := 0.1 * Long_Float(i) * y0(j);
end loop;
- -- Draw circles for polar grid
+ -- Draw circles for polar grid
Draw_Curve(x, y);
end loop;
@@ -207,11 +209,11 @@
dx := cos(dtr * theta);
dy := sin(dtr * theta);
- -- Draw radial spokes for polar grid
+ -- Draw radial spokes for polar grid
Draw_Line(0.0, 0.0, dx, dy);
- -- Write labels for angle
- -- Slightly off zero to avoid floating point logic flips at 90 and 270 deg.
+ -- Write labels for angle
+ -- Slightly off zero to avoid floating point logic flips at 90 and 270 deg.
if dx >= -0.00001 then
Write_Text_World(dx, dy, dx, dy, -0.15, Trim(Integer'image(Integer(theta)), Left));
else
@@ -219,7 +221,7 @@
end if;
end loop;
- -- Draw the graph
+ -- Draw the graph
for i in x'range loop
r := sin(dtr * Long_Float(5 * i));
x(i) := x0(i) * r;
@@ -233,10 +235,10 @@
Flush_Output_Stream;
end plot4;
- -- ================================================================
+ -- ================================================================
- -- Demonstration of contour plotting
+ -- Demonstration of contour plotting
procedure plot5 is
XPTS : constant Integer := 35;
YPTS : constant Integer := 46;
@@ -248,20 +250,20 @@
mark : Integer_Array_1D(1 .. 1) := (Others => 1500);
space : Integer_Array_1D(1 .. 1) := (Others => 1500);
z, w : Real_Matrix(0 .. XPTS -1, 0 .. YPTS - 1);
- clevel : Real_Vector(0 .. 10) :=
+ clevel : Real_Vector(0 .. 10) :=
(-1.0, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0);
procedure mypltr -- This spec is necessary to accommodate pragma Convention(C...).
- (x, y : Long_Float;
- tx, ty : out Long_Float;
+ (x, y : Long_Float;
+ tx, ty : out Long_Float;
pltr_data : PLpointer);
pragma Convention(Convention => C, Entity => mypltr);
procedure mypltr
- (x, y : Long_Float;
- tx, ty : out Long_Float;
+ (x, y : Long_Float;
+ tx, ty : out Long_Float;
pltr_data : PLpointer)
- is
+ is
begin
tx := tr(0) * x + tr(1) * y + tr(2);
ty := tr(3) * x + tr(4) * y + tr(5);
@@ -290,34 +292,37 @@
begin
- -- plplot initialization
- -- Parse and process command line arguments
+ -- plplot initialization
+ -- Parse and process command line arguments
Parse_Command_Line_Arguments(Parse_Full);
driver := To_Unbounded_String(Get_Device_Name);
+ Get_File_Family_Parameters(fam, num, bmax);
Put_Line("Demo of multiple output streams via the " & Get_Device_Name & " driver.");
Put_Line("Running with the second stream as slave to the first.");
New_Line;
- -- Set up first stream
+ -- Set up first stream
Set_Command_Line_Option("geometry", geometry_master);
Set_Device_Name(To_String(driver));
Set_Number_Of_Subpages(2, 2);
Initialize_PLplot;
- -- Start next stream
+ -- Start next stream
Set_Stream_Number(1);
- -- Turn off pause to make this a slave (must follow master)
+ -- Turn off pause to make this a slave (must follow master)
Set_Command_Line_Option("geometry", geometry_slave);
Set_Pause(False);
Set_Device_Name(To_String(driver));
+ Get_File_Family_Parameters(fam, num, bmax);
+ Set_Command_Line_Option("fflen","2");
Initialize_PLplot;
- -- Set up the data & plot
- -- Original case
+ -- Set up the data & plot
+ -- Original case
Set_Stream_Number(0);
xscale := 6.0;
@@ -326,19 +331,19 @@
yoff := 0.0;
plot1;
- -- Set up the data & plot
+ -- Set up the data & plot
xscale := 1.0;
yscale := 1.0e+6;
plot1;
- -- Set up the data & plot
+ -- Set up the data & plot
xscale := 1.0;
yscale := 1.0e-6;
digmax := 2;
Set_Floating_Point_Display_Y(digmax, 0);
plot1;
- -- Set up the data & plot
+ -- Set up the data & plot
xscale := 1.0;
yscale := 0.0014;
yoff := 0.0185;
@@ -346,26 +351,26 @@
Set_Floating_Point_Display_Y(digmax, 0);
plot1;
- -- To slave
- -- The Eject_Current_Page ensures the eop indicator gets lit.
+ -- To slave
+ -- The Eject_Current_Page ensures the eop indicator gets lit.
Set_Stream_Number(1);
plot4;
Eject_Current_Page;
- -- Back to master
+ -- Back to master
Set_Stream_Number(0);
plot2;
plot3;
- -- To slave
+ -- To slave
Set_Stream_Number(1);
plot5;
Eject_Current_Page;
- -- Back to master to wait for user to advance
+ -- Back to master to wait for user to advance
Set_Stream_Number(0);
Eject_Current_Page;
- -- Call End_PLplot to finish off.
+ -- Call End_PLplot to finish off.
End_PLplot;
end xthick14a;
Modified: trunk/examples/c/x14c.c
===================================================================
--- trunk/examples/c/x14c.c 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/c/x14c.c 2009-01-07 16:10:59 UTC (rev 9273)
@@ -92,6 +92,9 @@
plspause(0);
plsdev(driver);
plsfam(fam,num,bmax);
+ /* Currently number of digits in format number can only be
+ * set via the command line option */
+ plsetopt("fflen","2");
plinit();
/* Set up the data & plot */
Modified: trunk/examples/c++/x14.cc
===================================================================
--- trunk/examples/c++/x14.cc 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/c++/x14.cc 2009-01-07 16:10:59 UTC (rev 9273)
@@ -93,6 +93,9 @@
// The geometry strings MUST be in writable memory
char driver[80];
+
+ PLINT fam, num, bmax;
+
const char geometry_master[] = "500x410+100+200";
const char geometry_slave[] = "500x410+650+200";
@@ -104,6 +107,7 @@
pls1->parseopts( &argc, argv, PL_PARSE_FULL );
pls1->gdev(driver);
+ pls1->gfam(fam,num,bmax);
cout << "Demo of multiple output streams via the " <<
driver << " driver." << endl;
@@ -125,6 +129,10 @@
pls2->SetOpt("geometry", geometry_slave);
pls2->spause(false);
pls2->sdev(driver);
+ pls2->sfam(fam,num,bmax);
+ // Currently number of digits in format number can only be
+ // set via the command line option
+ pls2->SetOpt("fflen","2");
pls2->init();
// Set up the data & plot
Modified: trunk/examples/f77/x14f.fm4
===================================================================
--- trunk/examples/f77/x14f.fm4 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/f77/x14f.fm4 2009-01-07 16:10:59 UTC (rev 9273)
@@ -35,6 +35,8 @@
character*15 geometry_master
character*15 geometry_slave
+ integer fam, num, bmax
+
real*8 x(101), y(101)
real*8 xs(6), ys(6)
real*8 xscale, yscale, xoff, yoff
@@ -61,6 +63,7 @@
call plparseopts(PL_PARSE_FULL)
call plgdev(driver)
+ call plgfam(fam,num,bmax)
write(*,'(3A)') 'Demo of multiple output streams via the ',
& driver(:lnblnk(driver)), ' driver.'
@@ -85,6 +88,8 @@
call plsetopt( 'geometry', geometry_slave)
call plspause(0)
call plsdev(driver)
+ call plsfam(fam,num,bmax)
+ call plsetopt('fflen','2')
call plinit()
C Set up the data & plot
Modified: trunk/examples/f95/x14f.f90
===================================================================
--- trunk/examples/f95/x14f.f90 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/f95/x14f.f90 2009-01-07 16:10:59 UTC (rev 9273)
@@ -36,6 +36,8 @@
character*15 geometry_master
character*15 geometry_slave
+ integer fam, num, bmax
+
real(kind=plflt) x(101), y(101)
real(kind=plflt) xs(6), ys(6)
real(kind=plflt) xscale, yscale, xoff, yoff
@@ -58,6 +60,7 @@
call plparseopts(PL_PARSE_FULL)
call plgdev(driver)
+ call plgfam(fam,num,bmax)
write(*,'(3A)') 'Demo of multiple output streams via the ', &
trim(driver), ' driver.'
@@ -82,6 +85,8 @@
call plsetopt( 'geometry', geometry_slave)
call plspause(.false.)
call plsdev(driver)
+ call plsfam(fam,num,bmax)
+ call plsetopt('fflen','2')
call plinit()
! Set up the data & plot
Modified: trunk/examples/java/x14.java
===================================================================
--- trunk/examples/java/x14.java 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/java/x14.java 2009-01-07 16:10:59 UTC (rev 9273)
@@ -51,6 +51,10 @@
String geometry_master = "500x410+100+200";
String geometry_slave = "500x410+650+200";
+ int fam[] = new int[1];
+ int num[] = new int[1];
+ int bmax[] = new int[1];
+
// Parse and process command line arguments.
pls1.parseopts( args, PLStream.PL_PARSE_FULL|PLStream.PL_PARSE_NOPROGRAM );
@@ -58,6 +62,7 @@
StringBuffer driver = new StringBuffer(80);
pls1.gdev(driver);
+ pls1.gfam(fam,num,bmax);
String sdriver = new String(driver);
System.out.println("Demo of multiple output streams via the " + sdriver + " driver.");
System.out.println("Running with the second stream as slave to the first.");
@@ -78,6 +83,8 @@
pls2.setopt("geometry", geometry_slave);
pls2.spause(false);
pls2.sdev(sdriver);
+ pls2.sfam(fam[0],num[0],bmax[0]);
+ pls2.setopt("fflen","2");
pls2.init();
//Set up the data & plot
Modified: trunk/examples/ocaml/x14.ml
===================================================================
--- trunk/examples/ocaml/x14.ml 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/ocaml/x14.ml 2009-01-07 16:10:59 UTC (rev 9273)
@@ -228,6 +228,7 @@
ignore (plparseopts Sys.argv [PL_PARSE_FULL]);
let driver = plgdev () in
+ let fam, num, bmax = plgfam () in
printf "Demo of multiple output streams via the %s driver.\n" driver;
printf "Running with the second stream as slave to the first.\n";
@@ -247,6 +248,8 @@
plsetopt "geometry" geometry_slave;
plspause false;
plsdev driver;
+ plsfam fam num bmax;
+ plsetopt "fflen" "2";
plinit ();
(* Set up the data & plot *)
Modified: trunk/examples/perl/x14.pl
===================================================================
--- trunk/examples/perl/x14.pl 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/perl/x14.pl 2009-01-07 16:10:59 UTC (rev 9273)
@@ -57,6 +57,7 @@
plParseOpts (\@ARGV, PL_PARSE_SKIP | PL_PARSE_NOPROGRAM);
my $driver = plgdev ();
+ my ($fam, $num, $bmax) = plgfam ();
print ("Demo of multiple output streams via the $driver driver.\n"
. "Running with the second stream as slave to the first.\n"
@@ -79,6 +80,8 @@
plsetopt ("geometry", $geometry_slave);
plspause (0);
plsdev ($driver);
+ plsfam ($fam, $num, $bmax);
+ plsetopt ("fflen","2");
plinit ();
# Set up the data & plot
Modified: trunk/examples/python/xw14.py
===================================================================
--- trunk/examples/python/xw14.py 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/python/xw14.py 2009-01-07 16:10:59 UTC (rev 9273)
@@ -42,6 +42,8 @@
geometry_master = "500x410+100+200"
geometry_slave = "500x410+650+200"
driver = plgdev()
+ (fam, num, bmax) = plgfam()
+
print "Demo of multiple output streams via the %s driver." % driver
print "Running with the second stream as slave to the first."
print ""
@@ -60,6 +62,8 @@
plsetopt("geometry", geometry_slave)
plspause(0)
plsdev(driver)
+ plsfam(fam, num, bmax)
+ plsetopt("fflen","2")
plinit()
# Set up the data & plot
Modified: trunk/examples/tcl/x14.tcl
===================================================================
--- trunk/examples/tcl/x14.tcl 2009-01-07 15:14:56 UTC (rev 9272)
+++ trunk/examples/tcl/x14.tcl 2009-01-07 16:10:59 UTC (rev 9273)
@@ -8,6 +8,7 @@
set geometry_slave "500x410+650+200"
$w cmd plgdev driver
+ $w cmd plgfam fam num bmax
puts "Demo of multiple output streams via the $driver driver."
puts "Running with the second stream as slave to the first."
puts ""
@@ -27,7 +28,11 @@
$w cmd plsetopt "geometry" $geometry_slave
$w cmd plspause 0
- if {$driver != ""} {$w cmd plsdev $driver}
+ if {$driver != ""} {
+ $w cmd plsdev $driver
+ }
+ $w cmd plsfam $fam $num $bmax
+ $w cmd plsetopt "fflen" "2"
$w cmd plinit
# Set up the data & plot
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2009-01-11 13:22:13
|
Revision: 9294
http://plplot.svn.sourceforge.net/plplot/?rev=9294&view=rev
Author: andrewross
Date: 2009-01-11 12:06:27 +0000 (Sun, 11 Jan 2009)
Log Message:
-----------
Update tcl / tk demo scripts to include example 31.
Modified Paths:
--------------
trunk/examples/tcl/tcldemos.tcl
trunk/examples/tk/tkdemos.tcl
Modified: trunk/examples/tcl/tcldemos.tcl
===================================================================
--- trunk/examples/tcl/tcldemos.tcl 2009-01-11 05:18:38 UTC (rev 9293)
+++ trunk/examples/tcl/tcldemos.tcl 2009-01-11 12:06:27 UTC (rev 9294)
@@ -20,7 +20,7 @@
# Tcl scripts compatible.
#----------------------------------------------------------------------------
-for {set i 1} {$i <= 30} {incr i} {
+for {set i 1} {$i <= 31} {incr i} {
set demo x[format "%02d" $i]
source $demo.tcl
# restore defaults
Modified: trunk/examples/tk/tkdemos.tcl
===================================================================
--- trunk/examples/tk/tkdemos.tcl 2009-01-11 05:18:38 UTC (rev 9293)
+++ trunk/examples/tk/tkdemos.tcl 2009-01-11 12:06:27 UTC (rev 9294)
@@ -21,7 +21,7 @@
plxframe .plw
pack append . .plw {left expand fill}
-for {set i 1} {$i <= 30} {incr i} {
+for {set i 1} {$i <= 31} {incr i} {
set demo x[format "%02d" $i]
source $demo.tcl
proc $i {} "$demo .plw.plwin"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-01-14 18:15:10
|
Revision: 9308
http://plplot.svn.sourceforge.net/plplot/?rev=9308&view=rev
Author: airwin
Date: 2009-01-14 18:15:07 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
Add pstex to the install-tree tests.
Modified Paths:
--------------
trunk/examples/CMakeLists.txt
trunk/examples/Makefile.examples.in
Modified: trunk/examples/CMakeLists.txt
===================================================================
--- trunk/examples/CMakeLists.txt 2009-01-14 17:52:32 UTC (rev 9307)
+++ trunk/examples/CMakeLists.txt 2009-01-14 18:15:07 UTC (rev 9308)
@@ -152,6 +152,12 @@
set(XFIG_COMMENT "#")
endif(PLD_xfig)
+if(PLD_pstex)
+ set(PSTEX x01c.pstex)
+else(PLD_pstex)
+ set(PSTEX_COMMENT "#")
+endif(PLD_pstex)
+
if(DIFF_EXECUTABLE AND TAIL_EXECUTABLE)
set(COMPARE compare)
else(DIFF_EXECUTABLE AND TAIL_EXECUTABLE)
Modified: trunk/examples/Makefile.examples.in
===================================================================
--- trunk/examples/Makefile.examples.in 2009-01-14 17:52:32 UTC (rev 9307)
+++ trunk/examples/Makefile.examples.in 2009-01-14 18:15:07 UTC (rev 9308)
@@ -41,7 +41,7 @@
done
test: @PSC_ALL@ @PDFCAIRO@ @PNGCAIRO@ @PSCAIRO@ @SVGCAIRO@ \
- @GIF@ @JPEG@ @PNG@ @PSTTFC@ @SVG@ @XFIG@ @COMPARE@
+ @GIF@ @JPEG@ @PNG@ @PSTTFC@ @SVG@ @XFIG@ @PSTEX@ @COMPARE@
@PSC_ALL_COMMENT@@PSC_ALL@: c/x01c@EXEEXT@
@PSC_ALL_COMMENT@ echo psc all front-ends
@@ -87,8 +87,11 @@
@XFIG_COMMENT@ echo xfig
@XFIG_COMMENT@ ./plplot-test.sh --front-end=c --device=xfig
-@COMPARE_COMMENT@@COMPARE@: @PSC_ALL@ @PDFCAIRO@ @PNGCAIRO@ @PSCAIRO@ @SVGCAIRO@ \
- @GIF@ @JPEG@ @PNG@ @PSTTFC@ @SVG@ @XFIG@
+@PSTEX_COMMENT@@PSTEX@: c/x01c@EXEEXT@
+@PSTEX_COMMENT@ echo pstex
+@PSTEX_COMMENT@ ./plplot-test.sh --front-end=c --device=pstex
+
+@COMPARE_COMMENT@@COMPARE@: @PSC_ALL@
@COMPARE_COMMENT@ echo compare
@COMPARE_COMMENT@ ./test_diff.sh
@@ -106,6 +109,6 @@
test_clean:
rm -f *.psc *.pdfcairo *.pngcairo *.pscairo *.svgcairo \
- *.gif *.jpeg *.png *.psttfc *.svg *.xfig *.txt test.error
+ *.gif *.jpeg *.png *.psttfc *.svg *.xfig *.pstex* *.txt test.error
.PHONY : all clean test test_clean test_interactive @COMPARE@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-01-15 23:23:25
|
Revision: 9319
http://plplot.svn.sourceforge.net/plplot/?rev=9319&view=rev
Author: airwin
Date: 2009-01-15 23:23:20 +0000 (Thu, 15 Jan 2009)
Log Message:
-----------
flush fortran stdout so that it is guaranteed to finish before C stdout.
(According to Fortran documentation accessible to me, "call flush(iunit)"
is available for the g77, gfortran, intel, absoft, and Portland Group
fortran compilers.)
Modified Paths:
--------------
trunk/examples/f77/x14f.fm4
trunk/examples/f95/x14f.f90
Modified: trunk/examples/f77/x14f.fm4
===================================================================
--- trunk/examples/f77/x14f.fm4 2009-01-15 20:50:18 UTC (rev 9318)
+++ trunk/examples/f77/x14f.fm4 2009-01-15 23:23:20 UTC (rev 9319)
@@ -65,11 +65,14 @@
call plgdev(driver)
call plgfam(fam,num,bmax)
- write(*,'(3A)') 'Demo of multiple output streams via the ',
+ write(6,'(3A)') 'Demo of multiple output streams via the ',
& driver(:lnblnk(driver)), ' driver.'
- write(*,'(A)') 'Running with the second stream as slave '//
+ write(6,'(A)') 'Running with the second stream as slave '//
& 'to the first.'
- write(*,*)
+ write(6,*)
+C flush unit 6 so this part of stdout is guaranteed to be written prior
+C to stdout generated by second plinit below.
+ call flush(6)
C Set up first stream
Modified: trunk/examples/f95/x14f.f90
===================================================================
--- trunk/examples/f95/x14f.f90 2009-01-15 20:50:18 UTC (rev 9318)
+++ trunk/examples/f95/x14f.f90 2009-01-15 23:23:20 UTC (rev 9319)
@@ -62,11 +62,14 @@
call plgdev(driver)
call plgfam(fam,num,bmax)
- write(*,'(3A)') 'Demo of multiple output streams via the ', &
+ write(6,'(3A)') 'Demo of multiple output streams via the ', &
trim(driver), ' driver.'
- write(*,'(A)') 'Running with the second stream as slave '// &
+ write(6,'(A)') 'Running with the second stream as slave '// &
'to the first.'
- write(*,*)
+ write(6,*)
+! flush unit 6 so this part of stdout is guaranteed to be written prior
+! to stdout generated by second plinit below.
+ call flush(6)
! Set up first stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sm...@us...> - 2009-01-19 09:22:30
|
Revision: 9343
http://plplot.svn.sourceforge.net/plplot/?rev=9343&view=rev
Author: smekal
Date: 2009-01-19 09:22:19 +0000 (Mon, 19 Jan 2009)
Log Message:
-----------
Added some Lua examples, some of them work, others are not finished porting at all
Added Paths:
-----------
trunk/examples/lua/
trunk/examples/lua/x01.lua
trunk/examples/lua/x05.lua
trunk/examples/lua/x09.lua
trunk/examples/lua/x10.lua
trunk/examples/lua/x11.lua
trunk/examples/lua/x12.lua
trunk/examples/lua/x13.lua
trunk/examples/lua/x19.lua
trunk/examples/lua/x24.lua
trunk/examples/lua/x25.lua
trunk/examples/lua/x30.lua
Added: trunk/examples/lua/x01.lua
===================================================================
--- trunk/examples/lua/x01.lua (rev 0)
+++ trunk/examples/lua/x01.lua 2009-01-19 09:22:19 UTC (rev 9343)
@@ -0,0 +1,349 @@
+--[[ $Id: $
+
+ Simple line plot and multiple windows demo.
+
+ Copyright (C) 2004 Rafael Laboissiere
+
+ This file is part of PLplot.
+
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings to PLplot
+if string.sub(_VERSION,1,7)=='Lua 5.0' then
+ lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
+ assert(lib)()
+else
+ require('plplotluac')
+end
+
+-- Variables and data arrays used by plot generators
+
+x = {}
+y = {}
+xs = {}
+ys = {}
+--PLGraphicsIn gin
+
+fontset = 1
+-- Options data structure definition.
+
+static PLOptionTable options[] = {
+{
+ "locate", -- Turns on test of API locate function
+ NULL,
+ NULL,
+ &locate_mode,
+ PL_OPT_BOOL,
+ "-locate",
+ "Turns on test of API locate function" },
+{
+ "xor", -- Turns on test of xor function
+ NULL,
+ NULL,
+ &test_xor,
+ PL_OPT_BOOL,
+ "-xor",
+ "Turns on test of XOR" },
+{
+ "font", -- For switching between font set 1 & 2
+ NULL,
+ NULL,
+ &fontset,
+ PL_OPT_INT,
+ "-font number",
+ "Selects stroke font set (0 or 1, def:1)" },
+{
+ "save", -- For saving in postscript
+ NULL,
+ NULL,
+ &f_name,
+ PL_OPT_STRING,
+ "-save filename",
+ "Save plot in color postscript `file'" },
+{
+ NULL, -- option
+ NULL, -- handler
+ NULL, -- client data
+ NULL, -- address of variable to set
+ 0, -- mode flag
+ NULL, -- short syntax
+ NULL } -- long syntax
+}
+
+const char *notes[] = {"Make sure you get it right!", NULL}
+
+-- Function prototypes
+
+void plot1(int)
+void plot2(void)
+void plot3(void)
+
+----------------------------------------------------------------------------
+-- main
+--
+-- Generates several simple line plots. Demonstrates:
+-- - subwindow capability
+-- - setting up the window, drawing plot, and labelling
+-- - changing the color
+-- - automatic axis rescaling to exponential notation
+-- - placing the axes in the middle of the box
+-- - gridded coordinate axes
+----------------------------------------------------------------------------
+
+-- plplot initialization
+
+-- Parse and process command line arguments
+
+-- plMergeOpts(options, "x01c options", notes)
+-- plparseopts(&argc, argv, PL_PARSE_FULL)
+
+-- Get version number, just for kicks
+
+pl.plgver(ver)
+print("PLplot library version: " .. ver)
+
+-- Initialize plplot
+-- Divide page into 2x2 plots
+-- Note: calling plstar replaces separate calls to plssub and plinit
+pl.plstar(2,2)
+
+-- Select font set as per input flag
+
+if fontset != 0 then
+ pl.plfontld(1)
+else
+ pl.plfontld(0)
+end
+
+-- Set up the data
+-- Original case
+
+ xscale = 6.
+ yscale = 1.
+ xoff = 0.
+ yoff = 0.
+
+-- Do a plot
+
+ plot1(0)
+
+-- Set up the data
+
+ xscale = 1.
+ yscale = 0.0014
+ yoff = 0.0185
+
+-- Do a plot
+
+ digmax = 5
+ plsyax(digmax, 0)
+
+ plot1(1)
+
+ plot2()
+
+ plot3()
+
+ --
+ * Show how to save a plot:
+ * Open a new device, make it current, copy parameters,
+ * and replay the plot buffer
+
+
+ if (f_name) { -- command line option '-save filename'
+
+ printf("The current plot was saved in color Postscript under the name `%s'.\n", f_name)
+ plgstrm(&cur_strm) -- get current stream
+ plmkstrm(&new_strm) -- create a new one
+
+ plsfnam(f_name) -- file name
+ plsdev("psc") -- device type
+
+ plcpstrm(cur_strm, 0) -- copy old stream parameters to new stream
+ plreplot() -- do the save by replaying the plot buffer
+ plend1() -- finish the device
+
+ plsstrm(cur_strm) -- return to previous stream
+ }
+
+-- Let's get some user input
+
+ if (locate_mode) {
+ for () {
+ if (! plGetCursor(&gin)) break
+ if (gin.keysym == PLK_Escape) break
+
+ pltext()
+ if (gin.keysym < 0xFF && isprint(gin.keysym))
+ printf("subwin = %d, wx = %f, wy = %f, dx = %f, dy = %f, c = '%c'\n",
+ gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym)
+ else
+ printf("subwin = %d, wx = %f, wy = %f, dx = %f, dy = %f, c = 0x%02x\n",
+ gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym)
+
+ plgra()
+ }
+ }
+
+ plclear()
+-- Don't forget to call plend() to finish off!
+
+ plend()
+ exit(0)
+}
+
+ -- ===============================================================
+
+void
+plot1(int do_test)
+{
+ int i
+ PLFLT xmin, xmax, ymin, ymax
+
+ for (i = 0 i < 60 i++) {
+ x[i] = xoff + xscale * (i + 1) / 60.0
+ y[i] = yoff + yscale * pow(x[i], 2.)
+ }
+
+ xmin = x[0]
+ xmax = x[59]
+ ymin = y[0]
+ ymax = y[59]
+
+ for (i = 0 i < 6 i++) {
+ xs[i] = x[i * 10 + 3]
+ ys[i] = y[i * 10 + 3]
+ }
+
+-- Set up the viewport and window using PLENV. The range in X is
+ * 0.0 to 6.0, and the range in Y is 0.0 to 30.0. The axes are
+ * scaled separately (just = 0), and we just draw a labelled
+ * box (axis = 0).
+
+ plcol0(1)
+ plenv(xmin, xmax, ymin, ymax, 0, 0)
+ plcol0(2)
+ pllab("(x)", "(y)", "#frPLplot Example 1 - y=x#u2")
+
+-- Plot the data points
+
+ plcol0(4)
+ plpoin(6, xs, ys, 9)
+
+-- Draw the line through the data
+
+ plcol0(3)
+ plline(60, x, y)
+
+-- xor mode enable erasing a line/point/text by replotting it again
+-- it does not work in double buffering mode, however
+
+ if (do_test && test_xor) {
+#ifdef PL_HAVE_USLEEP
+ PLINT st
+ plxormod(1, &st) -- enter xor mode
+ if (st) {
+ for (i=0 i<60 i++) {
+ plpoin(1, x+i, y+i,9) -- draw a point
+ usleep(50000) -- wait a little
+ plflush() -- force an update of the tk driver
+ plpoin(1, x+i, y+i,9) -- erase point
+ }
+ plxormod(0, &st) -- leave xor mode
+ }
+#else
+ printf("The -xor command line option can only be exercised if your "
+ "system\nhas usleep(), which does not seem to happen.\n")
+#endif
+ }
+}
+
+ -- ===============================================================
+
+void
+plot2(void)
+{
+ int i
+
+-- Set up the viewport and window using PLENV. The range in X is -2.0 to
+ * 10.0, and the range in Y is -0.4 to 2.0. The axes are scaled separately
+ * (just = 0), and we draw a box with axes (axis = 1).
+
+ plcol0(1)
+ plenv(-2.0, 10.0, -0.4, 1.2, 0, 1)
+ plcol0(2)
+ pllab("(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function")
+
+-- Fill up the arrays
+
+ for (i = 0 i < 100 i++) {
+ x[i] = (i - 19.0) / 6.0
+ y[i] = 1.0
+ if (x[i] != 0.0)
+ y[i] = sin(x[i]) / x[i]
+ }
+
+-- Draw the line
+
+ plcol0(3)
+ plwid(2)
+ plline(100, x, y)
+ plwid(1)
+}
+
+ -- ===============================================================
+
+void
+plot3(void)
+{
+ PLINT space0 = 0, mark0 = 0, space1 = 1500, mark1 = 1500
+ int i
+
+-- For the final graph we wish to override the default tick intervals, and
+ * so do not use plenv().
+
+ pladv(0)
+
+-- Use standard viewport, and define X range from 0 to 360 degrees, Y range
+ * from -1.2 to 1.2.
+
+ plvsta()
+ plwind(0.0, 360.0, -1.2, 1.2)
+
+-- Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y.
+
+ plcol0(1)
+ plbox("bcnst", 60.0, 2, "bcnstv", 0.2, 2)
+
+-- Superimpose a dashed line grid, with 1.5 mm marks and spaces.
+ * plstyl expects a pointer!
+
+ plstyl(1, &mark1, &space1)
+ plcol0(2)
+ plbox("g", 30.0, 0, "g", 0.2, 0)
+ plstyl(0, &mark0, &space0)
+
+ plcol0(3)
+ pllab("Angle (degrees)", "sine", "#frPLplot Example 1 - Sine function")
+
+ for (i = 0 i < 101 i++) {
+ x[i] = 3.6 * i
+ y[i] = sin(x[i] * M_PI / 180.0)
+ }
+
+ plcol0(4)
+ plline(101, x, y)
+}
Property changes on: trunk/examples/lua/x01.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/examples/lua/x05.lua
===================================================================
--- trunk/examples/lua/x05.lua (rev 0)
+++ trunk/examples/lua/x05.lua 2009-01-19 09:22:19 UTC (rev 9343)
@@ -0,0 +1,41 @@
+-- $Id: $
+
+-- Histogram demo.
+
+-- initialise Lua bindings to PLplot
+if string.sub(_VERSION,1,7)=='Lua 5.0' then
+ lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
+ assert(lib)()
+else
+ require('plplotluac')
+end
+pl=plplotluac
+
+--------------------------------------------------------------------------
+-- main
+--
+-- Draws a histogram from sample data.
+--------------------------------------------------------------------------
+
+NPTS=2047
+data = {}
+
+-- Parse and process command line arguments
+-- (void) plparseopts(&argc, argv, PL_PARSE_FULL);
+
+-- Initialize plplot
+pl.plinit()
+
+-- Fill up data points
+delta = 2.0*math.pi/NPTS
+for i=1, NPTS do
+ data[i] = math.sin((i-1)*delta)
+end
+
+pl.plcol0(1)
+pl.plhist(data, -1.1, 1.1, 44, 0)
+pl.plcol0(2)
+pl.pllab("#frValue", "#frFrequency",
+ "#frPLplot Example 5 - Probability function of Oscillator")
+
+pl.plend()
Property changes on: trunk/examples/lua/x05.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/examples/lua/x09.lua
===================================================================
--- trunk/examples/lua/x09.lua (rev 0)
+++ trunk/examples/lua/x09.lua 2009-01-19 09:22:19 UTC (rev 9343)
@@ -0,0 +1,451 @@
+/* $Id: x09c.c 9117 2008-12-15 12:45:13Z andrewross $
+
+ Contour plot demo.
+
+ This file is part of PLplot.
+
+ PLplot is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+-- initialise Lua bindings to PLplot
+if string.sub(_VERSION,1,7)=='Lua 5.0' then
+ lib=loadlib('plplotluac.dll','luaopen_plplotluac') or loadlib('plplotluac.so','luaopen_plplotluac')
+ assert(lib)()
+else
+ require('example')
+end
+pl=plplotluac
+
+#define XPTS 35 /* Data points in x */
+#define YPTS 46 /* Data points in y */
+
+#define XSPA 2./(XPTS-1)
+#define YSPA 2./(YPTS-1)
+
+/* polar plot data */
+#define PERIMETERPTS 100
+#define RPTS 40
+#define THETAPTS 40
+
+/* potential plot data */
+#define PPERIMETERPTS 100
+#define PRPTS 40
+#define PTHETAPTS 64
+#define PNLEVEL 20
+
+static PLFLT clevel[11] =
+{-1., -.8, -.6, -.4, -.2, 0, .2, .4, .6, .8, 1.};
+
+/* Transformation function */
+
+PLFLT tr[6] =
+{XSPA, 0.0, -1.0, 0.0, YSPA, -1.0};
+
+static void
+mypltr(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data)
+{
+ *tx = tr[0] * x + tr[1] * y + tr[2];
+ *ty = tr[3] * x + tr[4] * y + tr[5];
+}
+
+static void polar()
+/*polar contour plot example.*/
+{
+ int i,j;
+ PLcGrid2 cgrid2;
+ PLFLT **z;
+ PLFLT px[PERIMETERPTS], py[PERIMETERPTS];
+ PLFLT t, r, theta;
+ PLFLT lev[10];
+
+ plenv(-1., 1., -1., 1., 0, -2);
+ plcol0(1);
+
+/*Perimeter*/
+ for (i = 0; i < PERIMETERPTS; i++) {
+ t = (2.*M_PI/(PERIMETERPTS-1))*(double)i;
+ px[i] = cos(t);
+ py[i] = sin(t);
+ }
+ plline(PERIMETERPTS, px, py);
+
+/*create data to be contoured.*/
+ plAlloc2dGrid(&cgrid2.xg, RPTS, THETAPTS);
+ plAlloc2dGrid(&cgrid2.yg, RPTS, THETAPTS);
+ plAlloc2dGrid(&z, RPTS, THETAPTS);
+ cgrid2.nx = RPTS;
+ cgrid2.ny = THETAPTS;
+
+ for (i = 0; i < RPTS; i++) {
+ r = i/(double)(RPTS-1);
+ for (j = 0; j < THETAPTS; j++) {
+ theta = (2.*M_PI/(double)(THETAPTS-1))*(double)j;
+ cgrid2.xg[i][j] = r*cos(theta);
+ cgrid2.yg[i][j] = r*sin(theta);
+ z[i][j] = r;
+ }
+ }
+
+ for (i = 0; i < 10; i++) {
+ lev[i] = 0.05 + 0.10*(double) i;
+ }
+
+ plcol0(2);
+ plcont(z, RPTS, THETAPTS, 1, RPTS, 1, THETAPTS, lev, 10,
+ pltr2, (void *) &cgrid2);
+ plcol0(1);
+ pllab("", "", "Polar Contour Plot");
+ plFree2dGrid(z, RPTS, THETAPTS);
+ plFree2dGrid(cgrid2.xg, RPTS, THETAPTS);
+ plFree2dGrid(cgrid2.yg, RPTS, THETAPTS);
+}
+
+/*--------------------------------------------------------------------------*\
+ * f2mnmx
+ *
+ * Returns min & max of input 2d array.
+\*--------------------------------------------------------------------------*/
+
+static void
+f2mnmx(PLFLT **f, PLINT nx, PLINT ny, PLFLT *fmin, PLFLT *fmax)
+{
+ int i, j;
+
+ *fmax = f[0][0];
+ *fmin = *fmax;
+
+ for (i = 0; i < nx; i++) {
+ for (j = 0; j < ny; j++) {
+ *fmax = MAX(*fmax, f[i][j]);
+ *fmin = MIN(*fmin, f[i][j]);
+ }
+ }
+}
+
+static void potential()
+/*shielded potential contour plot example.*/
+{
+ int i,j;
+ PLcGrid2 cgrid2;
+ PLFLT rmax, xmin, xmax, x0, ymin, ymax, y0, zmin, zmax;
+ PLFLT peps, xpmin, xpmax, ypmin, ypmax;
+ PLFLT eps, q1, d1, q1i, d1i, q2, d2, q2i, d2i;
+ PLFLT div1, div1i, div2, div2i;
+ PLFLT **z;
+ PLINT nlevelneg, nlevelpos;
+ PLFLT dz, clevel, clevelneg[PNLEVEL], clevelpos[PNLEVEL];
+ PLINT ncollin, ncolbox, ncollab;
+ PLFLT px[PPERIMETERPTS], py[PPERIMETERPTS];
+ PLFLT t, r, theta;
+
+/*create data to be contoured.*/
+ plAlloc2dGrid(&cgrid2.xg, PRPTS, PTHETAPTS);
+ plAlloc2dGrid(&cgrid2.yg, PRPTS, PTHETAPTS);
+ plAlloc2dGrid(&z, PRPTS, PTHETAPTS);
+ cgrid2.nx = PRPTS;
+ cgrid2.ny = PTHETAPTS;
+
+ for (i = 0; i < PRPTS; i++) {
+ r = 0.5 + (double) i;
+ for (j = 0; j < PTHETAPTS; j++) {
+ theta = (2.*M_PI/(double)(PTHETAPTS-1))*(0.5 + (double) j);
+ cgrid2.xg[i][j] = r*cos(theta);
+ cgrid2.yg[i][j] = r*sin(theta);
+ }
+ }
+
+ rmax = r;
+ f2mnmx(cgrid2.xg, PRPTS, PTHETAPTS, &xmin, &xmax);
+ f2mnmx(cgrid2.yg, PRPTS, PTHETAPTS, &ymin, &ymax);
+ x0 = (xmin + xmax)/2.;
+ y0 = (ymin + ymax)/2.;
+
+ /* Expanded limits */
+ peps = 0.05;
+ xpmin = xmin - fabs(xmin)*peps;
+ xpmax = xmax + fabs(xmax)*peps;
+ ypmin = ymin - fabs(ymin)*peps;
+ ypmax = ymax + fabs(ymax)*peps;
+
+ /* Potential inside a conducting cylinder (or sphere) by method of images.
+ Charge 1 is placed at (d1, d1), with image charge at (d2, d2).
+ Charge 2 is placed at (d1, -d1), with image charge at (d2, -d2).
+ Also put in smoothing term at small distances.
+ */
+
+ eps = 2.;
+
+ q1 = 1.;
+ d1 = rmax/4.;
+
+ q1i = - q1*rmax/d1;
+ d1i = pow(rmax, 2.)/d1;
+
+ q2 = -1.;
+ d2 = rmax/4.;
+
+ q2i = - q2*rmax/d2;
+ d2i = pow(rmax, 2.)/d2;
+
+ for (i = 0; i < PRPTS; i++) {
+ for (j = 0; j < PTHETAPTS; j++) {
+ div1 = sqrt(pow(cgrid2.xg[i][j]-d1, 2.) + pow(cgrid2.yg[i][j]-d1, 2.) + pow(eps, 2.));
+ div1i = sqrt(pow(cgrid2.xg[i][j]-d1i, 2.) + pow(cgrid2.yg[i][j]-d1i, 2.) + pow(eps, 2.));
+ div2 = sqrt(pow(cgrid2.xg[i][j]-d2, 2.) + pow(cgrid2.yg[i][j]+d2, 2.) + pow(eps, 2.));
+ div2i = sqrt(pow(cgrid2.xg[i][j]-d2i, 2.) + pow(cgrid2.yg[i][j]+d2i, 2.) + pow(eps, 2.));
+ z[i][j] = q1/div1 + q1i/div1i + q2/div2 + q2i/div2i;
+ }
+ }
+ f2mnmx(z, PRPTS, PTHETAPTS, &zmin, &zmax);
+/* printf("%.15g %.15g %.15g %.15g %.15g %.15g %.15g %.15g \n",
+ q1, d1, q1i, d1i, q2, d2, q2i, d2i);
+ printf("%.15g %.15g %.15g %.15g %.15g %.15g \n",
+ xmin, xmax, ymin, ymax, zmin, zmax); */
+
+ /* Positive and negative contour levels.*/
+ dz = (zmax-zmin)/(double) PNLEVEL;
+ nlevelneg = 0;
+ nlevelpos = 0;
+ for (i = 0; i < PNLEVEL; i++) {
+ clevel = zmin + ((double) i + 0.5)*dz;
+ if (clevel <= 0.)
+ clevelneg[nlevelneg++] = clevel;
+ else
+ clevelpos[nlevelpos++] = clevel;
+ }
+ /* Colours! */
+ ncollin = 11;
+ ncolbox = 1;
+ ncollab = 2;
+
+ /* Finally start plotting this page! */
+ pladv(0);
+ plcol0(ncolbox);
+
+ plvpas(0.1, 0.9, 0.1, 0.9, 1.0);
+ plwind(xpmin, xpmax, ypmin, ypmax);
+ plbox("", 0., 0, "", 0., 0);
+
+ plcol0(ncollin);
+ if(nlevelneg >0) {
+ /* Negative contours */
+ pllsty(2);
+ plcont(z, PRPTS, PTHETAPTS, 1, PRPTS, 1, PTHETAPTS,
+ clevelneg, nlevelneg, pltr2, (void *) &cgrid2);
+ }
+
+ if(nlevelpos >0) {
+ /* Positive contours */
+ pllsty(1);
+ plcont(z, PRPTS, PTHETAPTS, 1, PRPTS, 1, PTHETAPTS,
+ clevelpos, nlevelpos, pltr2, (void *) &cgrid2);
+ }
+
+ /* Draw outer boundary */
+ for (i = 0; i < PPERIMETERPTS; i++) {
+ t = (2.*M_PI/(PPERIMETERPTS-1))*(double)i;
+ px[i] = x0 + rmax*cos(t);
+ py[i] = y0 + rmax*sin(t);
+ }
+
+ plcol0(ncolbox);
+ plline(PPERIMETERPTS, px, py);
+
+ plcol0(ncollab);
+ pllab("", "", "Shielded potential of charges in a conducting sphere");
+
+ plFree2dGrid(z, PRPTS, PTHETAPTS);
+ plFree2dGrid(cgrid2.xg, PRPTS, PTHETAPTS);
+ plFree2dGrid(cgrid2.yg, PRPTS, PTHETAPTS);
+}
+
+
+/*--------------------------------------------------------------------------*\
+ * main
+ *
+ * Does several contour plots using different coordinate mappings.
+\*--------------------------------------------------------------------------*/
+
+int
+main(int argc, const char *argv[])
+{
+ int i, j;
+ PLFLT xx, yy, argx, argy, distort;
+ static PLINT mark = 1500, space = 1500;
+
+ PLFLT **z, **w;
+ PLFLT xg1[XPTS], yg1[YPTS];
+ PLcGrid cgrid1;
+ PLcGrid2 cgrid2;
+
+/* Parse and process command line arguments */
+
+ (void) plparseopts(&argc, argv, PL_PARSE_FULL);
+
+/* Initialize plplot */
+
+ plinit();
+
+/* Set up function arrays */
+
+ plAlloc2dGrid(&z, XPTS, YPTS);
+ plAlloc2dGrid(&w, XPTS, YPTS);
+
+ for (i = 0; i < XPTS; i++) {
+ xx = (double) (i - (XPTS / 2)) / (double) (XPTS / 2);
+ for (j = 0; j < YPTS; j++) {
+ yy = (double) (j - (YPTS / 2)) / (double) (YPTS / 2) - 1.0;
+ z[i][j] = xx * xx - yy * yy;
+ w[i][j] = 2 * xx * yy;
+ }
+ }
+
+/* Set up grids */
+
+ cgrid1.xg = xg1;
+ cgrid1.yg = yg1;
+ cgrid1.nx = XPTS;
+ cgrid1.ny = YPTS;
+
+ plAlloc2dGrid(&cgrid2.xg, XPTS, YPTS);
+ plAlloc2dGrid(&cgrid2.yg, XPTS, YPTS);
+ cgrid2.nx = XPTS;
+ cgrid2.ny = YPTS;
+
+ for (i = 0; i < XPTS; i++) {
+ for (j = 0; j < YPTS; j++) {
+ mypltr((PLFLT) i, (PLFLT) j, &xx, &yy, NULL);
+
+ argx = xx * M_PI/2;
+ argy = yy * M_PI/2;
+ distort = 0.4;
+
+ cgrid1.xg[i] = xx + distort * cos(argx);
+ cgrid1.yg[j] = yy - distort * cos(argy);
+
+ cgrid2.xg[i][j] = xx + distort * cos(argx) * cos(argy);
+ cgrid2.yg[i][j] = yy - distort * cos(argx) * cos(argy);
+ }
+ }
+
+/* Plot using identity transform */
+/*
+ plenv(-1.0, 1.0, -1.0, 1.0, 0, 0);
+ plcol0(2);
+ plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL);
+ plstyl(1, &mark, &space);
+ plcol0(3);
+ plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL);
+ plstyl(0, &mark, &space);
+ plcol0(1);
+ pllab("X Coordinate", "Y Coordinate", "Streamlines of flow");
+*/
+ pl_setcontlabelformat(4,3);
+ pl_setcontlabelparam(0.006, 0.3, 0.1, 1);
+ plenv(-1.0, 1.0, -1.0, 1.0, 0, 0);
+ plcol0(2);
+ plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL);
+ plstyl(1, &mark, &space);
+ plcol0(3);
+ plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL);
+ plstyl(0, &mark, &space);
+ plcol0(1);
+ pllab("X Coordinate", "Y Coordinate", "Streamlines of flow");
+ pl_setcontlabelparam(0.006, 0.3, 0.1, 0);
+
+/* Plot using 1d coordinate transform */
+
+ plenv(-1.0, 1.0, -1.0, 1.0, 0, 0);
+ plcol0(2);
+ plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11,
+ pltr1, (void *) &cgrid1);
+
+ plstyl(1, &mark, &space);
+ plcol0(3);
+ plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11,
+ pltr1, (void *) &cgrid1);
+ plstyl(0, &mark, &space);
+ plcol0(1);
+ pllab("X Coordinate", "Y Coordinate", "Streamlines of flow");
+ /*
+ pl_setcontlabelparam(0.006, 0.3, 0.1, 1);
+ plenv(-1.0, 1.0, -1.0, 1.0, 0, 0);
+ plcol0(2);
+ plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11,
+ pltr1, (void *) &cgrid1);
+
+ plstyl(1, &mark, &space);
+ plcol0(3);
+ plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11,
+ pltr1, (void *) &cgrid1);
+ plstyl(0, &mark, &space);
+ plcol0(1);
+ pllab("X Coordinate", "Y Coordinate", "Streamlines of flow");
+ pl_setcontlabelparam(0.006, 0.3, 0.1, 0);
+ */
+/* Plot using 2d coordinate transform */
+
+ plenv(-1.0, 1.0, -1.0, 1.0, 0, 0);
+ plcol0(2);
+ plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11,
+ pltr2, (void *) &cgrid2);
+
+ plstyl(1, &mark, &space);
+ plcol0(3);
+ plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11,
+ pltr2, (void *) &cgrid2);
+ plstyl(0, &mark, &space);
+ plcol0(1);
+ pllab("X Coordinate", "Y Coordinate", "Streamlines of flow");
+ /*
+ pl_setcontlabelparam(0.006, 0.3, 0.1, 1);
+ plenv(-1.0, 1.0, -1.0, 1.0, 0, 0);
+ plcol0(2);
+ plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11,
+ pltr2, (void *) &cgrid2);
+
+ plstyl(1, &mark, &space);
+ plcol0(3);
+ plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11,
+ pltr2, (void *) &cgrid2);
+ plstyl(0, &mark, &space);
+ plcol0(1);
+ pllab("X Coordinate", "Y Coordinate", "Streamlines of flow");
+ */
+ pl_setcontlabelparam(0.006, 0.3, 0.1, 0);
+ polar();
+ /*
+ pl_setcontlabelparam(0.006, 0.3, 0.1, 1);
+ polar();
+ */
+ pl_setcontlabelparam(0.006, 0.3, 0.1, 0);
+ potential();
+ /*
+ pl_setcontlabelparam(0.006, 0.3, 0.1, 1);
+ potential();
+ */
+
+/* Clean up */
+
+ plFree2dGrid(z, XPTS, YPTS);
+ plFree2dGrid(w, XPTS, YPTS);
+ plFree2dGrid(cgrid2.xg, XPTS, YPTS);
+ plFree2dGrid(cgrid2.yg, XPTS, YPTS);
+
+ plend();
+
+ exit(0);
+}
Property changes on: trunk/examples/lua/x09.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/examples/lua/x10.lua
===================================================================
--- trunk/examples/lua/x10.lua (rev 0)
+++ trunk/examples/lua/x10.lua 2009-01-19 09:22:19 UTC (rev 9343)
@@ -0,0 +1,35 @@
+-- $Id: $
+
+-- Window positioning demo.
+
+-- initialise Lua bindings to PLplot
+if string.sub(_VERSION,1,7)=='Lua 5.0' then
+ lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
+ assert(lib)()
+else
+ require('plplotluac')
+end
+pl=plplotluac
+
+----------------------------------------------------------------------------
+-- main
+--
+-- Demonstrates absolute positioning of graphs on a page.
+----------------------------------------------------------------------------
+
+-- Parse and process command line arguments
+-- (void) plparseopts(&argc, argv, PL_PARSE_FULL);
+
+-- Initialize plplot
+pl.plinit()
+
+pl.pladv(0)
+pl.plvpor(0.0, 1.0, 0.0, 1.0)
+pl.plwind(0.0, 1.0, 0.0, 1.0)
+pl.plbox("bc", 0.0, 0, "bc", 0.0, 0)
+
+pl.plsvpa(50.0, 150.0, 50.0, 100.0)
+pl.plwind(0.0, 1.0, 0.0, 1.0)
+pl.plbox("bc", 0.0, 0, "bc", 0.0, 0)
+pl.plptex(0.5, 0.5, 1.0, 0.0, 0.5, "BOX at (50,150,50,100)")
+pl.plend()
Property changes on: trunk/examples/lua/x10.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/examples/lua/x11.lua
===================================================================
--- trunk/examples/lua/x11.lua (rev 0)
+++ trunk/examples/lua/x11.lua 2009-01-19 09:22:19 UTC (rev 9343)
@@ -0,0 +1,163 @@
+/* $Id: x11c.c 8033 2007-11-23 15:28:09Z andrewross $
+
+ Mesh plot demo.
+
+ Copyright (C) 2004 Rafael Laboissiere
+
+ This file is part of PLplot.
+
+ PLplot is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "plcdemos.h"
+
+#define XPTS 35 /* Data points in x */
+#define YPTS 46 /* Data points in y */
+#define LEVELS 10
+
+static int opt[] = { DRAW_LINEXY, DRAW_LINEXY};
+
+static PLFLT alt[] = {33.0, 17.0};
+static PLFLT az[] = {24.0, 115.0};
+
+static char *title[4] =
+{
+ "#frPLplot Example 11 - Alt=33, Az=24, Opt=3",
+ "#frPLplot Example 11 - Alt=17, Az=115, Opt=3",
+};
+
+static void
+cmap1_init()
+{
+ PLFLT i[2], h[2], l[2], s[2];
+
+ i[0] = 0.0; /* left boundary */
+ i[1] = 1.0; /* right boundary */
+
+ h[0] = 240; /* blue -> green -> yellow -> */
+ h[1] = 0; /* -> red */
+
+ l[0] = 0.6;
+ l[1] = 0.6;
+
+ s[0] = 0.8;
+ s[1] = 0.8;
+
+ plscmap1n(256);
+ c_plscmap1l(0, 2, i, h, l, s, NULL);
+}
+
+/*--------------------------------------------------------------------------*\
+ * main
+ *
+ * Does a series of mesh plots for a given data set, with different
+ * viewing options in each plot.
+\*--------------------------------------------------------------------------*/
+
+int
+main(int argc, const char *argv[])
+{
+ int i, j, k;
+ PLFLT *x, *y, **z;
+ PLFLT xx, yy;
+ int nlevel = LEVELS;
+ PLFLT clevel[LEVELS];
+ PLFLT zmin, zmax, step;
+
+ /* Parse and process command line arguments */
+
+ (void) plparseopts(&argc, argv, PL_PARSE_FULL);
+
+ /* Initialize plplot */
+
+ plinit();
+
+ x = (PLFLT *) calloc(XPTS, sizeof(PLFLT));
+ y = (PLFLT *) calloc(YPTS, sizeof(PLFLT));
+
+ plAlloc2dGrid(&z, XPTS, YPTS);
+ for (i = 0; i < XPTS; i++) {
+ x[i] = 3. * (double) (i - (XPTS / 2)) / (double) (XPTS / 2);
+ }
+
+ for (i = 0; i < YPTS; i++)
+ y[i] = 3.* (double) (i - (YPTS / 2)) / (double) (YPTS / 2);
+
+ for (i = 0; i < XPTS; i++) {
+ xx = x[i];
+ for (j = 0; j < YPTS; j++) {
+ yy = y[j];
+ z[i][j] = 3. * (1.-xx)*(1.-xx) * exp(-(xx*xx) - (yy+1.)*(yy+1.)) -
+ 10. * (xx/5. - pow(xx,3.) - pow(yy,5.)) * exp(-xx*xx-yy*yy) -
+ 1./3. * exp(-(xx+1)*(xx+1) - (yy*yy));
+
+ if(0) { /* Jungfraujoch/Interlaken */
+ if (z[i][j] < -1.)
+ z[i][j] = -1.;
+ }
+ }
+ }
+
+ plMinMax2dGrid(z, XPTS, YPTS, &zmax, &zmin);
+ step = (zmax - zmin)/(nlevel+1);
+ for (i=0; i<nlevel; i++)
+ clevel[i] = zmin + step + step*i;
+
+ cmap1_init();
+ for (k = 0; k < 2; k++) {
+ for (i=0; i<4; i++) {
+ pladv(0);
+ plcol0(1);
+ plvpor(0.0, 1.0, 0.0, 0.9);
+ plwind(-1.0, 1.0, -1.0, 1.5);
+ plw3d(1.0, 1.0, 1.2, -3.0, 3.0, -3.0, 3.0, zmin, zmax, alt[k], az[k]);
+ plbox3("bnstu", "x axis", 0.0, 0,
+ "bnstu", "y axis", 0.0, 0,
+ "bcdmnstuv", "z axis", 0.0, 4);
+
+ plcol0(2);
+
+ /* wireframe plot */
+ if (i==0)
+ plmesh(x, y, z, XPTS, YPTS, opt[k]);
+
+ /* magnitude colored wireframe plot */
+ else if (i==1)
+ plmesh(x, y, z, XPTS, YPTS, opt[k] | MAG_COLOR);
+
+ /* magnitude colored wireframe plot with sides */
+ else if (i==2)
+ plot3d(x, y, z, XPTS, YPTS, opt[k] | MAG_COLOR, 1);
+
+ /* magnitude colored wireframe plot with base contour */
+ else if (i==3)
+ plmeshc(x, y, z, XPTS, YPTS, opt[k] | MAG_COLOR | BASE_CONT,
+ clevel, nlevel);
+
+ plcol0(3);
+ plmtex("t", 1.0, 0.5, 0.5, title[k]);
+ }
+ }
+
+/* Clean up */
+
+ free((void *) x);
+ free((void *) y);
+ plFree2dGrid(z, XPTS, YPTS);
+
+ plend();
+
+ exit(0);
+}
Property changes on: trunk/examples/lua/x11.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/examples/lua/x12.lua
===================================================================
--- trunk/examples/lua/x12.lua (rev 0)
+++ trunk/examples/lua/x12.lua 2009-01-19 09:22:19 UTC (rev 9343)
@@ -0,0 +1,74 @@
+-- $Id: $
+
+-- Bar chart demo.
+
+-- initialise Lua bindings to PLplot
+if string.sub(_VERSION,1,7)=='Lua 5.0' then
+ lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotlua...
[truncated message content] |
|
From: <ai...@us...> - 2009-01-29 22:49:03
|
Revision: 9414
http://plplot.svn.sourceforge.net/plplot/?rev=9414&view=rev
Author: airwin
Date: 2009-01-29 22:48:54 +0000 (Thu, 29 Jan 2009)
Log Message:
-----------
Configure the initialization of all Lua examples.
Make uniform copyright notices on Lua examples.
Allow running of the Lua examples from the lua/examples subdirectory of the
build tree.
Modified Paths:
--------------
trunk/examples/CMakeLists.txt
trunk/examples/lua/x01.lua
trunk/examples/lua/x02.lua
trunk/examples/lua/x03.lua
trunk/examples/lua/x04.lua
trunk/examples/lua/x05.lua
trunk/examples/lua/x06.lua
trunk/examples/lua/x07.lua
trunk/examples/lua/x08.lua
trunk/examples/lua/x09.lua
trunk/examples/lua/x10.lua
trunk/examples/lua/x11.lua
trunk/examples/lua/x12.lua
trunk/examples/lua/x13.lua
trunk/examples/lua/x15.lua
trunk/examples/lua/x16.lua
trunk/examples/lua/x18.lua
trunk/examples/lua/x19.lua
trunk/examples/lua/x22.lua
trunk/examples/lua/x24.lua
trunk/examples/lua/x25.lua
trunk/examples/lua/x30.lua
Added Paths:
-----------
trunk/examples/lua/CMakeLists.txt
trunk/examples/lua/plplot_examples.lua.in
Modified: trunk/examples/CMakeLists.txt
===================================================================
--- trunk/examples/CMakeLists.txt 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/CMakeLists.txt 2009-01-29 22:48:54 UTC (rev 9414)
@@ -83,6 +83,9 @@
if(ENABLE_ocaml)
add_subdirectory(ocaml)
endif(ENABLE_ocaml)
+if(ENABLE_lua)
+ add_subdirectory(lua)
+endif(ENABLE_lua)
# Configure Makefile.examples with some specific variables
Added: trunk/examples/lua/CMakeLists.txt
===================================================================
--- trunk/examples/lua/CMakeLists.txt (rev 0)
+++ trunk/examples/lua/CMakeLists.txt 2009-01-29 22:48:54 UTC (rev 9414)
@@ -0,0 +1,108 @@
+# examples/lua/CMakeLists.txt
+### Process this file with cmake to produce Makefile
+###
+# Copyright (C) 2009 Alan W. Irwin
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; version 2 of the License.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+set(lua_STRING_INDICES
+"01"
+"02"
+"03"
+"04"
+"05"
+"06"
+"07"
+"08"
+"09"
+"10"
+"11"
+"12"
+"13"
+"15"
+"16"
+"18"
+"19"
+"22"
+"24"
+"25"
+"30"
+)
+
+set(lua_SCRIPTS)
+foreach(STRING_INDEX ${lua_STRING_INDICES})
+ set(lua_SCRIPTS ${lua_SCRIPTS} x${STRING_INDEX}.lua)
+endforeach(STRING_INDEX ${lua_STRING_INDICES})
+
+set(PERM_SCRIPTS
+OWNER_READ
+OWNER_WRITE
+OWNER_EXECUTE
+GROUP_READ
+GROUP_EXECUTE
+WORLD_READ
+WORLD_EXECUTE
+)
+
+install(FILES ${lua_SCRIPTS}
+DESTINATION ${DATA_DIR}/examples/lua
+PERMISSIONS ${PERM_SCRIPTS}
+)
+
+if(BUILD_TEST AND
+NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}"
+)
+ # equivalent to install commands but at "make" time rather than
+ # "make install" time, to the build tree if different than the source
+ # tree.
+ set(command_depends)
+ foreach(file ${lua_SCRIPTS})
+ set(
+ command_DEPENDS
+ ${command_DEPENDS}
+ ${CMAKE_CURRENT_BINARY_DIR}/${file}
+ )
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${file}
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
+ )
+ endforeach(file ${lua_SCRIPTS} ${lua_DATA})
+ add_custom_target(lua_examples ALL DEPENDS ${command_DEPENDS})
+endif(BUILD_TEST AND
+NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}"
+)
+
+set(lua_lib_location ${CMAKE_BINARY_DIR}/bindings/lua)
+configure_file(
+${CMAKE_CURRENT_SOURCE_DIR}/plplot_examples.lua.in
+${CMAKE_CURRENT_BINARY_DIR}/plplot_examples.lua
+@ONLY
+)
+
+set(lua_lib_location ${LIB_DIR})
+configure_file(
+${CMAKE_CURRENT_SOURCE_DIR}/plplot_examples.lua.in
+${CMAKE_CURRENT_BINARY_DIR}/plplot_examples.lua_install
+@ONLY
+)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plplot_examples.lua_install
+DESTINATION ${DATA_DIR}/examples/lua
+PERMISSIONS ${PERM_DATA}
+RENAME plplot_examples.lua
+)
Property changes on: trunk/examples/lua/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/examples/lua/plplot_examples.lua.in
===================================================================
--- trunk/examples/lua/plplot_examples.lua.in (rev 0)
+++ trunk/examples/lua/plplot_examples.lua.in 2009-01-29 22:48:54 UTC (rev 9414)
@@ -0,0 +1,7 @@
+-- initialise Lua bindings for PLplot examples.
+if string.sub(_VERSION,1,7)=='Lua 5.0' then
+ lib=loadlib('@lua_lib_location@/plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
+ assert(lib)()
+else
+ require('plplotluac')
+end
Property changes on: trunk/examples/lua/plplot_examples.lua.in
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/examples/lua/x01.lua
===================================================================
--- trunk/examples/lua/x01.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x01.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -21,16 +21,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
--]]
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
-
-
-- Variables and data arrays used by plot generators
x = {}
y = {}
Modified: trunk/examples/lua/x02.lua
===================================================================
--- trunk/examples/lua/x02.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x02.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,16 +1,29 @@
--- $Id$
+--[[ $Id$
--- Multipl.e window and color map 0 demo.
+ Multiple window and color map 0 demo.
--- initialise Lua bindings to pl.pl.ot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ Copyright (C) 2008 Werner Smekal
+ This file is part of PLplot.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
----------------------------------------------------------------------------
-- draw_windows
--
Modified: trunk/examples/lua/x03.lua
===================================================================
--- trunk/examples/lua/x03.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x03.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,17 +1,29 @@
--- $Id$
+--[[ $Id$
--- Polar plot demo.
+ Polar plot demo.
+ Copyright (C) 2008 Werner Smekal
--- initialise Lua bindings to pl.pl.ot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ This file is part of PLplot.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
----------------------------------------------------------------------------
-- main
--
Modified: trunk/examples/lua/x04.lua
===================================================================
--- trunk/examples/lua/x04.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x04.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,17 +1,30 @@
--- $Id$
+--[[ $Id$
--- Log plot demo.
+ Log plot demo.
+ Simple line plot and multiple windows demo.
+ Copyright (C) 2008 Werner Smekal
--- initialise Lua bindings to pl.pl.ot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ This file is part of PLplot.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
----------------------------------------------------------------------------
-- plot1
--
Modified: trunk/examples/lua/x05.lua
===================================================================
--- trunk/examples/lua/x05.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x05.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,15 +1,29 @@
--- $Id$
+--[[ $Id$
--- Histogram demo.
+ Histogram demo.
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ Copyright (C) 2008 Werner Smekal
+ This file is part of PLplot.
+
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
--------------------------------------------------------------------------
-- main
--
Modified: trunk/examples/lua/x06.lua
===================================================================
--- trunk/examples/lua/x06.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x06.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,17 +1,29 @@
--- $Id$
+--[[ $Id$
--- Font demo.
+ Font demo.
+ Copyright (C) 2008 Werner Smekal
--- initialise Lua bindings to pl.pl.ot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ This file is part of PLplot.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
----------------------------------------------------------------------------
-- main
--
Modified: trunk/examples/lua/x07.lua
===================================================================
--- trunk/examples/lua/x07.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x07.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,16 +1,29 @@
--- $Id$
+--[[ $Id$
--- Font demo.
+ Font demo.
+ Copyright (C) 2008 Werner Smekal
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ This file is part of PLplot.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
base = { 0, 200, 500, 600, 700, 800, 900,
2000, 2100, 2200, 2300, 2400, 2500,
2600, 2700, 2800, 2900 }
Modified: trunk/examples/lua/x08.lua
===================================================================
--- trunk/examples/lua/x08.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x08.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,36 +1,29 @@
--[[ $Id$
- 3-d plot demo.
+ 3-d plot demo.
- Copyright (C) 2009 Werner Smekal
+ Copyright (C) 2008 Werner Smekal
- This file is part of PLplot.
+ This file is part of PLplot.
- PLplot is free software you can redistribute it and/or modify
- it under the terms of the GNU General Library Public License as published
- by the Free Software Foundation either version 2 of the License, or
- (at your option) any later version.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
- PLplot is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Library General Public License for more details.
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
- You should have received a copy of the GNU Library General Public License
- along with PLplot if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
--]]
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
-
-
----------------------------------------------------------------------------
-- cmap1_init1
--
Modified: trunk/examples/lua/x09.lua
===================================================================
--- trunk/examples/lua/x09.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x09.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -2,33 +2,28 @@
Contour plot demo.
- This file is part of PLplot.
+ Copyright (C) 2008 Werner Smekal
- PLplot is free software you can redistribute it and/or modify
- it under the terms of the GNU General Library Public License as published
- by the Free Software Foundation either version 2 of the License, or
- (at your option) any later version.
+ This file is part of PLplot.
- PLplot is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Library General Public License for more details.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
- You should have received a copy of the GNU Library General Public License
- along with PLplot if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
--]]
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('plplotluac.dll','luaopen_plplotluac') or loadlib('plplotluac.so','luaopen_plplotluac')
- assert(lib)()
-else
- require('example')
-end
-
-
XPTS = 35 -- Data points in x
YPTS = 46 -- Data points in y
Modified: trunk/examples/lua/x10.lua
===================================================================
--- trunk/examples/lua/x10.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x10.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,15 +1,30 @@
--- $Id$
+--[[ $Id$
--- Window positioning demo.
+ Window positioning demo.
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ Copyright (C) 2008 Werner Smekal
+ This file is part of PLplot.
+
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
+
----------------------------------------------------------------------------
-- main
--
Modified: trunk/examples/lua/x11.lua
===================================================================
--- trunk/examples/lua/x11.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x11.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -2,35 +2,28 @@
Mesh plot demo.
- Copyright (C) 2004 Rafael Laboissiere
+ Copyright (C) 2008 Werner Smekal
- This file is part of PLplot.
+ This file is part of PLplot.
- PLplot is free software you can redistribute it and/or modify
- it under the terms of the GNU General Library Public License as published
- by the Free Software Foundation either version 2 of the License, or
- (at your option) any later version.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
- PLplot is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Library General Public License for more details.
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
- You should have received a copy of the GNU Library General Public License
- along with PLplot if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
--]]
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
-
-
XPTS = 35 -- Data points in x
YPTS = 46 -- Data points in y
LEVELS = 10
Modified: trunk/examples/lua/x12.lua
===================================================================
--- trunk/examples/lua/x12.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x12.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,15 +1,29 @@
--- $Id$
+--[[ $Id$
--- Bar chart demo.
+ Bar chart demo.
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ Copyright (C) 2008 Werner Smekal
+ This file is part of PLplot.
+
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
function pl.fbox(x0, y0)
x = {}
y = {}
Modified: trunk/examples/lua/x13.lua
===================================================================
--- trunk/examples/lua/x13.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x13.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,15 +1,29 @@
--- $Id$
+--[[ $Id$
--- Pie chart demo.
+ Pie chart demo.
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ Copyright (C) 2008 Werner Smekal
+ This file is part of PLplot.
+
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
text = { "Maurice", "Geoffrey", "Alan",
"Rafael", "Vince" }
Modified: trunk/examples/lua/x15.lua
===================================================================
--- trunk/examples/lua/x15.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x15.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,16 +1,29 @@
--- $Id$
+--[[ $Id$
--- Shade plot demo.
+ Shade plot demo.
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ Copyright (C) 2008 Werner Smekal
+ This file is part of PLplot.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
XPTS = 35 -- Data points in x
YPTS = 46 -- Data points in y
Modified: trunk/examples/lua/x16.lua
===================================================================
--- trunk/examples/lua/x16.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x16.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,16 +1,29 @@
--- $Id$
+--[[ $Id$
--- plshade demo, using color fill.
+ plshade demo, using color fill.
--- initialise Lua bindings to PLplot
-if string.sub(_VERSION,1,7)=='Lua 5.0' then
- lib=loadlib('./plplotluac.so','luaopen_plplotluac') or loadlib('plplotluac.dll','luaopen_plplotluac')
- assert(lib)()
-else
- require('plplotluac')
-end
+ Copyright (C) 2008 Werner Smekal
+ This file is part of PLplot.
+ PLplot is free software you can redistribute it and/or modify
+ it under the terms of the GNU General Library Public License as published
+ by the Free Software Foundation either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+--]]
+
+-- initialise Lua bindings for PLplot examples.
+dofile("plplot_examples.lua")
+
-- Fundamental settings. See notes[] for more info.
ns = 20 -- Default number of shade levels
nx = 35 -- Default number of data points in x
Modified: trunk/examples/lua/x18.lua
===================================================================
--- trunk/examples/lua/x18.lua 2009-01-29 08:38:36 UTC (rev 9413)
+++ trunk/examples/lua/x18.lua 2009-01-29 22:48:54 UTC (rev 9414)
@@ -1,17 +1,29 @@
--- $Id$
+--[[ $Id$
--- 3-d line and point plot demo....
[truncated message content] |
|
From: <ai...@us...> - 2009-01-31 23:02:45
|
Revision: 9419
http://plplot.svn.sourceforge.net/plplot/?rev=9419&view=rev
Author: airwin
Date: 2009-01-31 23:02:40 +0000 (Sat, 31 Jan 2009)
Log Message:
-----------
Improved configuration, organization, and dependency information for the
Makefile of the installed examples. Because of the improved dependencies
and splitting up of targets and rules, "make test" in the installed examples
tree is now more efficient for parallel (e.g., -j3) make on boxes with
multiple cpu's.
Modified Paths:
--------------
trunk/examples/CMakeLists.txt
trunk/examples/Makefile.examples.in
Modified: trunk/examples/CMakeLists.txt
===================================================================
--- trunk/examples/CMakeLists.txt 2009-01-30 10:18:44 UTC (rev 9418)
+++ trunk/examples/CMakeLists.txt 2009-01-31 23:02:40 UTC (rev 9419)
@@ -29,8 +29,8 @@
# of example 20 in the various examples subdirectories can conveniently
# access this file.
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/lena.pgm
-DESTINATION ${DATA_DIR}/examples
-)
+ DESTINATION ${DATA_DIR}/examples
+ )
# Do the same as above for the build tree for those who want to individually
# run the various example 20 implementations from the examples subdirectories
@@ -38,15 +38,15 @@
if(BUILD_TEST)
add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lena.pgm
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_SOURCE_DIR}/lena.pgm
- ${CMAKE_CURRENT_BINARY_DIR}/lena.pgm
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lena.pgm
- )
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lena.pgm
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_SOURCE_DIR}/lena.pgm
+ ${CMAKE_CURRENT_BINARY_DIR}/lena.pgm
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lena.pgm
+ )
add_custom_target(examples_lena_file ALL
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lena.pgm
- )
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lena.pgm
+ )
endif(BUILD_TEST)
add_subdirectory(c)
@@ -90,76 +90,103 @@
# Configure Makefile.examples with some specific variables
if(PLD_ps)
- set(PSC_ALL x01c.psc)
+ if(NOT ENABLE_ada)
+ set(PSC_ADA_COMMENT "#")
+ endif(NOT ENABLE_ada)
+
+ if(NOT ENABLE_cxx)
+ set(PSC_CXX_COMMENT "#")
+ endif(NOT ENABLE_cxx)
+
+ if(NOT ENABLE_f77)
+ set(PSC_F77_COMMENT "#")
+ endif(NOT ENABLE_f77)
+
+ if(NOT ENABLE_f95)
+ set(PSC_F95_COMMENT "#")
+ endif(NOT ENABLE_f95)
+
+ if(NOT ENABLE_java)
+ set(PSC_JAVA_COMMENT "#")
+ endif(NOT ENABLE_java)
+
+ if(NOT ENABLE_ocaml)
+ set(PSC_OCAML_COMMENT "#")
+ endif(NOT ENABLE_ocaml)
+
+ if(NOT ENABLE_octave)
+ set(PSC_OCTAVE_COMMENT "#")
+ endif(NOT ENABLE_octave)
+
+ if(NOT ENABLE_pdl)
+ set(PSC_PERL_COMMENT "#")
+ endif(NOT ENABLE_pdl)
+
+ if(NOT ENABLE_python)
+ set(PSC_PYTHON_COMMENT "#")
+ endif(NOT ENABLE_python)
+
+ if(NOT ENABLE_tcl)
+ set(PSC_TCL_COMMENT "#")
+ endif(NOT ENABLE_tcl)
+
else(PLD_ps)
- set(PSC_ALL_COMMENT "#")
+ set(PSC_ADA_COMMENT "#")
+ set(PSC_C_COMMENT "#")
+ set(PSC_CXX_COMMENT "#")
+ set(PSC_F77_COMMENT "#")
+ set(PSC_F95_COMMENT "#")
+ set(PSC_JAVA_COMMENT "#")
+ set(PSC_OCAML_COMMENT "#")
+ set(PSC_OCTAVE_COMMENT "#")
+ set(PSC_PERL_COMMENT "#")
+ set(PSC_PYTHON_COMMENT "#")
+ set(PSC_TCL_COMMENT "#")
endif(PLD_ps)
-if(PLD_pdfcairo)
- set(PDFCAIRO x01c.pdfcairo)
-else(PLD_pdfcairo)
+if(NOT PLD_pdfcairo)
set(PDFCAIRO_COMMENT "#")
-endif(PLD_pdfcairo)
+endif(NOT PLD_pdfcairo)
-if(PLD_pngcairo)
- set(PNGCAIRO x01c01.pngcairo)
-else(PLD_pngcairo)
+if(NOT PLD_pngcairo)
set(PNGCAIRO_COMMENT "#")
-endif(PLD_pngcairo)
+endif(NOT PLD_pngcairo)
-if(PLD_pscairo)
- set(PSCAIRO x01c.pscairo)
-else(PLD_pscairo)
+if(NOT PLD_pscairo)
set(PSCAIRO_COMMENT "#")
-endif(PLD_pscairo)
+endif(NOT PLD_pscairo)
-if(PLD_svgcairo)
- set(SVGCAIRO x01c01.svgcairo)
-else(PLD_svgcairo)
+if(NOT PLD_svgcairo)
set(SVGCAIRO_COMMENT "#")
-endif(PLD_svgcairo)
+endif(NOT PLD_svgcairo)
-if(PLD_gif)
- set(GIF x01c01.gif)
-else(PLD_gif)
+if(NOT PLD_gif)
set(GIF_COMMENT "#")
-endif(PLD_gif)
+endif(NOT PLD_gif)
-if(PLD_jpeg)
- set(JPEG x01c01.jpeg)
-else(PLD_jpeg)
+if(NOT PLD_jpeg)
set(JPEG_COMMENT "#")
-endif(PLD_jpeg)
+endif(NOT PLD_jpeg)
-if(PLD_png)
- set(PNG x01c01.png)
-else(PLD_png)
+if(NOT PLD_png)
set(PNG_COMMENT "#")
-endif(PLD_png)
+endif(NOT PLD_png)
-if(PLD_psttf)
- set(PSTTFC x01c.psttfc)
-else(PLD_psttf)
+if(NOT PLD_psttf)
set(PSTTFC_COMMENT "#")
-endif(PLD_psttf)
+endif(NOT PLD_psttf)
-if(PLD_svg)
- set(SVG x01c01.svg)
-else(PLD_svg)
+if(NOT PLD_svg)
set(SVG_COMMENT "#")
-endif(PLD_svg)
+endif(NOT PLD_svg)
-if(PLD_xfig)
- set(XFIG x01c01.xfig)
-else(PLD_xfig)
+if(NOT PLD_xfig)
set(XFIG_COMMENT "#")
-endif(PLD_xfig)
+endif(NOT PLD_xfig)
-if(PLD_pstex)
- set(PSTEX x01c.pstex)
-else(PLD_pstex)
+if(NOT PLD_pstex)
set(PSTEX_COMMENT "#")
-endif(PLD_pstex)
+endif(NOT PLD_pstex)
if(DIFF_EXECUTABLE AND TAIL_EXECUTABLE)
set(COMPARE compare)
@@ -174,6 +201,6 @@
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples
-DESTINATION ${DATA_DIR}/examples
-RENAME Makefile
-)
+ DESTINATION ${DATA_DIR}/examples
+ RENAME Makefile
+ )
Modified: trunk/examples/Makefile.examples.in
===================================================================
--- trunk/examples/Makefile.examples.in 2009-01-30 10:18:44 UTC (rev 9418)
+++ trunk/examples/Makefile.examples.in 2009-01-31 23:02:40 UTC (rev 9419)
@@ -21,94 +21,204 @@
# This Makefile should not be used in the build tree. It is meant for use
# only in the install tree. It is first configured, then installed
-# (with the name Makefile) in the _installed_ examples directory as a
-# convenience to the user for building all the examples without having
-# to invoke make in the individual sub-directories of examples.
+# (with the name Makefile) in the _installed_ examples directory
+# It combines building all the examples that need to be built along
+# with testing all examples.
-SUBDIRS = c c++ f77 f95 tk java ada ocaml
all: c/x01c@EXEEXT@
+c/x01c@EXEEXT@:
+ cd c; $(MAKE)
+c_clean:
+ cd c; $(MAKE) clean
+.PHONY: c_clean
+clean: c_clean
+x01c.psc: c/x01c@EXEEXT@
+ echo C front-end for psc
+ ./plplot-test.sh --verbose --front-end=c --device=psc
+test: x01c.psc
+@COMPARE_COMMENT@compare: x01c.psc
-# Need real file here as target so that tests don't depend on all (which means
-# they would always be out of date).
+@PSC_ADA_COMMENT@all: ada/x01a@EXEEXT@
+@PSC_ADA_COMMENT@ada/x01a@EXEEXT@:
+ cd ada; $(MAKE)
+@PSC_ADA_COMMENT@ada_clean:
+@PSC_ADA_COMMENT@ cd ada; $(MAKE) clean
+@PSC_ADA_COMMENT@.PHONY: ada_clean
+@PSC_ADA_COMMENT@clean: ada_clean
+@PSC...@x0...: ada/x01a@EXEEXT@
+@PSC_ADA_COMMENT@ echo Ada front-end for psc
+@PSC_ADA_COMMENT@ ./plplot-test.sh --verbose --front-end=ada --device=psc
+@PSC_ADA_COMMENT@test: x01a.psc
+@PSC_ADA_COMMENT@@COMPARE_COMMENT@compare: x01a.psc
-c/x01c@EXEEXT@:
- target=`echo $@`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test -d "$$subdir"; then \
- echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE)); \
- fi; \
- done
+@PSC_CXX_COMMENT@all: c++/x01@EXEEXT@
+@PSC_CXX_COMMENT@c++/x01@EXEEXT@:
+ cd c++; $(MAKE)
+@PSC_CXX_COMMENT@cxx_clean:
+@PSC_CXX_COMMENT@ cd c++; $(MAKE) clean
+@PSC_CXX_COMMENT@.PHONY: cxx_clean
+@PSC_CXX_COMMENT@clean: cxx_clean
+@PSC...@x0...: c++/x01@EXEEXT@
+@PSC_CXX_COMMENT@ echo C++ front-end for psc
+@PSC_CXX_COMMENT@ ./plplot-test.sh --verbose --front-end=cxx --device=psc
+@PSC_CXX_COMMENT@test: x01cxx.psc
+@PSC_CXX_COMMENT@@COMPARE_COMMENT@compare: x01cxx.psc
-test: @PSC_ALL@ @PDFCAIRO@ @PNGCAIRO@ @PSCAIRO@ @SVGCAIRO@ \
- @GIF@ @JPEG@ @PNG@ @PSTTFC@ @SVG@ @XFIG@ @PSTEX@ @COMPARE@
+@PSC_F77_COMMENT@all: f77/x01f@EXEEXT@
+@PSC_F77_COMMENT@f77/x01f@EXEEXT@:
+ cd f77; $(MAKE)
+@PSC_F77_COMMENT@f77_clean:
+@PSC_F77_COMMENT@ cd f77; $(MAKE) clean
+@PSC_F77_COMMENT@.PHONY: f77_clean
+@PSC_F77_COMMENT@clean: f77_clean
+@PSC...@x0...: f77/x01f@EXEEXT@
+@PSC_F77_COMMENT@ echo F77 front-end for psc
+@PSC_F77_COMMENT@ ./plplot-test.sh --verbose --front-end=f77 --device=psc
+@PSC_F77_COMMENT@test: x01f.psc
+@PSC_F77_COMMENT@@COMPARE_COMMENT@compare: x01f.psc
-@PSC_ALL_COMMENT@@PSC_ALL@: c/x01c@EXEEXT@
-@PSC_ALL_COMMENT@ echo psc all front-ends
-@PSC_ALL_COMMENT@ ./plplot-test.sh --verbose --device=psc
+@PSC_F95_COMMENT@all: f95/x01f@EXEEXT@
+@PSC_F95_COMMENT@f95/x01f@EXEEXT@:
+ cd f95; $(MAKE)
+@PSC_F95_COMMENT@f95_clean:
+@PSC_F95_COMMENT@ cd f95; $(MAKE) clean
+@PSC_F95_COMMENT@.PHONY: f95_clean
+@PSC_F95_COMMENT@clean: f95_clean
+@PSC...@x0...: f95/x01f@EXEEXT@
+@PSC_F95_COMMENT@ echo F95 front-end for psc
+@PSC_F95_COMMENT@ ./plplot-test.sh --verbose --front-end=f95 --device=psc
+@PSC_F95_COMMENT@test: x01f95.psc
+@PSC_F95_COMMENT@@COMPARE_COMMENT@compare: x01f95.psc
-@PDFCAIRO_COMMENT@@PDFCAIRO@: c/x01c@EXEEXT@
+@PSC_JAVA_COMMENT@all: java/x01.class
+@PSC_JAVA_COMMENT@java/x01.class:
+ cd java; $(MAKE)
+@PSC_JAVA_COMMENT@java_clean:
+@PSC_JAVA_COMMENT@ cd java; $(MAKE) clean
+@PSC_JAVA_COMMENT@.PHONY: java_clean
+@PSC_JAVA_COMMENT@clean: java_clean
+@PSC...@x0...: java/x01.class
+@PSC_JAVA_COMMENT@ echo Java front-end for psc
+@PSC_JAVA_COMMENT@ ./plplot-test.sh --verbose --front-end=java --device=psc
+@PSC_JAVA_COMMENT@test: x01j.psc
+@PSC_JAVA_COMMENT@@COMPARE_COMMENT@compare: x01j.psc
+
+@PSC_OCAML_COMMENT@all: ocaml/x01ocaml@EXEEXT@
+@PSC_OCAML_COMMENT@ocaml/x01ocaml@EXEEXT@:
+ cd ocaml; $(MAKE)
+@PSC_OCAML_COMMENT@ocaml_clean:
+@PSC_OCAML_COMMENT@ cd ocaml; $(MAKE) clean
+@PSC_OCAML_COMMENT@.PHONY: ocaml_clean
+@PSC_OCAML_COMMENT@clean: ocaml_clean
+@PSC...@x0...: ocaml/x01ocaml@EXEEXT@
+@PSC_OCAML_COMMENT@ echo OCaml front-end for psc
+@PSC_OCAML_COMMENT@ ./plplot-test.sh --verbose --front-end=ocaml --device=psc
+@PSC_OCAML_COMMENT@test: x01ocaml.psc
+@PSC_OCAML_COMMENT@@COMPARE_COMMENT@compare: x01ocaml.psc
+
+@PSC...@x0...: octave/x01c.m
+@PSC_OCTAVE_COMMENT@ echo Octave front-end for psc
+@PSC_OCTAVE_COMMENT@ ./plplot-test.sh --verbose --front-end=octave --device=psc
+@PSC_OCTAVE_COMMENT@test: x01o.psc
+@PSC_OCTAVE_COMMENT@@COMPARE_COMMENT@compare: x01o.psc
+
+@PSC...@x0...: perl/x01.pl
+@PSC_PERL_COMMENT@ echo Perl front-end for psc
+@PSC_PERL_COMMENT@ ./plplot-test.sh --verbose --front-end=perl --device=psc
+@PSC_PERL_COMMENT@test: x01pdl.psc
+@PSC_PERL_COMMENT@@COMPARE_COMMENT@compare: x01pdl.psc
+
+@PSC...@x0...: python/x01
+@PSC_PYTHON_COMMENT@ echo Python front-end for psc
+@PSC_PYTHON_COMMENT@ ./plplot-test.sh --verbose --front-end=python --device=psc
+@PSC_PYTHON_COMMENT@test: x01p.psc
+@PSC_PYTHON_COMMENT@@COMPARE_COMMENT@compare: x01p.psc
+
+@PSC...@x0...: tcl/x01
+@PSC_TCL_COMMENT@ echo Tcl front-end for psc
+@PSC_TCL_COMMENT@ ./plplot-test.sh --verbose --front-end=tcl --device=psc
+@PSC_TCL_COMMENT@test: x01t.psc
+@PSC_TCL_COMMENT@@COMPARE_COMMENT@compare: x01t.psc
+
+@PDF...@x0...: c/x01c@EXEEXT@
@PDFCAIRO_COMMENT@ echo pdfcairo
@PDFCAIRO_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=pdfcairo
+@PDFCAIRO_COMMENT@test: x01pdfcairo.psc
+@PDFCAIRO_COMMENT@@COMPARE_COMMENT@compare: x01pdfcairo.psc
-@PNGCAIRO_COMMENT@@PNGCAIRO@: c/x01c@EXEEXT@
+@PNG...@x0...: c/x01c@EXEEXT@
@PNGCAIRO_COMMENT@ echo pngcairo
@PNGCAIRO_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=pngcairo
+@PNGCAIRO_COMMENT@test: x01c01.pngcairo
+@PNGCAIRO_COMMENT@@COMPARE_COMMENT@compare: x01c01.pngcairo
-@PSCAIRO_COMMENT@@PSCAIRO@: c/x01c@EXEEXT@
+@PSC...@x0...: c/x01c@EXEEXT@
@PSCAIRO_COMMENT@ echo pscairo
@PSCAIRO_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=pscairo
+@PSCAIRO_COMMENT@test: x01c.pscairo
+@PSCAIRO_COMMENT@@COMPARE_COMMENT@compare: x01c.pscairo
-@SVGCAIRO_COMMENT@@SVGCAIRO@: c/x01c@EXEEXT@
+@SVG...@x0...: c/x01c@EXEEXT@
@SVGCAIRO_COMMENT@ echo svgcairo
@SVGCAIRO_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=svgcairo
+@SVGCAIRO_COMMENT@test: x01c01.svgcairo
+@SVGCAIRO_COMMENT@@COMPARE_COMMENT@compare: x01c01.svgcairo
-@GIF_COMMENT@@GIF@: c/x01c@EXEEXT@
+@GIF...@x0... : c/x01c@EXEEXT@
@GIF_COMMENT@ echo gif
@GIF_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=gif
+@GIF_COMMENT@test: x01c01.gif
+@GIF_COMMENT@@COMPARE_COMMENT@compare: x01c01.gif
-@JPEG_COMMENT@@JPEG@: c/x01c@EXEEXT@
+@JPE...@x0...: c/x01c@EXEEXT@
@JPEG_COMMENT@ echo jpeg
@JPEG_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=jpeg
+@JPEG_COMMENT@test: x01c01.jpeg
+@JPEG_COMMENT@@COMPARE_COMMENT@compare: x01c01.jpeg
-@PNG_COMMENT@@PNG@: c/x01c@EXEEXT@
+@PNG...@x0...: c/x01c@EXEEXT@
@PNG_COMMENT@ echo png
@PNG_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=png
+@PNG_COMMENT@test: x01c01.png
+@PNG_COMMENT@@COMPARE_COMMENT@compare: x01c01.png
-@PSTTFC_COMMENT@@PSTTFC@: c/x01c@EXEEXT@
+@PST...@x0...: c/x01c@EXEEXT@
@PSTTFC_COMMENT@ echo psttfc
@PSTTFC_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=psttfc
+@PSTTFC_COMMENT@test: x01c.psttfc
+@PSTTFC_COMMENT@@COMPARE_COMMENT@compare: x01c.psttfc
-@SVG_COMMENT@@SVG@: c/x01c@EXEEXT@
+@SVG...@x0...: c/x01c@EXEEXT@
@SVG_COMMENT@ echo svg
@SVG_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=svg
+@SVG_COMMENT@test: x01c01.svg
+@SVG_COMMENT@@COMPARE_COMMENT@compare: x01c01.svg
-@XFIG_COMMENT@@XFIG@: c/x01c@EXEEXT@
+@XFI...@x0...: c/x01c@EXEEXT@
@XFIG_COMMENT@ echo xfig
@XFIG_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=xfig
+@XFIG_COMMENT@test: x01c01.xfig
+@XFIG_COMMENT@@COMPARE_COMMENT@compare: x01c01.xfig
-@PSTEX_COMMENT@@PSTEX@: c/x01c@EXEEXT@
+@PST...@x0...: c/x01c@EXEEXT@
@PSTEX_COMMENT@ echo pstex
@PSTEX_COMMENT@ ./plplot-test.sh --verbose --front-end=c --device=pstex
+@PSTEX_COMMENT@test: x01c.pstex
+@PSTEX_COMMENT@@COMPARE_COMMENT@compare: x01c.pstex
-@COMPARE_COMMENT@@COMPARE@: @PSC_ALL@
+@COMPARE_COMMENT@compare:
@COMPARE_COMMENT@ echo compare
@COMPARE_COMMENT@ ./test_diff.sh
+@COMPARE_COMMENT@test: compare
test_interactive: c/x01c@EXEEXT@
./plplot-test-interactive.sh
-clean: test_clean
- target=`echo $@`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test -d "$$subdir"; then \
- echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $$target); \
- fi; \
- done
-
test_clean:
rm -f *.psc *.pdfcairo *.pngcairo *.pscairo *.svgcairo \
*.gif *.jpeg *.png *.psttfc *.svg *.xfig *.pstex* *.txt test.error
-.PHONY : all clean test test_clean test_interactive @COMPARE@
+clean: test_clean
+
+
+.PHONY : all clean test test_clean test_interactive compare
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-02-03 01:20:38
|
Revision: 9438
http://plplot.svn.sourceforge.net/plplot/?rev=9438&view=rev
Author: airwin
Date: 2009-02-03 01:20:33 +0000 (Tue, 03 Feb 2009)
Log Message:
-----------
Propagate x14 geometry changes to Ada and C++.
Modified Paths:
--------------
trunk/examples/ada/x14a.adb.cmake
trunk/examples/ada/xthick14a.adb.cmake
trunk/examples/c++/x14.cc
Modified: trunk/examples/ada/x14a.adb.cmake
===================================================================
--- trunk/examples/ada/x14a.adb.cmake 2009-02-02 21:18:00 UTC (rev 9437)
+++ trunk/examples/ada/x14a.adb.cmake 2009-02-03 01:20:33 UTC (rev 9438)
@@ -2,8 +2,8 @@
-- Demo of multiple stream/window capability (requires Tk or Tcl-DP).
--- Maurice LeBrun
--- IFS, University of Texas at Austin
+-- Maurice LeBrun
+-- IFS, University of Texas at Austin
-- Copyright (C) 2008 Jerry Bauck
@@ -49,13 +49,13 @@
-- Plots several simple functions from other example programs.
--
-- This version sends the output of the first 4 plots (one page) to two
--- independent streams.
+-- independent streams.
------------------------------------------------------------------------------
procedure x14a is
- -- Select either TK or DP driver and use a small window
- -- Using DP results in a crash at the end due to some odd cleanup problems
- -- The geometry strings MUST be in writable memory
+ -- Select either TK or DP driver and use a small window
+ -- Using DP results in a crash at the end due to some odd cleanup problems
+ -- The geometry strings MUST be in writable memory
geometry_master : String := "500x410+100+200";
geometry_slave : String := "500x410+650+200";
driver : Unbounded_String;
@@ -68,6 +68,9 @@
mark1 : Integer_Array_1D(1 .. 1) := (Others => 1500);
fam : Boolean;
num, bmax : Integer;
+ xp0, yp0 : Long_Float;
+ xleng0, yleng0, xoff0, yoff0 : Integer;
+ valid_geometry : Boolean;
procedure plot1 is
xmin, xmax, ymin, ymax : Long_Float;
@@ -88,26 +91,26 @@
ys(i) := y(i * 10 + 3);
end loop;
- -- Set up the viewport and window using PLENV. The range in X is
- -- 0.0 to 6.0, and the range in Y is 0.0 to 30.0. The axes are
- -- scaled separately (just := 0), and we just draw a labelled
- -- box (axis := 0).
+ -- Set up the viewport and window using PLENV. The range in X is
+ -- 0.0 to 6.0, and the range in Y is 0.0 to 30.0. The axes are
+ -- scaled separately (just := 0), and we just draw a labelled
+ -- box (axis := 0).
plcol0(1);
plenv(xmin, xmax, ymin, ymax, 0, 0);
plcol0(6);
pllab("(x)", "(y)", "#frPLplot Example 1 - y=x#u2");
- -- Plot the data points
+ -- Plot the data points
plcol0(9);
plpoin(xs, ys, 9);
- -- Draw the line through the data
+ -- Draw the line through the data
plcol0(4);
plline(x, y);
plflush;
end plot1;
- -- ================================================================
+ -- ================================================================
procedure plot2 is
@@ -115,13 +118,13 @@
begin
-- Set up the viewport and window using PLENV. The range in X is -2.0 to
-- 10.0, and the range in Y is -0.4 to 2.0. The axes are scaled separately
- -- (just = 0), and we draw a box with axes (axis = 1).
+ -- (just = 0), and we draw a box with axes (axis = 1).
plcol0(1);
plenv(-2.0, 10.0, -0.4, 1.2, 0, 1);
plcol0(2);
pllab("(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function");
- -- Fill up the arrays
+ -- Fill up the arrays
for i in x'range loop
x(i) := (Long_Float(i) - 19.0) / 6.0;
y(i) := 1.0;
@@ -130,33 +133,33 @@
end if;
end loop;
- -- Draw the line
+ -- Draw the line
plcol0(3);
plline(x, y);
plflush;
end plot2;
- -- ================================================================
+ -- ================================================================
procedure plot3 is
x, y : Real_Vector(0 .. 100);
begin
-- For the final graph we wish to override the default tick intervals, and
- -- so do not use PLENV
+ -- so do not use PLENV
pladv(0);
-- Use standard viewport, and define X range from 0 to 360 degrees, Y range
- -- from -1.2 to 1.2.
+ -- from -1.2 to 1.2.
plvsta;
plwind(0.0, 360.0, -1.2, 1.2);
- -- Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y.
+ -- Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y.
plcol0(1);
plbox("bcnst", 60.0, 2, "bcnstv", 0.2, 2);
- -- Superimpose a dashed line grid, with 1.5 mm marks and spaces.
+ -- Superimpose a dashed line grid, with 1.5 mm marks and spaces.
plstyl(mark1, space1);
plcol0(2);
plbox("g", 30.0, 0, "g", 0.2, 0);
@@ -175,7 +178,7 @@
plflush;
end plot3;
- -- ================================================================
+ -- ================================================================
procedure plot4 is
@@ -188,7 +191,7 @@
y0(i) := sin(dtr * Long_Float(i));
end loop;
- -- Set up viewport and window, but do not draw box
+ -- Set up viewport and window, but do not draw box
plenv(-1.3, 1.3, -1.3, 1.3, 1, -2);
for i in 1 .. 10 loop
for j in x'range loop
@@ -196,7 +199,7 @@
y(j) := 0.1 * Long_Float(i) * y0(j);
end loop;
- -- Draw circles for polar grid
+ -- Draw circles for polar grid
plline(x, y);
end loop;
@@ -206,11 +209,11 @@
dx := cos(dtr * theta);
dy := sin(dtr * theta);
- -- Draw radial spokes for polar grid
+ -- Draw radial spokes for polar grid
pljoin(0.0, 0.0, dx, dy);
- -- Write labels for angle
- -- Slightly off zero to avoid floating point logic flips at 90 and 270 deg.
+ -- Write labels for angle
+ -- Slightly off zero to avoid floating point logic flips at 90 and 270 deg.
if dx >= -0.00001 then
plptex(dx, dy, dx, dy, -0.15, Trim(Integer'image(Integer(theta)), Left));
else
@@ -218,7 +221,7 @@
end if;
end loop;
- -- Draw the graph
+ -- Draw the graph
for i in x'range loop
r := sin(dtr * Long_Float(5 * i));
x(i) := x0(i) * r;
@@ -232,10 +235,10 @@
plflush;
end plot4;
- -- ================================================================
+ -- ================================================================
- -- Demonstration of contour plotting
+ -- Demonstration of contour plotting
procedure plot5 is
XPTS : constant Integer := 35;
YPTS : constant Integer := 46;
@@ -247,20 +250,20 @@
mark : Integer_Array_1D(1 .. 1) := (Others => 1500);
space : Integer_Array_1D(1 .. 1) := (Others => 1500);
z, w : Real_Matrix(0 .. XPTS -1, 0 .. YPTS - 1);
- clevel : Real_Vector(0 .. 10) :=
+ clevel : Real_Vector(0 .. 10) :=
(-1.0, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0);
procedure mypltr -- This spec is necessary to accommodate pragma Convention(C...).
- (x, y : Long_Float;
- tx, ty : out Long_Float;
+ (x, y : Long_Float;
+ tx, ty : out Long_Float;
pltr_data : PLpointer);
pragma Convention(Convention => C, Entity => mypltr);
procedure mypltr
- (x, y : Long_Float;
- tx, ty : out Long_Float;
+ (x, y : Long_Float;
+ tx, ty : out Long_Float;
pltr_data : PLpointer)
- is
+ is
begin
tx := tr(0) * x + tr(1) * y + tr(2);
ty := tr(3) * x + tr(4) * y + tr(5);
@@ -289,37 +292,50 @@
begin
- -- plplot initialization
- -- Parse and process command line arguments
+ -- plplot initialization
+ -- Parse and process command line arguments
plparseopts(PL_PARSE_FULL);
driver := To_Unbounded_String(plgdev);
- plgfam(fam, num, bmax);
+ plgfam(fam, num, bmax);
Put_Line("Demo of multiple output streams via the " & plgdev & " driver.");
Put_Line("Running with the second stream as slave to the first.");
New_Line;
- -- Set up first stream
- plsetopt("geometry", geometry_master);
+ -- If valid geometry specified on command line, use it for both streams.
+ plgpage(xp0, yp0, xleng0, yleng0, xoff0, yoff0);
+ valid_geometry := (xleng0 > 0 and yleng0 > 0);
+ -- Set up first stream
+ if valid_geometry then
+ plspage(xp0, yp0, xleng0, yleng0, xoff0, yoff0);
+ else
+ plsetopt("geometry", geometry_master);
+ end if;
+
plsdev(To_String(driver));
plssub(2, 2);
plinit;
- -- Start next stream
+ -- Start next stream
plsstrm(1);
- -- Turn off pause to make this a slave (must follow master)
- plsetopt("geometry", geometry_slave);
+ if valid_geometry then
+ plspage(xp0, yp0, xleng0, yleng0, xoff0, yoff0);
+ else
+ plsetopt("geometry", geometry_slave);
+ end if;
+
+ -- Turn off pause to make this a slave (must follow master)
plspause(False);
- plgfam(fam, num, bmax);
+ plgfam(fam, num, bmax);
plsetopt("fflen","2");
plsdev(To_String(driver));
plinit;
- -- Set up the data & plot
- -- Original case
+ -- Set up the data & plot
+ -- Original case
plsstrm(0);
xscale := 6.0;
@@ -328,19 +344,19 @@
yoff := 0.0;
plot1;
- -- Set up the data & plot
+ -- Set up the data & plot
xscale := 1.0;
yscale := 1.0e+6;
plot1;
- -- Set up the data & plot
+ -- Set up the data & plot
xscale := 1.0;
yscale := 1.0e-6;
digmax := 2;
plsyax(digmax, 0);
plot1;
- -- Set up the data & plot
+ -- Set up the data & plot
xscale := 1.0;
yscale := 0.0014;
yoff := 0.0185;
@@ -348,26 +364,26 @@
plsyax(digmax, 0);
plot1;
- -- To slave
- -- The pleop ensures the eop indicator gets lit.
+ -- To slave
+ -- The pleop ensures the eop indicator gets lit.
plsstrm(1);
plot4;
pleop;
- -- Back to master
+ -- Back to master
plsstrm(0);
plot2;
plot3;
- -- To slave
+ -- To slave
plsstrm(1);
plot5;
pleop;
- -- Back to master to wait for user to advance
+ -- Back to master to wait for user to advance
plsstrm(0);
pleop;
- -- Call plend to finish off.
+ -- Call plend to finish off.
plend;
end x14a;
Modified: trunk/examples/ada/xthick14a.adb.cmake
===================================================================
--- trunk/examples/ada/xthick14a.adb.cmake 2009-02-02 21:18:00 UTC (rev 9437)
+++ trunk/examples/ada/xthick14a.adb.cmake 2009-02-03 01:20:33 UTC (rev 9438)
@@ -68,6 +68,9 @@
mark1 : Integer_Array_1D(1 .. 1) := (Others => 1500);
fam : Boolean;
num, bmax : Integer;
+ xp0, yp0 : Long_Float;
+ xleng0, yleng0, xoff0, yoff0 : Integer;
+ valid_geometry : Boolean;
procedure plot1 is
xmin, xmax, ymin, ymax : Long_Float;
@@ -300,8 +303,16 @@
Put_Line("Running with the second stream as slave to the first.");
New_Line;
+ -- If valid geometry specified on command line, use it for both streams.
+ Get_Page_Parameters(xp0, yp0, xleng0, yleng0, xoff0, yoff0);
+ valid_geometry := (xleng0 > 0 and yleng0 > 0);
+
-- Set up first stream
- Set_Command_Line_Option("geometry", geometry_master);
+ if valid_geometry then
+ Set_Page_Parameters(xp0, yp0, xleng0, yleng0, xoff0, yoff0);
+ else
+ Set_Command_Line_Option("geometry", geometry_master);
+ end if;
Set_Device_Name(To_String(driver));
Set_Number_Of_Subpages(2, 2);
@@ -310,8 +321,13 @@
-- Start next stream
Set_Stream_Number(1);
+ if valid_geometry then
+ Set_Page_Parameters(xp0, yp0, xleng0, yleng0, xoff0, yoff0);
+ else
+ Set_Command_Line_Option("geometry", geometry_slave);
+ end if;
+
-- Turn off pause to make this a slave (must follow master)
- Set_Command_Line_Option("geometry", geometry_slave);
Set_Pause(False);
Set_Device_Name(To_String(driver));
Get_File_Family_Parameters(fam, num, bmax);
Modified: trunk/examples/c++/x14.cc
===================================================================
--- trunk/examples/c++/x14.cc 2009-02-02 21:18:00 UTC (rev 9437)
+++ trunk/examples/c++/x14.cc 2009-02-03 01:20:33 UTC (rev 9438)
@@ -99,6 +99,10 @@
const char geometry_master[] = "500x410+100+200";
const char geometry_slave[] = "500x410+650+200";
+ PLFLT xp0, yp0;
+ PLINT xleng0, yleng0, xoff0, yoff0;
+ int valid_geometry;
+
// plplot initialization
pls1 = new plstream();
@@ -113,9 +117,16 @@
driver << " driver." << endl;
cout << "Running with the second stream as slave to the first.\n" << endl;
+ //If valid geometry specified on command line, use it for both streams.
+ pls1->gpage(xp0, yp0, xleng0, yleng0, xoff0, yoff0);
+ valid_geometry = (xleng0 > 0 && yleng0 > 0);
+
// Set up first stream
- pls1->setopt("geometry", geometry_master);
+ if (valid_geometry)
+ pls1->spage(xp0, yp0, xleng0, yleng0, xoff0, yoff0);
+ else
+ pls1->setopt("geometry", geometry_master);
pls1->sdev(driver);
pls1->ssub(2, 2);
@@ -124,9 +135,13 @@
pls1->init();
pls2 = new plstream();
+
+ if (valid_geometry)
+ pls2->spage(xp0, yp0, xleng0, yleng0, xoff0, yoff0);
+ else
+ pls2->setopt("geometry", geometry_slave);
+
// Turn off pause to make this a slave (must follow master)
-
- pls2->setopt("geometry", geometry_slave);
pls2->spause(false);
pls2->sdev(driver);
pls2->sfam(fam,num,bmax);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-02-03 02:15:46
|
Revision: 9439
http://plplot.svn.sourceforge.net/plplot/?rev=9439&view=rev
Author: airwin
Date: 2009-02-03 02:12:56 +0000 (Tue, 03 Feb 2009)
Log Message:
-----------
Propagate x14 changes to f77 and f95.
Modified Paths:
--------------
trunk/examples/f77/x14f.fm4
trunk/examples/f95/x14f.f90
Modified: trunk/examples/f77/x14f.fm4
===================================================================
--- trunk/examples/f77/x14f.fm4 2009-02-03 01:20:33 UTC (rev 9438)
+++ trunk/examples/f77/x14f.fm4 2009-02-03 02:12:56 UTC (rev 9439)
@@ -28,8 +28,6 @@
implicit none
integer digmax
- integer xleng0 , yleng0 , xoff0 , yoff0
- integer xleng1 , xoff1 , yoff1
character*80 driver
character*15 geometry_master
@@ -46,16 +44,10 @@
integer lnblnk
integer PL_PARSE_FULL
parameter(PL_PARSE_FULL = 1)
+ real*8 xp0, yp0
+ integer xleng0, yleng0, xoff0, yoff0
+ logical valid_geometry
- xleng0 = 400
- yleng0 = 300
- xoff0 = 200
- yoff0 = 200
- xleng1 = 400
- xleng1 = 300
- xoff1 = 500
- yoff1 = 500
-
geometry_master = '500x410+100+200'
geometry_slave = '500x410+650+200'
@@ -74,9 +66,17 @@
C to stdout generated by second plinit below.
call flush(6)
+C If valid geometry specified on command line, use it for both streams.
+ call plgpage(xp0, yp0, xleng0, yleng0, xoff0, yoff0)
+ valid_geometry = (xleng0 .gt. 0 .and. yleng0 .gt. 0)
+
C Set up first stream
- call plsetopt( 'geometry', geometry_master)
+ if(valid_geometry) then
+ call plspage(xp0, yp0, xleng0, yleng0, xoff0, yoff0)
+ else
+ call plsetopt( 'geometry', geometry_master)
+ endif
call plsdev(driver)
call plssub(2, 2)
@@ -86,9 +86,14 @@
call plsstrm(1)
+ if(valid_geometry) then
+ call plspage(xp0, yp0, xleng0, yleng0, xoff0, yoff0)
+ else
+ call plsetopt( 'geometry', geometry_slave)
+ endif
+
C Turn off pause to make this a slave (must follow master)
- call plsetopt( 'geometry', geometry_slave)
call plspause(0)
call plsdev(driver)
call plsfam(fam,num,bmax)
Modified: trunk/examples/f95/x14f.f90
===================================================================
--- trunk/examples/f95/x14f.f90 2009-02-03 01:20:33 UTC (rev 9438)
+++ trunk/examples/f95/x14f.f90 2009-02-03 02:12:56 UTC (rev 9439)
@@ -29,8 +29,6 @@
implicit none
integer i, digmax
- integer xleng0 , yleng0 , xoff0 , yoff0
- integer xleng1 , yleng1 , xoff1 , yoff1
character*80 driver
character*15 geometry_master
@@ -43,16 +41,10 @@
real(kind=plflt) xscale, yscale, xoff, yoff
common /plotdat/ x, y, xs, ys, xscale, yscale, xoff, yoff
character*80 version
+ real(kind=plflt) xp0, yp0
+ integer xleng0, yleng0, xoff0, yoff0
+ logical valid_geometry
- xleng0 = 400
- yleng0 = 300
- xoff0 = 200
- yoff0 = 200
- xleng1 = 400
- xleng1 = 300
- xoff1 = 500
- yoff1 = 500
-
geometry_master = '500x410+100+200'
geometry_slave = '500x410+650+200'
@@ -71,9 +63,17 @@
! to stdout generated by second plinit below.
call flush(6)
+! If valid geometry specified on command line, use it for both streams.
+ call plgpage(xp0, yp0, xleng0, yleng0, xoff0, yoff0)
+ valid_geometry = (xleng0 .gt. 0 .and. yleng0 .gt. 0)
+
! Set up first stream
- call plsetopt( 'geometry', geometry_master)
+ if(valid_geometry) then
+ call plspage(xp0, yp0, xleng0, yleng0, xoff0, yoff0)
+ else
+ call plsetopt( 'geometry', geometry_master)
+ endif
call plsdev(driver)
call plssub(2, 2)
@@ -83,9 +83,14 @@
call plsstrm(1)
+ if(valid_geometry) then
+ call plspage(xp0, yp0, xleng0, yleng0, xoff0, yoff0)
+ else
+ call plsetopt( 'geometry', geometry_slave)
+ endif
+
! Turn off pause to make this a slave (must follow master)
- call plsetopt( 'geometry', geometry_slave)
call plspause(.false.)
call plsdev(driver)
call plsfam(fam,num,bmax)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-02-03 06:32:33
|
Revision: 9441
http://plplot.svn.sourceforge.net/plplot/?rev=9441&view=rev
Author: airwin
Date: 2009-02-03 06:32:28 +0000 (Tue, 03 Feb 2009)
Log Message:
-----------
Propagate x14 change to ocaml and perl/PDL.
Modified Paths:
--------------
trunk/examples/ocaml/x14.ml
trunk/examples/perl/x14.pl
Modified: trunk/examples/ocaml/x14.ml
===================================================================
--- trunk/examples/ocaml/x14.ml 2009-02-03 02:38:39 UTC (rev 9440)
+++ trunk/examples/ocaml/x14.ml 2009-02-03 06:32:28 UTC (rev 9441)
@@ -229,13 +229,20 @@
let driver = plgdev () in
let fam, num, bmax = plgfam () in
+
+ (* If valid geometry specified on command line, use it for both streams. *)
+ let xp0, yp0, xleng0, yleng0, xoff0, yoff0 = plgpage () in
+ let valid_geometry = ( xleng0 > 0 && yleng0 > 0 ) in
printf "Demo of multiple output streams via the %s driver.\n" driver;
printf "Running with the second stream as slave to the first.\n";
printf "\n";
(* Set up first stream *)
- ignore (plsetopt "geometry" geometry_master);
+ if valid_geometry then
+ plspage xp0 yp0 xleng0 yleng0 xoff0 yoff0
+ else
+ ignore (plsetopt "geometry" geometry_master);
plsdev driver;
plssub 2 2;
@@ -244,8 +251,12 @@
(* Start next stream *)
plsstrm 1;
+ if valid_geometry then
+ plspage xp0 yp0 xleng0 yleng0 xoff0 yoff0
+ else
+ ignore (plsetopt "geometry" geometry_slave);
+
(* Turn off pause to make this a slave (must follow master) *)
- ignore (plsetopt "geometry" geometry_slave);
plspause false;
plsdev driver;
plsfam fam num bmax;
Modified: trunk/examples/perl/x14.pl
===================================================================
--- trunk/examples/perl/x14.pl 2009-02-03 02:38:39 UTC (rev 9440)
+++ trunk/examples/perl/x14.pl 2009-02-03 06:32:28 UTC (rev 9441)
@@ -63,9 +63,24 @@
. "Running with the second stream as slave to the first.\n"
. "\n");
+ # If valid geometry specified on command line, use it for both streams.
+ my ($xp0, $yp0, $xleng0, $yleng0, $xoff0, $yoff0) = plgpage ();
+ printf("%s %i, %i\n", "xleng0, yleng0 = ", $xleng0, $yleng0);
+ my $valid_geometry;
+ if ($xleng0 > 0 && $yleng0 > 0) {
+ $valid_geometry = 1;
+ } else {
+ $valid_geometry = 0;
+ }
+ printf("%s %i\n", "valid_geometry = ", $valid_geometry);
+
# Set up first stream
- plsetopt ("geometry", $geometry_master);
+ if ($valid_geometry) {
+ plspage ($xp0, $yp0, $xleng0, $yleng0, $xoff0, $yoff0);
+ } else {
+ plsetopt ("geometry", $geometry_master);
+ }
plsdev ($driver);
plssub (2, 2);
@@ -75,9 +90,14 @@
plsstrm (1);
+ if ($valid_geometry) {
+ plspage ($xp0, $yp0, $xleng0, $yleng0, $xoff0, $yoff0);
+ } else {
+ plsetopt ("geometry", $geometry_slave);
+ }
+
# Turn off pause to make this a slave (must follow master)
- plsetopt ("geometry", $geometry_slave);
plspause (0);
plsdev ($driver);
plsfam ($fam, $num, $bmax);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|