Hi All,

I've created 32 line graphs with GD and GD::Graph that update with new data every 15 minutes. I'm pretty happy with them with a few exceptions.

One problem is with the y-axis when I have y values that include negative and positive values. I'm not setting the y_tick_number, y_label_skip, y_max_value, or y_min_value. I'm letting GD::Graph take care of that and it works well for the majority of the graphs.

The problem occurs when I have y values that range from say -0.6 to 0.4. The y ticks get labeled
0.4
0.2
-1.11022302462516e-16
-0.2
-0.4
-0.6.
I understand that the really small value is an approximation of zero and probably has something to do with rounding. However, it is unacceptable on a graph. Besides being an odd looking number, it takes up a lot of space and squishes the graph to the right.

I haven't been able to find any references to this problem. Any suggestions on how to fix it?

Thanks

In reply to GD::Graph y-axis problem by Anonymous Monk

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.