I am having problems getting GD::Graph to function. It seems to have issues constructing graphs when all of the datapoints are the same. This example code works:
#!/usr/local/perl-5.8.3/bin/perl use warnings; use strict; use GD::Graph::lines; my @data = ( [ qw/ 1 2 3 / ], [ qw/ -70 -70 -71 / ], ); my $graph = GD::Graph::lines -> new ( 200, 200 ); $graph -> set( x_label => 'x', y_label => 'y', title => 'title', ); $graph -> plot ( \@data );
while the following code does not:
#!/usr/local/perl-5.8.3/bin/perl use warnings; use strict; use GD::Graph::lines; my @data = ( [ qw/ 1 2 3 / ], [ qw/ -70 -70 -70 / ], ); my $graph = GD::Graph::lines -> new ( 200, 200 ); $graph -> set( x_label => 'x', y_label => 'y', title => 'title', ); $graph -> plot ( \@data );
The second code will run forever (over 5 minutes) and the only difference is the datapoints given. To give some variety, I tried creating an additional datapoint that was `undef' but the results were the same. Is this an issue with the module?

perl 5.8.3
GD 1.18
GD::Text 0.86
GD::Graph 1.43
libgd 1.8.4-11

Thanks in advance

In reply to GD::Graph issue with similar datapoints by narse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.