[Graph-dev] autoscale problem with Chart::Graph::Xmgrace

Martin Stockhammer m.stockhammer at science-computing.de
Thu Aug 14 12:29:29 PDT 2003


Hi,

I detected a bug in the autoscaling handling of Chart::Graph::Xmgrace.
in Chart-Graph-2.0 from CPAN.
If the options xrange and yrange are both given, only one of them is
used.

I created a patch that is attached here.

Greetings

Martin Stockhammer



-- 
_________________________________creating IT solutions
                                  science + computing ag
Martin Stockhammer               Geschäftsstelle München
IT-Service                       Ingolstädter Str. 22
phone +49 89 356386 84           80807 München, Germany
fax   +49 89 356386 37           http://www.science-computing.de

-------------- next part --------------
diff -Naur Chart-Graph-2.orig/Graph/Xmgrace.pm Chart-Graph-2/Graph/Xmgrace.pm
--- Chart-Graph-2.orig/Graph/Xmgrace.pm	Wed Oct 24 00:17:37 2001
+++ Chart-Graph-2/Graph/Xmgrace.pm	Thu Aug 14 10:57:15 2003
@@ -241,7 +241,7 @@
 		}
 		$grace->world_options->xmin($value->[0]);
 		$grace->world_options->xmax($value->[1]);
-		$autoscale = "x";
+		$autoscale .= "x";
 	    }
 	}
 
@@ -255,7 +255,7 @@
 		}
 		$grace->world_options->ymin($value->[0]);
 		$grace->world_options->ymax($value->[1]);
-		$autoscale = "y";
+		$autoscale .= "y";
 	    }
 	}
 	
@@ -540,8 +540,12 @@
 	print STDERR "xscale\n";
     } elsif ($autoscale eq "y") {
 	_run_app("$xmgrace", "-autoscale x", "-hardcopy -hdevice $grace->{output_type}", 
-		 "-printfile $grace->{output_file} $command_file -autoscale") unless $stdout;
+		 "-printfile $grace->{output_file} $command_file -pexec autoscale") unless $stdout;
 	print STDERR "yscale\n";
+    } elsif ($autoscale eq "xy" || $autoscale eq "yx") {
+        _run_app("$xmgrace", "-hardcopy -hdevice $grace->{output_type}",
+                 "-printfile $grace->{output_file} $command_file") unless $stdout;
+        print STDERR "no autoscale\n";
     } else {
 	_run_app("$xmgrace", "-autoscale xy", "-hardcopy -hdevice $grace->{output_type}", 
 		 "-printfile $grace->{output_file} $command_file -autoscale") unless $stdout;


More information about the Graph-dev mailing list