Ppeoc has asked for the wisdom of the Perl Monks concerning the following question:

I am not sure if this possible in Perl. I have made heatmaps or 2D contour surface plots using GNUPlot and Chart::Gnuplot. I was wondering if it was interactively possible to change the scale of the rgb palette. For example -I have an RGB 2d surface plot with range of @x,@y and z= -120:120. I want to be able to change the scale of the axis and hence change the colors of my plot. The point is to be able to compare different rbg 2d surface plots with different range values. Suppose I have another heatmap with same @x and @y coordinates but different z values = -20:20. I want to be able to change the scale to -120:120 so I could compare both the 2D surface plots. Is such a thing possible? I hope my question is clear. Thanks Monks!
  • Comment on Edited:Using Chart::Gnuplot to creat an interactive scale for palette?

Replies are listed 'Best First'.
Re: Is it possible to create an interactive scale for palette in GNUplot?
by LanX (Saint) on Mar 05, 2016 at 15:21 UTC
    > I hope my question is clear.

    Nope, could you show some code?

    Interactivity is a matter of speed and control.

    Generally speaking if Chart::Gnuplot is fast enough you could trigger redraws from a gui (like tk)!

    That's your question?

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      Hi Rolf, So far I have a code that just plots the 2D contour plot. Here is a snippet,
      my $chart = Chart::Gnuplot->new( output => "test1.png", title => "3D plot", xlabel => 'x', ylabel => 'y', ); $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'); my $dataSet = Chart::Gnuplot::DataSet->new( points => \@array, ); $chart->plot3d($dataSet);
      This does not have TK gui. But sounds like a good starting point.
        $chart->set(cbrange => '[-120:120]');

        See gnuplot page 181.

        poj
Re: Edited: Integrating TK and Chart::Gnuplot to creat an interactive scale for palette?
by LanX (Saint) on Mar 06, 2016 at 14:34 UTC
    > Edited:: ... My issue now is ...

    Please don't edit to ask new questions, this will be ignored.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      Oops! My bad! I will make this a new question