my $dataSet = Chart::Gnuplot::DataSet->new( points => [ @finalresult ], ### pass a ref to anonymous array, not ref to global array style => "linespoints", title => "points" );