From: <ai...@us...> - 2008-09-30 18:10:54
|
Revision: 8839 http://plplot.svn.sourceforge.net/plplot/?rev=8839&view=rev Author: airwin Date: 2008-09-30 18:10:24 +0000 (Tue, 30 Sep 2008) Log Message: ----------- Update example 20 for all non-C languages to follow recent change (removal of all but one pladv command) to x20c.c. The compare test showed all these examples produced the same postscript results as the C example with the exception of perl (no plimage defined there so cannot test), and tcl (rounding errors make lots of difference there, but the length of the file is the same so I infer the paging is done correctly for that binding). Modified Paths: -------------- trunk/bindings/octave/demos/x20c.m trunk/examples/ada/x20a.adb.cmake trunk/examples/ada/xthick20a.adb.cmake trunk/examples/c++/x20.cc trunk/examples/f77/x20f.fm4 trunk/examples/f95/x20f.f90 trunk/examples/java/x20.java trunk/examples/ocaml/x20.ml trunk/examples/perl/x20.pl trunk/examples/python/xw20.py trunk/examples/tcl/x20.tcl Modified: trunk/bindings/octave/demos/x20c.m =================================================================== --- trunk/bindings/octave/demos/x20c.m 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/bindings/octave/demos/x20c.m 2008-09-30 18:10:24 UTC (rev 8839) @@ -48,8 +48,6 @@ pllab("...around a blue square."," ","A red border should appear..."); pplimage(z, 1.0, xdim, 1.0, ydim, 0.0, 0.0, 1.0, xdim, 1.0, ydim); - - pladv(0); endif ## sombrero-like demo @@ -75,7 +73,6 @@ if (exist("f_name","var")) save_plot(f_name); endif - pladv(0); endif ## read Lena image @@ -138,12 +135,10 @@ pplimage(img, 1.0, width, 1.0, height, 0.0, 0.0, xi, xe, ye, yi); plspause(1); - pladv(0); ## zoom in selection plenv(xi, xe, ye, yi, 1, -1); pplimage(img, 1.0, width, 1.0, height, 0.0, 0.0, xi, xe, ye, yi); - pladv(0); endif ## Base the dynamic range on the image contents. @@ -176,7 +171,6 @@ yg = repmat([0:height],width+1,1); xg = x0 + (x0-xg).*(1-stretch*cos((yg-y0)/dy*pi*0.5)); plimagefr2(img, 0., width, 0., height, 0., 0., img_min, img_max, xg, yg); - pladv(0); plend1; endfunction Modified: trunk/examples/ada/x20a.adb.cmake =================================================================== --- trunk/examples/ada/x20a.adb.cmake 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/ada/x20a.adb.cmake 2008-09-30 18:10:24 UTC (rev 8839) @@ -289,8 +289,6 @@ plimage(z, 1.0, Long_Float(XDIM), 1.0, Long_Float(YDIM), 0.0, 0.0, 1.0, Long_Float(XDIM), 1.0, Long_Float(YDIM)); - - pladv(0); end if; -- sombrero-like demo @@ -326,8 +324,6 @@ save_plot(f_name(1 .. f_name_length)); end if; end if; - - pladv(0); end if; -- Read the Lena image. @@ -398,12 +394,10 @@ plimage(img_f, 1.0, Long_Float(width), 1.0, Long_Float(height), 0.0, 0.0, xi, xe, ye, yi); plspause(True); - pladv(0); -- Zoom in selection. plenv(xi, xe, ye, yi, 1, -1); plimage(img_f, 1.0, Long_Float(width), 1.0, Long_Float(height), 0.0, 0.0, xi, xe, ye, yi); - pladv(0); end if; -- Base the dynamic range on the image contents. @@ -449,7 +443,6 @@ plimagefr(img_f, 0.0, Long_Float(width), 0.0, Long_Float(height), 0.0, 0.0, img_min, img_max, pltr2'access, cgrid2'Address); - pladv(0); end; plend; end x20a; Modified: trunk/examples/ada/xthick20a.adb.cmake =================================================================== --- trunk/examples/ada/xthick20a.adb.cmake 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/ada/xthick20a.adb.cmake 2008-09-30 18:10:24 UTC (rev 8839) @@ -289,8 +289,6 @@ Draw_Image_Color_Map_1_Automatic(z, 1.0, Long_Float(XDIM), 1.0, Long_Float(YDIM), 0.0, 0.0, 1.0, Long_Float(XDIM), 1.0, Long_Float(YDIM)); - - Advance_To_Subpage(Next_Subpage); end if; -- sombrero-like demo @@ -326,8 +324,6 @@ save_plot(f_name(1 .. f_name_length)); end if; end if; - - Advance_To_Subpage(Next_Subpage); end if; -- Read the Lena image. @@ -398,12 +394,10 @@ Draw_Image_Color_Map_1_Automatic(img_f, 1.0, Long_Float(width), 1.0, Long_Float(height), 0.0, 0.0, xi, xe, ye, yi); Set_Pause(True); - Advance_To_Subpage(Next_Subpage); -- Zoom in selection. Set_Environment(xi, xe, ye, yi, Justified, Box); Draw_Image_Color_Map_1_Automatic(img_f, 1.0, Long_Float(width), 1.0, Long_Float(height), 0.0, 0.0, xi, xe, ye, yi); - Advance_To_Subpage(Next_Subpage); end if; -- Base the dynamic range on the image contents. @@ -449,7 +443,6 @@ Draw_Image_Color_Map_1(img_f, 0.0, Long_Float(width), 0.0, Long_Float(height), 0.0, 0.0, img_min, img_max, Plot_Transformation_2'access, cgrid2'Address); - Advance_To_Subpage(Next_Subpage); end; End_PLplot; end xthick20a; Modified: trunk/examples/c++/x20.cc =================================================================== --- trunk/examples/c++/x20.cc 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/c++/x20.cc 2008-09-30 18:10:24 UTC (rev 8839) @@ -181,8 +181,6 @@ pls->image(z, XDIM, YDIM, 1., (PLFLT) XDIM, 1., (PLFLT) YDIM, 0., 0., 1., (PLFLT) XDIM, 1., (PLFLT) YDIM); - - pls->adv(0); } /* sombrero-like demo */ @@ -211,8 +209,6 @@ /* save the plot */ if (f_name) save_plot(f_name); - - pls->adv(0); } pls->Free2dGrid(z, XDIM, YDIM); @@ -277,12 +273,10 @@ pls->image(img_f, width, height, 1., width, 1., height, 0., 0., xi, xe, ye, yi); pls->spause(true); - pls->adv(0); // zoom in selection pls->env(xi, xe, ye, yi, 1, -1); pls->image(img_f, width, height, 1., width, 1., height, 0., 0., xi, xe, ye, yi); - pls->adv(0); } // Base the dynamic range on the image contents. @@ -326,7 +320,6 @@ } pls->imagefr(img_f, width, height, 0., width, 0., height, 0., 0., img_min, img_max, pltr2, &cgrid2); - pls->adv(0); pls->Free2dGrid(cgrid2.xg, width+1, height+1); pls->Free2dGrid(cgrid2.yg, width+1, height+1); Modified: trunk/examples/f77/x20f.fm4 =================================================================== --- trunk/examples/f77/x20f.fm4 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/f77/x20f.fm4 2008-09-30 18:10:24 UTC (rev 8839) @@ -162,8 +162,6 @@ call plimage(z, XDIM, YDIM, & 1.d0, XDIMR, 1.d0, YDIMR, 0.d0, 0.d0, & 1.d0, XDIMR, 1.d0, YDIMR, XDIM) - - call pladv(0) endif C Sombrero-like demo @@ -196,8 +194,6 @@ if (f_name .ne. ' ') then call save_plot(f_name) endif - - call pladv(0) endif C @@ -270,13 +266,11 @@ & height_r, 0.d0, 0.d0, xi, xe, ye, yi, WDIM) call plspause(1) - call pladv(0) C Zoom in selection call plenv(xi, xe, ye, yi, 1, -1) call plimage(img_f, width, height, 1.d0, width_r, 1.d0, & height_r, 0.d0, 0.d0, xi, xe, ye, yi, WDIM) - call pladv(0) endif c Base the dynamic range on the image contents. @@ -311,9 +305,7 @@ enddo call plimagefr2(img_f, width, height, 0.d0, width_r, 0.d0, & height_r, 0.d0, 0.d0, img_min, img_max, xg, yg, WDIM) - call pladv(0) - call plend() end Modified: trunk/examples/f95/x20f.f90 =================================================================== --- trunk/examples/f95/x20f.f90 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/f95/x20f.f90 2008-09-30 18:10:24 UTC (rev 8839) @@ -149,8 +149,6 @@ call plimage(z, 1._plflt, XDIMR, 1._plflt, YDIMR, 0._plflt, 0._plflt, & 1._plflt, XDIMR, 1._plflt, YDIMR) - - call pladv(0) endif ! Sombrero-like demo @@ -183,8 +181,6 @@ if (f_name .ne. ' ') then call save_plot(f_name) endif - - call pladv(0) endif ! @@ -254,13 +250,11 @@ height_r, 0._plflt, 0._plflt, xi, xe, ye, yi) call plspause(.true.) - call pladv(0) ! Zoom in selection call plenv(xi, xe, ye, yi, 1, -1) call plimage(img_f, 1._plflt, width_r, 1._plflt, & height_r, 0._plflt, 0._plflt, xi, xe, ye, yi) - call pladv(0) endif ! Base the dynamic range on the image contents. @@ -297,7 +291,6 @@ enddo call plimagefr(img_f, 0._plflt, width_r, 0._plflt, & height_r, 0._plflt, 0._plflt, img_min, img_max, xg, yg) - call pladv(0) deallocate( img_f, xg, yg ) Modified: trunk/examples/java/x20.java =================================================================== --- trunk/examples/java/x20.java 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/java/x20.java 2008-09-30 18:10:24 UTC (rev 8839) @@ -153,8 +153,6 @@ pls.image(z, 1., (double) XDIM, 1., (double) YDIM, 0., 0., 1., (double) XDIM, 1., (double) YDIM); - - pls.adv(0); } /* sombrero-like demo */ @@ -182,8 +180,6 @@ /* save the plot */ if (f_name != null) save_plot(f_name); - - pls.adv(0); } @@ -250,12 +246,10 @@ pls.image(img_f, 1., (double) width, 1., (double) height, 0., 0., xi[0], xe[0], ye[0], yi[0]); pls.spause(true); - pls.adv(0); // zoom in selection pls.env(xi[0], xe[0], ye[0], yi[0], 1, -1); pls.image(img_f, 1., (double) width, 1., (double) height, 0., 0., xi[0], xe[0], ye[0], yi[0]); - pls.adv(0); } // Base the dynamic range on the image contents. @@ -308,7 +302,6 @@ } pls.imagefr(img_f, 0., (double) width, 0., (double) height, 0., 0., img_min, img_max, xg, yg); - pls.adv(0); pls.end(); } Modified: trunk/examples/ocaml/x20.ml =================================================================== --- trunk/examples/ocaml/x20.ml 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/ocaml/x20.ml 2008-09-30 18:10:24 UTC (rev 8839) @@ -147,8 +147,6 @@ | None -> () in - pladv 0; - (* read Lena image *) (* Note we try two different locations to cover the case where this * examples is being run from the test_ocaml.sh script *) @@ -192,12 +190,10 @@ plimage img_f 1.0 width 1.0 height 0.0 0.0 xi xe ye yi; plspause 1; - pladv 0; (* zoom in selection *) plenv xi xe ye yi 1 (-1); plimage img_f 1.0 width 1.0 height 0.0 0.0 xi xe ye yi; - pladv 0; (* Base the dynamic range on the image contents. *) let img_max, img_min = plMinMax2dGrid img_f in @@ -244,8 +240,6 @@ *) plimagefr img_f 0.0 width 0.0 height 0.0 0.0 img_min img_max; - pladv 0; - plend (); () Modified: trunk/examples/perl/x20.pl =================================================================== --- trunk/examples/perl/x20.pl 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/perl/x20.pl 2008-09-30 18:10:24 UTC (rev 8839) @@ -88,8 +88,6 @@ pllab ("...around a blue square."," ","A red border should appear..."); plimage ($z, 1, XDIM, 1, YDIM, 0, 0, 1, XDIM, 1, YDIM); - - pladv (0); } # sombrero-like demo @@ -111,8 +109,6 @@ # save the plot save_plot ($f_name) if $f_name; - - pladv (0); } # read Lena image @@ -161,13 +157,10 @@ plimage ($img_f, 1, $width, 1, $height, 0, 0, $xi, $xe, $ye, $yi); plspause (1); - pladv (0); # zoom in selection plenv ($xi, $xe, $ye, $yi, 1, -1); plimage ($img_f, 1, $width, 1, $height, 0, 0, $xi, $xe, $ye, $yi); - - pladv(0); } plend (); Modified: trunk/examples/python/xw20.py =================================================================== --- trunk/examples/python/xw20.py 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/python/xw20.py 2008-09-30 18:10:24 UTC (rev 8839) @@ -186,8 +186,6 @@ plimage(z, 1.0, XDIM, 1.0, YDIM, 0.0, 0.0, 1.0, XDIM, 1.0, YDIM) - pladv(0) - if (not nosombrero): plcol0(2) # Draw a yellow box, useful for diagnostics! plenv(0.0, 2.0*pi, 0, 3.0*pi, 1, -1) @@ -199,16 +197,14 @@ r = sqrt( multiply.outer(x*x,ones(YDIM)) + multiply.outer(ones(XDIM),y*y)) + 1e-3 z = sin(r) / r - pllab("No, an amplitude clipped \"sombrero\"", "", "Saturn?") - plptex(2., 2., 3., 4., 0., "Transparent image") - plimage(z, 0., 2.*pi, 0, 3.*pi, 0.05, 1.,0., 2.*pi, 0, 3.*pi) + pllab("No, an amplitude clipped \"sombrero\"", "", "Saturn?") + plptex(2., 2., 3., 4., 0., "Transparent image") + plimage(z, 0., 2.*pi, 0, 3.*pi, 0.05, 1.,0., 2.*pi, 0, 3.*pi) - # Save the plot - if (f_name != ""): - save_plot(f_name) + # Save the plot + if (f_name != ""): + save_plot(f_name) - pladv(0) - # Read Lena image # Note: we try two different locations to cover the case where # this example is being run from the test_c.sh script @@ -252,12 +248,10 @@ plimage(img, 1., width, 1., height, 0., 0., xi, xe, ye, yi) plspause(1) - pladv(0) # zoom in selection plenv(xi, xe, ye, yi, 1, -1) plimage(img, 1., width, 1., height, 0., 0., xi, xe, ye, yi) - pladv(0) # Base the dynamic range on the image contents. img_min = min(img.flat) @@ -285,7 +279,6 @@ plimagefr(img, 0., width, 0., height, 0., 0., img_min, img_max, \ pltr2, xg, yg) - pladv(0) main() Modified: trunk/examples/tcl/x20.tcl =================================================================== --- trunk/examples/tcl/x20.tcl 2008-09-30 17:35:26 UTC (rev 8838) +++ trunk/examples/tcl/x20.tcl 2008-09-30 18:10:24 UTC (rev 8839) @@ -132,8 +132,6 @@ "A red border should appear..." $w cmd plimage z 1. $XDIM 1. $YDIM 0. 0. 1. $XDIM 1.$YDIM - - $w cmd pladv 0 } # Sombrero-like demo @@ -168,8 +166,6 @@ if { $f_name != "" } { save_plot $w $f_name } - - $w cmd pladv 0 } # @@ -235,12 +231,10 @@ $w cmd plimage img_f 1. $width 1. $height 0. 0. $xi $xe $ye $yi $w cmd plspause 1 - $w cmd pladv 0 # Zoom in selection $w cmd plenv $xi $xe $ye $yi 1 -1 $w cmd plimage img_f 1. $width 1. $height 0. 0. $xi $xe $ye $yi - $w cmd pladv 0 } # Base the dynamic range on the image contents. @@ -281,7 +275,6 @@ } $w cmd plimagefr img_f 0. $width 0. $height 0. 0. $img_min \ $img_max xg yg - $w cmd pladv 0 $w cmd plend } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |