Omshanti

I have a query related to the plotting of data through GD::Graph.

I have set the y_max_value, which defines the y axis scale of the graph in question to the value of 2.

This graph or should I say these graphs are being rendered dynamically through a CGI script on a webpage. For most of the data sets the graphs plot the data beautifully. Alas, for some, because some of the data points being above 2, the line is rendered above the y_max_value. Here is the code for the graph:

my @logConc; my @data; my @forGraph = (\@logConc,\@data); #end debug my $graph = GD::Graph::lines->new(500,300); $graph->set( x_label => 'Loged stuff', y_label => 'Intensity', title => "Plot of $cell_name (row $plateRow)", line_width => 1, legend_spacing => 5, x_tick_number => 'auto', box_axis => 0, y_min_value => 0, y_max_value => 2, transparent => 0 ) or die $graph->error; $graph->set_legend($cell_line_name); my $format = $graph->export_format; print header("image/$format"); binmode STDOUT; print $graph->plot(\@forGraph)->$format();

@logConc are the X values and @data are the values to be plotted.

Is there anyway for me to hide the plotted line above a certain threshold?

Namaste

Djodja


In reply to Hide plotted data that exceeds y_max_value in graph produced by GD::Graph::Lines by djodja

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.