#!/usr/bin/perl -w use strict; use GnuplotImageMap; # generate some values to plot my @xvalues = map { sprintf "%.3f", rand } 1 .. 10; my @yvalues = map { sprintf "%.3f", rand } 1 .. 10; # this is to test the "action" my $alphabets = [ 'a' .. 'z' ]; # generate the image map my $object = GnuplotImageMap->new( xvalues => [@xvalues], yvalues => [@yvalues], # this is where you specify what you want to do ... the default is as before! action => sub { my ($i) = @_; return $alphabets->[$i] || "out of bounds here"; }, ); # print out the image map print "\n\nThe image map:\n\n", $object->image_map(), "\n"; exit 0;