|
From: <and...@us...> - 2010-05-17 09:54:39
|
Revision: 10998
http://plplot.svn.sourceforge.net/plplot/?rev=10998&view=rev
Author: andrewross
Date: 2010-05-17 09:54:32 +0000 (Mon, 17 May 2010)
Log Message:
-----------
Update python versions of examples 6 and 7 consistent with changes to C version.
Modified Paths:
--------------
trunk/examples/python/xw06.py
trunk/examples/python/xw07.py
Modified: trunk/examples/python/xw06.py
===================================================================
--- trunk/examples/python/xw06.py 2010-05-14 21:19:09 UTC (rev 10997)
+++ trunk/examples/python/xw06.py 2010-05-17 09:54:32 UTC (rev 10998)
@@ -29,44 +29,59 @@
def main():
- pladv(0)
+ for kind_font in range(2):
- # Set up viewport and window
+ plfontld( kind_font )
- plcol0(2)
- plvpor(0.1, 1.0, 0.1, 0.9)
- plwind(0.0, 1.0, 0.0, 1.3)
+ if kind_font == 0 :
+ maxfont = 1
+ else :
+ maxfont = 4
- # Draw the grid using plbox
+ for font in range(maxfont):
+ plfont( font + 1 )
- plbox("bcg", 0.1, 0, "bcg", 0.1, 0)
+ pladv(0)
- # Write the digits below the frame
+ # Set up viewport and window
- plcol0(15)
- for i in range(10):
- plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, `i`)
+ plcol0(2)
+ plvpor(0.1, 1.0, 0.1, 0.9)
+ plwind(0.0, 1.0, 0.0, 1.3)
- k = 0
- for i in range(13):
+ # Draw the grid using plbox
- # Write the digits to the left of the frame
+ plbox("bcg", 0.1, 0, "bcg", 0.1, 0)
- plmtex("lv", 1.0, (1.0 - (2 * i + 1) / 26.0), 1.0, `10 * i`)
+ # Write the digits below the frame
- for j in range(10):
- x = 0.1 * j + 0.05
- y = 1.25 - 0.1 * i
+ plcol0(15)
+ for i in range(10):
+ plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, `i`)
- # Display the symbol (plpoin expects that x
- # and y are arrays so pass lists)
+ k = 0
+ for i in range(13):
- if k < 128:
- plpoin([x], [y], k)
- k = k + 1
+ # Write the digits to the left of the frame
- plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols")
+ plmtex("lv", 1.0, (1.0 - (2 * i + 1) / 26.0), 1.0, `10 * i`)
+
+ for j in range(10):
+ x = 0.1 * j + 0.05
+ y = 1.25 - 0.1 * i
+
+ # Display the symbol (plpoin expects that x
+ # and y are arrays so pass lists)
+ if k < 128:
+ plpoin([x], [y], k)
+ k = k + 1
+
+ if kind_font == 0 :
+ plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (compact)")
+ else :
+ plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (extended)")
+
# Restore defaults
#plcol0(1)
Modified: trunk/examples/python/xw07.py
===================================================================
--- trunk/examples/python/xw07.py 2010-05-14 21:19:09 UTC (rev 10997)
+++ trunk/examples/python/xw07.py 2010-05-17 09:54:32 UTC (rev 10998)
@@ -29,10 +29,15 @@
def main():
- base = [0, 200, 500, 600, 700, 800, 900, 2000, 2100,
- 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900]
+ base = [0, 100, 0, 100, 200, 500, 600, 700, 800, 900, 2000,
+ 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900]
- for l in range(17):
+ plfontld( 0 )
+
+ for l in range(20):
+ if l == 2:
+ plfontld( 1 )
+
pladv(0)
# Set up viewport and window
@@ -67,9 +72,11 @@
plsym(x, y, base[l] + k)
k = k + 1
+ if l < 2 :
+ plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (compact)")
+ else :
+ plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (extended)")
- plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols")
-
# Restore defaults
#plcol0(1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|