Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Help With GD::Graph::lines

by GertMT (Hermit)
on Aug 01, 2007 at 05:21 UTC ( [id://629968]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Help With GD::Graph::lines
in thread Help With GD::Graph::lines

Guess it's got to do with the type of data you use. 1st is only the first appearance of the data. Therefor it'll not start at zero. Maybe a bar chart is more natural?

A site you might think is interesting:
http://gdgraph.com/samples/sample11.html

Gert

Replies are listed 'Best First'.
Re^4: Help With GD::Graph::lines
by Anonymous Monk on Aug 01, 2007 at 06:45 UTC
    Thanks.
    This piece of code at your referred site was able to place the start of the plot at the origin but I am not sure how they did it.
    use strict;
    use GD::Graph::lines;
    require 'save.pl';
    use constant PI => 4 * atan2(1,1);
    print STDERR "Processing sample55\n";
    my @x = map {$_ * 3 * PI/100} (0 .. 100);
    my @y = map sin, @x;
    my @z = map cos, @x;
    my @data = (\@x,\@y,\@z);
    my $my_graph = new GD::Graph::lines();
    $my_graph->set(
    x_label => 'Angle (Radians)',
    y_label => 'Trig Function Value',
    x_tick_number => 'auto',
    y_tick_number => 'auto',
    title => 'Sine and Cosine',
    line_width => 1,
    x_label_position => 1/2,
    r_margin => 15,
    transparent => 0,
    );
    $my_graph->set_legend('Thanks to Scott Prahl');
    $my_graph->plot(\@data);
    save_chart($my_graph, 'sample55');

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://629968]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-16 13:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found