|
From: <and...@us...> - 2008-12-16 15:11:36
|
Revision: 9136
http://plplot.svn.sourceforge.net/plplot/?rev=9136&view=rev
Author: andrewross
Date: 2008-12-16 15:11:32 +0000 (Tue, 16 Dec 2008)
Log Message:
-----------
Update python examples 1, 3, 13 and 29 consistent with recent C
example changes. Note example 31 is not yet implemented. Also note
that example 1 does not work correctly with pythondemos.py since it
now uses plstar rather than plinit and plssub.
Modified Paths:
--------------
trunk/examples/python/x01
trunk/examples/python/x03
trunk/examples/python/xw01.py
trunk/examples/python/xw13.py
trunk/examples/python/xw29.py
Modified: trunk/examples/python/x01
===================================================================
--- trunk/examples/python/x01 2008-12-16 14:53:20 UTC (rev 9135)
+++ trunk/examples/python/x01 2008-12-16 15:11:32 UTC (rev 9136)
@@ -33,7 +33,8 @@
print "PLplot library version: " + version
# Initialize plplot
-plinit()
+# Do plots on 4 subwindows of the first page
+plstar(2,2)
import xw01
Modified: trunk/examples/python/x03
===================================================================
--- trunk/examples/python/x03 2008-12-16 14:53:20 UTC (rev 9135)
+++ trunk/examples/python/x03 2008-12-16 15:11:32 UTC (rev 9136)
@@ -30,6 +30,10 @@
# Parse and process command line arguments
plparseopts(sys.argv, PL_PARSE_FULL)
+# Set orientation to landscape - note not all device drivers
+# support this, in particular most interactive drivers do not
+plsori(1)
+
# Initialize plplot
plinit()
Modified: trunk/examples/python/xw01.py
===================================================================
--- trunk/examples/python/xw01.py 2008-12-16 14:53:20 UTC (rev 9135)
+++ trunk/examples/python/xw01.py 2008-12-16 15:11:32 UTC (rev 9136)
@@ -19,9 +19,8 @@
# essentially a nop. However, for the case when other examples are run
# first, this call to pladv is absolutely essential to finish the
# preceding page.
- pladv(0)
- # Do plots on 4 subwindows of the first page
- plssub(2, 2)
+ # This is not needed if we use plstar?
+ #pladv(0)
# Do a plot with one range of data
Modified: trunk/examples/python/xw13.py
===================================================================
--- trunk/examples/python/xw13.py 2008-12-16 14:53:20 UTC (rev 9135)
+++ trunk/examples/python/xw13.py 2008-12-16 15:11:32 UTC (rev 9136)
@@ -12,7 +12,12 @@
def main():
- plenv(0., 10., 0., 10., 1, -2)
+ pladv(0)
+ # Ensure window has aspect ratio of one so circle is
+ # plotted as a circle.
+ plvasp(1.0)
+ plwind(0., 10., 0., 10.)
+ #plenv(0., 10., 0., 10., 1, -2)
plcol0(2)
#if these don't add up to 100, the logic adds to the last to make
#up the balance.
Modified: trunk/examples/python/xw29.py
===================================================================
--- trunk/examples/python/xw29.py 2008-12-16 14:53:20 UTC (rev 9135)
+++ trunk/examples/python/xw29.py 2008-12-16 15:11:32 UTC (rev 9136)
@@ -39,6 +39,8 @@
#--------------------------------------------------------------------------
def main():
+
+ plsesc('@')
plot1()
@@ -51,7 +53,7 @@
def plot1():
# Data points every 10 minutes for 1 day
- npts = 145;
+ npts = 73;
xmin = 0.0;
xmax = 60.0*60.0*24.0; # Number of seconds in a day
@@ -60,9 +62,16 @@
x = xmax*arange(npts)/float(npts)
y = 15.0 - 5.0*cos(2*pi*x/xmax)
+ xerr1 = x-60.0*5.0
+ xerr2 = x+60.0*5.0
+ yerr1 = y-0.1
+ yerr2 = y+0.1
pladv(0)
+ plsmaj(0.0,0.5)
+ plsmin(0.0,0.5)
+
plvsta()
plwind(xmin, xmax, ymin, ymax)
@@ -73,12 +82,18 @@
plbox("bcnstd", 3.0*60*60, 3, "bcnstv", 1, 5)
plcol0(3)
- pllab("Time (hours:mins)", "Temperature (degC)", "#frPLplot Example 29 - Daily temperature")
+ pllab("Time (hours:mins)", "Temperature (degC)", "@frPLplot Example 29 - Daily temperature")
plcol0(4)
plline(x, y)
+ plcol0(2)
+ plerrx(xerr1,xerr2,y)
+ plcol0(3)
+ plerry(x,yerr1,yerr2)
+ plsmin(0.0,1.0)
+ plsmaj(0.0,1.0)
# Plot the number of hours of daylight as a function of day for a year
def plot2():
@@ -104,16 +119,18 @@
plcol0(1)
# Set time format to be abbreviated month name followed by day of month
pltimefmt("%b %d")
+ plprec(1,1)
plenv(xmin, xmax, ymin, ymax, 0, 40)
plcol0(3)
- pllab("Date", "Hours of daylight", "#frPLplot Example 29 - Hours of daylight at 51.5N")
+ pllab("Date", "Hours of daylight", "@frPLplot Example 29 - Hours of daylight at 51.5N")
plcol0(4)
plline(x, y)
+ plprec(0,0)
def plot3():
@@ -146,10 +163,11 @@
plbox("bcnstd", 14*24.0*60.0*60.0,14, "bcnstv", 1, 4)
plcol0(3)
- pllab("Date", "Hours of television watched", "#frPLplot Example 29 - Hours of television watched in Dec 2005 / Jan 2006")
+ pllab("Date", "Hours of television watched", "@frPLplot Example 29 - Hours of television watched in Dec 2005 / Jan 2006")
plcol0(4)
+ plssym(0.0,0.5)
plpoin(x, y, 2)
plline(x, y)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|