use strict; use warnings; use Chart::Gnuplot; my (@x,@y,@data); #data is initialized. @data = ( [0, 0, 10], [0, 1, 10], [0, 2, 10], [1, 0, 10], [1, 1, 5], [1, 2, 10], [2, 0, 10], [2, 1, 1], [2, 2, 10], [3, 0, 10], [3, 1, 0], [3, 2, 10], ); my $chart = Chart::Gnuplot->new( output => "test1.png", title => "3D plot from arrays of x, y and z coordinates", xlabel => 'x', ylabel => 'y', ); #$chart->set(view => (180,180,1,1'); my $dataSet = Chart::Gnuplot::DataSet->new( points => \@data, ); $chart->plot3d($dataSet);