$coordinates .= sprintf $AREA_FORMAT, $xcoord, $ycoord, "$action_file?x=$xvalue&y=$yvalue", "Value: [$xvalue, $yvalue]", "Value: [$xvalue, $yvalue]";
####
$coordinates .= sprintf $AREA_FORMAT, $xcoord, $ycoord, $self->get_action->($i);
####
my $AREA_FORMAT = qq(\n);
####
#!/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;
####
The image map: