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; }

In reply to Integrating TK and Chart::Gnuplot. by Ppeoc

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.