[Graph-dev] passing multiple datasets into gnuplot module
J. J. Yuan
j1yuan at yahoo.com
Tue Sep 30 12:16:43 PDT 2003
It still doesn't work. I wonder if this has to do with Gnuplot or Perl on
my box? The examples worked fine!
Here is my complete program:
#!/usr/bin/perl -w
# To include extra perl modules (DBI, DBD::Sybase, POSIX, Gnuplot, etc.)
BEGIN { unshift @INC, '/sysadmin/collector/src/module',
'/sysadmin/collector/src/module/aix',
'/sysadmin/collector/src/new_web/cgi-bin',
'/sysadmin/collector/src/module/lib/site_perl/5.6.0/',
'/sysadmin/collector/src/module/lib/site_perl/5.6.1'}
use Chart::Graph::Gnuplot qw(gnuplot);
%hash1 = {"title" => "data1",
"type" => "matrix"};
%hash2 = {"title" => "data2",
"style" => "lines",
"type" => "columns"};
@array1 = ([1, 10], [2, 20], [3, 30]);
@array2 = ([8, 26, 50, 60, 70], [5, 28, 50, 60, 70]);
push @dataset, [\%hash1, \@array1], [\%hash2, \@array2];
gnuplot({"title" => "foo",
"x2-axis label" => "bar",
"logscale x2" => "1",
"logscale y" => "0",
"output type" => "png",
"output file" => "gnuplot1.png",
"xdata" => "time",
"format" => ["x", "%m/%d"],
"timefmt"=> "%H:%M",
"extra_opts" => "set key left top Left"},
@dataset);
====================================================================
Here is the error on my terminal screen:
Reference found where even-sized list expected at test_module_5.pl line
12.
Reference found where even-sized list expected at test_module_5.pl line
15.
unknown option: HASH(0x20227cf4) at
/sysadmin/collector/src/module/lib/site_perl/5.6.1/Chart/Graph/Gnuplot.pm
line 466
Use of uninitialized value in string eq at
/sysadmin/collector/src/module/lib/site_perl/5.6.1/Chart/Graph/Gnuplot.pm
line 50
0.
Use of uninitialized value in string eq at
/sysadmin/collector/src/module/lib/site_perl/5.6.1/Chart/Graph/Gnuplot.pm
line 50
0.
Use of uninitialized value in string eq at
/sysadmin/collector/src/module/lib/site_perl/5.6.1/Chart/Graph/Gnuplot.pm
line 50
0.
Use of uninitialized value in string eq at
/sysadmin/collector/src/module/lib/site_perl/5.6.1/Chart/Graph/Gnuplot.pm
line 50
0.
Need to specify data set type at test_module_5.pl line 26
========================================================
Here is gnuplot info:
G N U P L O T
Unix version 3.7
patchlevel 1
last modified Fri Oct 22 18:00:00 BST 1999
========================================================
Here is my Perl info:
This is perl, v5.6.1 built for aix
--- David Moore <dmoore at caida.org> wrote:
> On Tue, Sep 30, 2003 at 09:24:33AM -0700, J. J. Yuan wrote:
> > push @dataset, \%hash1, \@array1, \%hash2, \@array2;
>
> Oh this needs to be push @dataset, [\%hash1, \@array1], [\%hash2,
> \@array2];
>
>
> > "extra_opts" => "set key left top Left"},
> > \@dataset);
>
> And this needs to be @dataset. Although I would call it datasets, since
> it is more than one.
>
> -- david
=====
-- Jay Jie Yuan Ô¬½Ü --------------------- j1yuan at yahoo.com --
-- 6487 Copperleaf Lane -- Cincinnati, OH 45230 -- USA --
== (513) 232-1301(H) = 336-4711 (W) = 623-2245 (cell) ==
== text page (140 chars): 5136232245 at messaging.nextel.com ==
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
More information about the Graph-dev
mailing list