Hey Monks,
Thank to the help of some monks below, I was able to scale the heatmaps using cbrange. My issue now is with using TK to make it interactive. I was able to use this post http://www.perlmonks.org/?node_id=685864 to a certain extent to get what I want. When I hit the plot button, I get the contour plot in a new window. The Plot button is still pressed. I can close the contour plot window, but the plot button in the TK window is still pressed and my perl interface starts to hang. I cannot even hit the exit button on the Tk window.
How can I "unrelease" the plot button so that every time I click it, I get a new contour plot window (replacing the old one).
Thanks monks!
my $chart = Chart::Gnuplot->new(
terminal => 'windows',
title => "3D plot from arrays of x, y and z coordinates",
xlabel => 'x',
ylabel => 'y',
);
#my $x = 110;
#my $y = 130;
$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');
$chart->set(cbrange => "[$x:$y]");
my $dataSet = Chart::Gnuplot::DataSet->new(
points => \@array,
);
my $mw = new MainWindow;
my $frame = $mw->Frame->pack( -anchor => 'w' );
$frame->Button(-text => "Exit",
-command => sub{&quit, $mw->destroy; })->pack(-side => "bo
+ttom");
my $plotbutton = $frame->Button(
-text => 'Plot',
-command => \&plot,
)->pack( -side => "bottom");
$mw->protocol( 'WM_DELETE_WINDOW', \&quit );
$mw->bind( "<Return>", sub { $plotbutton->invoke } );
MainLoop;
sub plot {
$chart->plot3d($dataSet);
}
sub quit { $chart->close; $mw->destroy; }