怎样设置坐标原点

怎样设置坐标原点

各位好,请教一下用GD作图,坐标原点怎么设置? 比如设置横坐标从-100开始

目前用perl 做的Barchart好像都默认原点为(0,0)

code:

#!/usr/bin/perl -w
use CGI ':standard';
use GD::Graph::bars;
use strict;

my @data=(['-100','0','100'],
          [1,2,3]);  
                                                                             
my $graph = GD::Graph::bars->new(500,300);                                                                              
      $graph ->set(
       x_label =>'x_label ',
       y_label =>'y_label ',
       title   =>'title',
       #Draw bars with width 3 pixels
       bar_width =>3,
       #Seperate the bars with 4 pixels
       bar_spacing =>4,
       show_values =>1,
      ) or warn $graph->error;

my  $myimage = $graph->plot(\@data) or die $graph->error;                                                                              
print "Contents-type:image/jpeg\n\n";
print $myimage->jpeg;

结果图横坐标竟然为0 -100 0 100, 怎样直接从-100开始?

多谢!

推荐一下看什么资料?
Is it  too simple to solve with perl? I am eagering to the answer or idea...
又一个用Perl 的 MM,国宝
仔细看CPAN:
http://search.cpan.org/~bwarfiel ... ions_for_all_graphs

摘录如下:

zero_axis
If set to a true value, the axis for y values of 0 will always be drawn. This might be useful in case your graph contains negative values, but you want it to be clear where the zero value is. (see also zero_axis_only and box_axes). Default: 0.

zero_axis_only
If set to a true value, the zero axis will be drawn (see zero_axis), and no axis at the bottom of the graph will be drawn. The labels for X values will be placed on the zero exis. Default: 0.
Thanks