Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## [Plplot-cvs] SF.net SVN: plplot:[11441] trunk/examples/python/xw27.py

 [Plplot-cvs] SF.net SVN: plplot:[11441] trunk/examples/python/xw27.py From: - 2011-01-05 08:26:48 ```Revision: 11441 http://plplot.svn.sourceforge.net/plplot/?rev=11441&view=rev Author: airwin Date: 2011-01-05 08:26:42 +0000 (Wed, 05 Jan 2011) Log Message: ----------- Add additional 9 fill pages to make results from the 27th python example consistent with those from its C counterpart. Modified Paths: -------------- trunk/examples/python/xw27.py Modified: trunk/examples/python/xw27.py =================================================================== --- trunk/examples/python/xw27.py 2011-01-05 08:16:26 UTC (rev 11440) +++ trunk/examples/python/xw27.py 2011-01-05 08:26:42 UTC (rev 11441) @@ -55,7 +55,7 @@ for i in range(9) : pladv(0) plvpor( 0.0, 1.0, 0.0, 1.0 ) - spiro( params[i] ) + spiro( params[i], 0 ) pladv(0) plssub(1, 1) # One window per curve @@ -63,10 +63,19 @@ for i in range(9): pladv(0) plvpor( 0.0, 1.0, 0.0, 1.0 ) - spiro( params[i] ) + spiro( params[i], 0 ) + # Fill the curves. + pladv(0) + plssub(1, 1) # One window per curve -def spiro(params): + for i in range(9): + pladv(0) + plvpor( 0.0, 1.0, 0.0, 1.0 ) + spiro( params[i], 1 ) + + +def spiro(params, fill): # Fill the coordinates NPNT = 20000 @@ -111,7 +120,9 @@ plwind( xmin, xmax, ymin, ymax ) plcol0(1) - plline( xcoord, ycoord ) + if fill: + plfill( xcoord, ycoord ) + else: + plline( xcoord, ycoord ) - main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```

 [Plplot-cvs] SF.net SVN: plplot:[8641] trunk/examples/python/xw27.py From: - 2008-08-13 16:02:10 ```Revision: 8641 http://plplot.svn.sourceforge.net/plplot/?rev=8641&view=rev Author: andrewross Date: 2008-08-13 16:02:19 +0000 (Wed, 13 Aug 2008) Log Message: ----------- Remove unnecessary semicolons from python example 27. Modified Paths: -------------- trunk/examples/python/xw27.py Modified: trunk/examples/python/xw27.py =================================================================== --- trunk/examples/python/xw27.py 2008-08-13 13:25:33 UTC (rev 8640) +++ trunk/examples/python/xw27.py 2008-08-13 16:02:19 UTC (rev 8641) @@ -1,4 +1,4 @@ -# \$Id:\$ +# \$Id\$ # # Copyright (C) 2007 Arjen Markus # Copyright (C) 2008 Andrew Ross @@ -46,71 +46,71 @@ # Illustrate the construction of a cycloid # TODO - #cycloid(); + #cycloid() # Loop over the various curves - # First an overview, then all curves one by one - plssub(3, 3) ; # Three by three window + # First an overview, then all curves one by one + plssub(3, 3) # Three by three window for i in range(9) : - pladv(0) ; - plvpor( 0.0, 1.0, 0.0, 1.0 ) ; - spiro( params[i] ) ; + pladv(0) + plvpor( 0.0, 1.0, 0.0, 1.0 ) + spiro( params[i] ) - pladv(0) ; - plssub(1, 1) ; # One window per curve + pladv(0) + plssub(1, 1) # One window per curve for i in range(9): - pladv(0) ; - plvpor( 0.0, 1.0, 0.0, 1.0 ) ; - spiro( params[i] ) ; + pladv(0) + plvpor( 0.0, 1.0, 0.0, 1.0 ) + spiro( params[i] ) def spiro(params): # Fill the coordinates NPNT = 20000 - windings = int(params[3]); - steps = int(NPNT/windings) ; - dphi = 8.0*arccos(-1.0)/steps ; + windings = int(params[3]) + steps = int(NPNT/windings) + dphi = 8.0*arccos(-1.0)/steps - xmin = 0.0 ; # This initialisation is safe! - xmax = 0.0 ; - ymin = 0.0 ; - ymax = 0.0 ; + xmin = 0.0 # This initialisation is safe! + xmax = 0.0 + ymin = 0.0 + ymax = 0.0 - xcoord = zeros(windings*steps+1); - ycoord = zeros(windings*steps+1); + xcoord = zeros(windings*steps+1) + ycoord = zeros(windings*steps+1) for i in range(windings*steps+1) : - phi = i * dphi ; - phiw = (params[0]-params[1])/params[1]*phi ; - xcoord[i] = (params[0]-params[1])*cos(phi) + params[2]*cos(phiw) ; - ycoord[i] = (params[0]-params[1])*sin(phi) - params[2]*sin(phiw) ; + phi = i * dphi + phiw = (params[0]-params[1])/params[1]*phi + xcoord[i] = (params[0]-params[1])*cos(phi) + params[2]*cos(phiw) + ycoord[i] = (params[0]-params[1])*sin(phi) - params[2]*sin(phiw) if ( xmin > xcoord[i] ) : - xmin = xcoord[i] ; + xmin = xcoord[i] if ( xmax < xcoord[i] ) : - xmax = xcoord[i] ; + xmax = xcoord[i] if ( ymin > ycoord[i] ) : - ymin = ycoord[i] ; + ymin = ycoord[i] if ( ymax < ycoord[i] ) : - ymax = ycoord[i] ; + ymax = ycoord[i] if ( xmax-xmin > ymax-ymin ) : - scale = xmax - xmin ; + scale = xmax - xmin else : - scale = ymax - ymin ; + scale = ymax - ymin - xmin = - 0.65 * scale ; - xmax = 0.65 * scale ; - ymin = - 0.65 * scale ; - ymax = 0.65 * scale ; + xmin = - 0.65 * scale + xmax = 0.65 * scale + ymin = - 0.65 * scale + ymax = 0.65 * scale - plwind( xmin, xmax, ymin, ymax ) ; + plwind( xmin, xmax, ymin, ymax ) - plcol0(1); - plline( xcoord, ycoord ) ; + plcol0(1) + plline( xcoord, ycoord ) main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Plplot-cvs] SF.net SVN: plplot:[9230] trunk/examples/python/xw27.py From: - 2008-12-25 00:58:10 ```Revision: 9230 http://plplot.svn.sourceforge.net/plplot/?rev=9230&view=rev Author: airwin Date: 2008-12-25 00:58:07 +0000 (Thu, 25 Dec 2008) Log Message: ----------- Tweak to get Numeric result to be the same as numpy result (and also C result). Modified Paths: -------------- trunk/examples/python/xw27.py Modified: trunk/examples/python/xw27.py =================================================================== --- trunk/examples/python/xw27.py 2008-12-25 00:48:50 UTC (rev 9229) +++ trunk/examples/python/xw27.py 2008-12-25 00:58:07 UTC (rev 9230) @@ -79,8 +79,9 @@ ymin = 0.0 ymax = 0.0 - xcoord = zeros(windings*steps+1) - ycoord = zeros(windings*steps+1) + # Add 0. to convert to real array for Numeric. numpy does not require this. + xcoord = 0. + zeros(windings*steps+1) + ycoord = 0. + zeros(windings*steps+1) for i in range(windings*steps+1) : phi = i * dphi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Plplot-cvs] SF.net SVN: plplot:[11441] trunk/examples/python/xw27.py From: - 2011-01-05 08:26:48 ```Revision: 11441 http://plplot.svn.sourceforge.net/plplot/?rev=11441&view=rev Author: airwin Date: 2011-01-05 08:26:42 +0000 (Wed, 05 Jan 2011) Log Message: ----------- Add additional 9 fill pages to make results from the 27th python example consistent with those from its C counterpart. Modified Paths: -------------- trunk/examples/python/xw27.py Modified: trunk/examples/python/xw27.py =================================================================== --- trunk/examples/python/xw27.py 2011-01-05 08:16:26 UTC (rev 11440) +++ trunk/examples/python/xw27.py 2011-01-05 08:26:42 UTC (rev 11441) @@ -55,7 +55,7 @@ for i in range(9) : pladv(0) plvpor( 0.0, 1.0, 0.0, 1.0 ) - spiro( params[i] ) + spiro( params[i], 0 ) pladv(0) plssub(1, 1) # One window per curve @@ -63,10 +63,19 @@ for i in range(9): pladv(0) plvpor( 0.0, 1.0, 0.0, 1.0 ) - spiro( params[i] ) + spiro( params[i], 0 ) + # Fill the curves. + pladv(0) + plssub(1, 1) # One window per curve -def spiro(params): + for i in range(9): + pladv(0) + plvpor( 0.0, 1.0, 0.0, 1.0 ) + spiro( params[i], 1 ) + + +def spiro(params, fill): # Fill the coordinates NPNT = 20000 @@ -111,7 +120,9 @@ plwind( xmin, xmax, ymin, ymax ) plcol0(1) - plline( xcoord, ycoord ) + if fill: + plfill( xcoord, ycoord ) + else: + plline( xcoord, ycoord ) - main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```