#!/bin/env perl use strict; use warnings; use Imager::Heatmap; my $hmap = Imager::Heatmap->new( xsize => 640, # Image width ysize => 480, # Image height xsigma => 10, # Sigma value of X-direction ysigma => 10, # Sigma value of Y-direction ); # @point_datas should be: ( [ x1, y1, weight1 ], [ x2, y2, weight2 ] ... ) my @point_datas = ( [ 10, 20, 50 ], [ 20, 40, 70 ] ); # Add point datas to construct density matrix $hmap->insert_datas(@point_datas); # After adding datas, get heatmap as Imager instance. my $img = $hmap->draw; # create png file in current directory $img->write( file => './hm.png' );