From: <ai...@us...> - 2010-05-30 22:22:05
|
Revision: 11038 http://plplot.svn.sourceforge.net/plplot/?rev=11038&view=rev Author: airwin Date: 2010-05-30 22:21:58 +0000 (Sun, 30 May 2010) Log Message: ----------- Make Perl/PDL example 7 produce identical results to the corresponding C example. Modified Paths: -------------- trunk/examples/perl/x07.pl Modified: trunk/examples/perl/x07.pl =================================================================== --- trunk/examples/perl/x07.pl 2010-05-30 22:05:09 UTC (rev 11037) +++ trunk/examples/perl/x07.pl 2010-05-30 22:21:58 UTC (rev 11038) @@ -29,8 +29,8 @@ use PDL::Graphics::PLplot; # Starting points for symbol lookup -my @base = (0, 200, 500, 600, 700, 800, 900, 2000, 2100, 2200, 2300, - 2400, 2500, 2600, 2700, 2800, 2900); +my @base = (0, 100, 0, 100, 200, 500, 600, 700, 800, 900, + 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900); # Parse and process command line arguments @@ -40,48 +40,58 @@ plinit (); -plfontld (1); +plfontld (0); +my $l = 0; + for my $base (@base) { - pladv (0); + if ( $l == 2 ) { + plfontld( 1 ); + } - # Set up viewport and window + pladv (0); - plcol0 (2); - plvpor (0.15, 0.95, 0.1, 0.9); - plwind (0, 1, 0, 1); + # Set up viewport and window - # Draw the grid + plcol0 (2); + plvpor (0.15, 0.95, 0.1, 0.9); + plwind (0, 1, 0, 1); - plbox (0.1, 0, 0.1, 0, "bcg", "bcg"); + # Draw the grid - # Write digits below the frame + plbox (0.1, 0, 0.1, 0, "bcg", "bcg"); - plcol0 (15); - for my $i (0..9) { - plmtex (1.5, (0.1 * $i + 0.05), 0.5, "b", $i); - } + # Write digits below the frame - my $k = 0; - OUTER: for my $i (0..9) { + plcol0 (15); + for my $i (0..9) { + plmtex (1.5, (0.1 * $i + 0.05), 0.5, "b", $i); + } - # Write the digits to the left of the frame + my $k = 0; + OUTER: for my $i (0..9) { - plmtex (1, (0.95 - 0.1 * $i), 1, "lv", ($base + 10 * $i)); + # Write the digits to the left of the frame - my $y = 0.95 - 0.1 * $i; - for my $j (0..9) { + plmtex (1, (0.95 - 0.1 * $i), 1, "lv", ($base + 10 * $i)); - my $x = 0.1 * $j + 0.05; + my $y = 0.95 - 0.1 * $i; + for my $j (0..9) { - plsym ($x, $y, ($k + $base)); - last OUTER if $k >= 127; - $k++; - } + my $x = 0.1 * $j + 0.05; + + plsym ($x, $y, ($k + $base)); + last OUTER if $k >= 127; + $k++; + } } - plmtex (1.5, 0.5, 0.5, "t", "PLplot Example 7 - PLSYM symbols"); + if ($l++ <2) { + plmtex (1.5, 0.5, 0.5, "t", "PLplot Example 7 - PLSYM symbols (compact)"); + } else { + plmtex (1.5, 0.5, 0.5, "t", "PLplot Example 7 - PLSYM symbols (extended)"); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |