[Graph-dev] passing multiple datasets into gnuplot module
J. J. Yuan
j1yuan at yahoo.com
Tue Sep 30 10:24:33 PDT 2003
I tried to combine 2 data sets into an array and pass it into the module,
but I haven't made it to work. I wonder if anyone can help me?
This short program which is derived from an example on the web page at
CAIDA.
Thanks!
Jay Yuan
-------------------------------------------------------
#!/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);
=====
-- 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