I've done it another way from the one already suggested.

I use LWP::UserAgent to get data from a URL, save it to a file because it is a very large dataset I use more than once, do a bunch of manipulations, ultimately putting the data into arrays (@dates and @atemp in the code below) for various graphs, then graph.

gnuplot({ "title" => "", "output type" => "png", "output file" => "temp.png", "x-axis label" => "$day.$month.$year $time - $eday.$emonth.$ey +ear $etime", "y-axis label" => "", "xdata" => "time", "format" => ["x", "%d.%m"], "timefmt" => "%Y-%m-%d-%H:%M", "xrange" => "[\"$dates[$index]\" : \"$dates[$j]\"]", "extra_opts" => join("\n","set grid", "set nokey", "set linest +yle 1 lt 3 l w 10","set lmargin 10","set rmargin 10","set tmargin 9","set bmargin 9 +" )}, [{ "style" => "lines ls 1", "type" => "columns"}, [@dates],[@atemp] ],); my $type = "AirTemp.png"; my $ftype = "Days" . "$days" . "ATemp.png"; my $finalgraph = printGraph($station,$type,$ftype); }
In case anyone notices/wonders/tries to use this, some things are intentionally left blank and the file is called temp because I ultimately use GD to splice this onto a background image using the subroutine at the end called printGraph - I just thought I'd include the whole code block because I know it works.

In reply to Re: Chart::Graph::Gnuplot Array Issue by kryberg
in thread Chart::Graph::Gnuplot Array Issue by vbrtrmn

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.