From: <ai...@us...> - 2008-12-16 22:55:25
|
Revision: 9152 http://plplot.svn.sourceforge.net/plplot/?rev=9152&view=rev Author: airwin Date: 2008-12-16 21:30:00 +0000 (Tue, 16 Dec 2008) Log Message: ----------- Initial commit of example 31 for python. x31 implements the pre-plinit tests and is completed. xw31.py just makes the plot and does none of the post-plinit tests yet which I will soon be implementing. Modified Paths: -------------- trunk/examples/python/CMakeLists.txt trunk/plplot_test/test_python.sh.in Added Paths: ----------- trunk/examples/python/x31 trunk/examples/python/xw31.py Modified: trunk/examples/python/CMakeLists.txt =================================================================== --- trunk/examples/python/CMakeLists.txt 2008-12-16 20:28:20 UTC (rev 9151) +++ trunk/examples/python/CMakeLists.txt 2008-12-16 21:30:00 UTC (rev 9152) @@ -48,6 +48,7 @@ "28" "29" "30" +"31" ) set(python_SCRIPTS) Added: trunk/examples/python/x31 =================================================================== --- trunk/examples/python/x31 (rev 0) +++ trunk/examples/python/x31 2008-12-16 21:30:00 UTC (rev 9152) @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +# Copyright (C) 2004 Alan W. Irwin +# Copyright (C) 2004 Andrew Ross +# +# 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 + + +# Run all python plplot examples non-interactively. + +# Append to effective python path so that can find plplot modules. +from plplot_python_start import * + +import sys +from plplot import * + +# Parse and process command line arguments +plparseopts(sys.argv, PL_PARSE_FULL) + +# Test setting / getting page size. +(xp, yp, xleng, yleng, xoff, yoff) = plgpage() +xp2 = xp*0.9 +yp2 = yp*0.9 +xleng2 = int(xleng*0.9) +yleng2 = int(yleng*0.9) +plspage(xp2, yp2, xleng2, yleng2, xoff, yoff) +(xp, yp, xleng, yleng, xoff, yoff) = plgpage() +if xp != xp2*1.1 || yp != yp2 || xleng != xleng2 || yleng != yleng2: + sys.stderr.write("plgpage test failed\n") + plend() + sys.exit(1) + + +# Initialize plplot +plinit() + +import xw31 + +# Terminate plplot +plend() + Property changes on: trunk/examples/python/x31 ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/examples/python/xw31.py =================================================================== --- trunk/examples/python/xw31.py (rev 0) +++ trunk/examples/python/xw31.py 2008-12-16 21:30:00 UTC (rev 9152) @@ -0,0 +1,40 @@ +# $Id$ + +# Copyright (C) 2008 Alan W. Irwin + +# Set/get tester. +# +# 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 +# +from plplot_py_demos import * + +def main(): + + pladv(0) + plvpor(0.0, 1.0, 0.0, 1.0) + plwind(0.0, 1.0, 0.0, 1.0) + plbox("bc", 0.0, 0, "bc", 0.0, 0) + + plsvpa(50.0, 150.0, 50.0, 100.0) + plwind(0.0, 1.0, 0.0, 1.0) + plbox("bc", 0.0, 0, "bc", 0.0, 0) + plptex(0.5, 0.5, 1.0, 0.0, 0.5, "BOX at (50,150,50,100)") + + # Restore defaults + #plcol0(1) + +main() Property changes on: trunk/examples/python/xw31.py ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/plplot_test/test_python.sh.in =================================================================== --- trunk/plplot_test/test_python.sh.in 2008-12-16 20:28:20 UTC (rev 9151) +++ trunk/plplot_test/test_python.sh.in 2008-12-16 21:30:00 UTC (rev 9152) @@ -32,7 +32,7 @@ # Skip 21 if using Numeric - it doesn't work # For 24 you need special fonts installed to get good result. for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 \ -20 22 23 24 25 26 27 28 29 30 @NUMPY_EXAMPLES@ ; do +20 22 23 24 25 26 27 28 29 30 31 @NUMPY_EXAMPLES@ ; do if [ "$verbose_test" ]; then echo "x${index}" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |