From: <and...@us...> - 2008-12-16 15:53:40
|
Revision: 9137 http://plplot.svn.sourceforge.net/plplot/?rev=9137&view=rev Author: andrewross Date: 2008-12-16 15:53:35 +0000 (Tue, 16 Dec 2008) Log Message: ----------- Update tcl examples to reflect recent changes in the C examples. Note example 31 is not yet implemented. Also tcldemos.tcl will not produce identical results for example 1 and 3 as example 1 uses plstar and example 3 has a call to plsori before plinit is called. Modified Paths: -------------- trunk/examples/tcl/x01 trunk/examples/tcl/x01.tcl trunk/examples/tcl/x03 trunk/examples/tcl/x13.tcl trunk/examples/tcl/x29.tcl Modified: trunk/examples/tcl/x01 =================================================================== --- trunk/examples/tcl/x01 2008-12-16 15:11:32 UTC (rev 9136) +++ trunk/examples/tcl/x01 2008-12-16 15:53:35 UTC (rev 9137) @@ -14,6 +14,6 @@ source x01.tcl -plinit +plstar 2 2 x01 plend Modified: trunk/examples/tcl/x01.tcl =================================================================== --- trunk/examples/tcl/x01.tcl 2008-12-16 15:11:32 UTC (rev 9136) +++ trunk/examples/tcl/x01.tcl 2008-12-16 15:53:35 UTC (rev 9137) @@ -10,8 +10,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. - $w cmd pladv 0 - $w cmd plssub 2 2 + #$w cmd pladv 0 + #$w cmd plssub 2 2 # First plot Modified: trunk/examples/tcl/x03 =================================================================== --- trunk/examples/tcl/x03 2008-12-16 15:11:32 UTC (rev 9136) +++ trunk/examples/tcl/x03 2008-12-16 15:53:35 UTC (rev 9137) @@ -14,6 +14,7 @@ source x03.tcl +plsori 1 plinit x03 plend Modified: trunk/examples/tcl/x13.tcl =================================================================== --- trunk/examples/tcl/x13.tcl 2008-12-16 15:11:32 UTC (rev 9136) +++ trunk/examples/tcl/x13.tcl 2008-12-16 15:53:35 UTC (rev 9137) @@ -20,7 +20,10 @@ matrix y f 500 matrix per f 5 = {10., 32., 12., 30., 16.} - $w cmd plenv 0. 10. 0. 10. 1 -2 + $w cmd pladv 0 + $w cmd plvasp 1. + $w cmd plwind 0. 10. 0. 10. + # $w cmd plenv 0. 10. 0. 10. 1 -2 $w cmd plcol0 2 set theta0 0.; Modified: trunk/examples/tcl/x29.tcl =================================================================== --- trunk/examples/tcl/x29.tcl 2008-12-16 15:11:32 UTC (rev 9136) +++ trunk/examples/tcl/x29.tcl 2008-12-16 15:53:35 UTC (rev 9137) @@ -1,4 +1,4 @@ -# $Id:$ +# $Id$ # # Sample plots using date / time formatting for axes # @@ -35,6 +35,8 @@ proc x29 {{w loopback}} { + $w cmd plsesc "@" + x29_plot1 $w x29_plot2 $w @@ -49,10 +51,14 @@ set pi 3.14159265358979323846 # Data points every 10 minutes for 1 day - set npts 145 + set npts 73 matrix x f $npts matrix y f $npts + matrix xerr1 f $npts + matrix xerr2 f $npts + matrix yerr1 f $npts + matrix yerr2 f $npts set xmin 0 # Number of seconds in a day @@ -61,12 +67,21 @@ set ymax 20.0 for {set i 0} {$i<$npts} {incr i} { - x $i = [expr {$xmax*double($i)/double($npts)}] - y $i = [expr {15.0 - 5.0*cos( 2*$pi*double($i)/double($npts))}] + set xx [expr {$xmax*double($i)/double($npts)}] + set yy [expr {15.0 - 5.0*cos( 2*$pi*double($i)/double($npts))}] + x $i = $xx + y $i = $yy + xerr1 $i = [expr {$xx - 60.0*5.0}] + xerr2 $i = [expr {$xx + 60.0*5.0}] + yerr1 $i = [expr {$yy - 0.1}] + yerr2 $i = [expr {$yy + 0.1}] } $w cmd pladv 0 + $w cmd plsmaj 0.0 0.5 + $w cmd plsmin 0.0 0.5 + $w cmd plvsta $w cmd plwind $xmin $xmax $ymin $ymax @@ -78,11 +93,18 @@ $w cmd plcol0 3 $w cmd pllab "Time (hours:mins)" "Temperature (degC)" \ - "#frPLplot Example 29 - Daily temperature" + "@frPLplot Example 29 - Daily temperature" $w cmd plcol0 4 $w cmd plline $npts x y + $w cmd plcol0 2 + $w cmd plerrx $npts xerr1 xerr2 y + $w cmd plcol0 3 + $w cmd plerry $npts x yerr1 yerr2 + + $w cmd plsmaj 0.0 1.0 + $w cmd plsmin 0.0 1.0 } # Plot the number of hours of daylight as a function of day for a year @@ -119,17 +141,19 @@ $w cmd plcol0 1 # Set time format to be abbreviated month name followed by day of month $w cmd pltimefmt "%b %d" + $w cmd plprec 1 1 $w cmd plenv $xmin $xmax $ymin $ymax 0 40 $w cmd plcol0 3 $w cmd pllab "Date" "Hours of daylight" \ - "#frPLplot Example 29 - Hours of daylight at 51.5N" + "@frPLplot Example 29 - Hours of daylight at 51.5N" $w cmd plcol0 4 $w cmd plline $npts x y - + + $w cmd plprec 0 0 } proc x29_plot3 {{w loopback}} { @@ -174,10 +198,11 @@ $w cmd plcol0 3 $w cmd pllab "Date" "Hours of television watched" \ - "#frPLplot Example 29 - Hours of television watched in Dec 2005 / Jan 2006" + "@frPLplot Example 29 - Hours of television watched in Dec 2005 / Jan 2006" $w cmd plcol0 4 + $w cmd plssym 0.0 0.5 $w cmd plpoin $npts x y 2 $w cmd plline $npts x y This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |