Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

GD::Graph - how to get rid of leading gap in line graph?
Is there a way to get rid of the leading gap to the left of a line
graph?  Therefore, I want the graph line to start on the Y-axis, not
the position of the first X tick.  Or, make the first X tick be
located on the Y-axis.

Here is a simple example:

#!/usr/local/bin/perl
use strict;
use GD;
use GD::Graph::lines;

my @months = ( "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" );
my @rainfall = ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 );
my @array = (\@months, \@rainfall);

my $graph = new GD::Graph::lines(768, 896);
$graph->set( y_long_ticks => "1", x_tick_offset => "2" );

my $gd_image = $graph->plot( \@array );
open(IMG, ">./test.png") or die $!;
binmode IMG;
print IMG $gd_image->png;

exit 0;

This graph will have a gap between the Y-axis and the first X tick
"Jan".

Thanks in advance for your help.

Report this thread to moderator Post Follow-up to this message
Old Post
carcassone_fr@yahoo.com
10-02-04 01:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Modules archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:45 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.