my $chart = Chart::Gnuplot->new( output => "test1.png", title => "3D plot", xlabel => 'x', ylabel => 'y', ); $chart->set(pm3d => 'map'); $chart->set(palette => 'defined (0 0 0 1, 1 1 1 0, 2 1 0 0)'); $chart->set(dgrid3d => '385,385'); my $dataSet = Chart::Gnuplot::DataSet->new( points => \@array, ); $chart->plot3d($dataSet);