toff has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Thanks for your reply so far before I leap and try using Gnuplot I'd like to describe my problem a bit better. Basically when I plot a graph the picture is positioned exactly at the center of the grid instead of being justified to the left. The alignment command is mis-configered. Looking closely the plot and and the x axis look to be center aligned. This is why I only included the code section that covers setting alignment. Thanks Toff
code snippet ... $my_graph = new GD::Graph::lines(500,400); $size = scalar @resTimes; my $skip = int ( $size / 7 ); $my_graph->set( x_label => 'Date', y_label => 'Price', title => 'Pair: '.$myFname. '-'.$mySname .' Cor= '.$aCorr . ' + Per= ' .$aPeriod, text => 'Line Graph', x_min_value => 0, y_min_value => 0, box_axis => 1, line_width => 1, x_label_skip => $skip, y_label_skip => 1, x_label_position => 1/2, y_label_position => 1/2, long_ticks => 1, transparent => 0, t_margin => 10, b_margin => 10, l_margin => 10, r_margin => 15, );

Replies are listed 'Best First'.
Re: GD Graph plot centered
by zentara (Cardinal) on Jul 20, 2007 at 16:28 UTC
    Usually you will get a better response if you post a working snippet that describes the problem.... if you ask people to flesh out your code to make it run, they just skip to the next node. :-)

    I can't really say I understand your question, but remember, these GD graph modules are very basic; if you want alot of functionality in your graphs, you should look at the bigger graph modules, like Gnuplot and gnuplot.

    I usually go right to the Tk::Canvas when I want a special graph.... it gives you total control.


    I'm not really a human, but I play one on earth. Cogito ergo sum a bum