How resolve gnuplot artifacts in heat map












2















I'm trying to generate a heat map from data (https://pastebin.com/AgivvGgX). The data are not in the "matrix" form.



I tried to use pm3d map and I obtained the following plot:
enter image description here



I also tried to use dgrid3d and view map:



set view map
set pal def
set dgrid3d 40,40,3
splot "plot.dat" using 1:2:3 u pm3d


And I obtained the following result:
enter image description here



Both the plots are not correct. The dgird3d keyword creates artifacts where there are not data points.



I obtained a nice plot using the code:



set view map
set pal def
splot "plot.dat" using 1:2:3 with points pointtype 5 pointsize 1 palette linewidth 8


Here the result
enter image description here



I would like to obtain a map similar to the latter one, but not with discrete points or squares but as a continuous heat map and have a white background where data are not present. Is it possible?










share|improve this question





























    2















    I'm trying to generate a heat map from data (https://pastebin.com/AgivvGgX). The data are not in the "matrix" form.



    I tried to use pm3d map and I obtained the following plot:
    enter image description here



    I also tried to use dgrid3d and view map:



    set view map
    set pal def
    set dgrid3d 40,40,3
    splot "plot.dat" using 1:2:3 u pm3d


    And I obtained the following result:
    enter image description here



    Both the plots are not correct. The dgird3d keyword creates artifacts where there are not data points.



    I obtained a nice plot using the code:



    set view map
    set pal def
    splot "plot.dat" using 1:2:3 with points pointtype 5 pointsize 1 palette linewidth 8


    Here the result
    enter image description here



    I would like to obtain a map similar to the latter one, but not with discrete points or squares but as a continuous heat map and have a white background where data are not present. Is it possible?










    share|improve this question



























      2












      2








      2








      I'm trying to generate a heat map from data (https://pastebin.com/AgivvGgX). The data are not in the "matrix" form.



      I tried to use pm3d map and I obtained the following plot:
      enter image description here



      I also tried to use dgrid3d and view map:



      set view map
      set pal def
      set dgrid3d 40,40,3
      splot "plot.dat" using 1:2:3 u pm3d


      And I obtained the following result:
      enter image description here



      Both the plots are not correct. The dgird3d keyword creates artifacts where there are not data points.



      I obtained a nice plot using the code:



      set view map
      set pal def
      splot "plot.dat" using 1:2:3 with points pointtype 5 pointsize 1 palette linewidth 8


      Here the result
      enter image description here



      I would like to obtain a map similar to the latter one, but not with discrete points or squares but as a continuous heat map and have a white background where data are not present. Is it possible?










      share|improve this question
















      I'm trying to generate a heat map from data (https://pastebin.com/AgivvGgX). The data are not in the "matrix" form.



      I tried to use pm3d map and I obtained the following plot:
      enter image description here



      I also tried to use dgrid3d and view map:



      set view map
      set pal def
      set dgrid3d 40,40,3
      splot "plot.dat" using 1:2:3 u pm3d


      And I obtained the following result:
      enter image description here



      Both the plots are not correct. The dgird3d keyword creates artifacts where there are not data points.



      I obtained a nice plot using the code:



      set view map
      set pal def
      splot "plot.dat" using 1:2:3 with points pointtype 5 pointsize 1 palette linewidth 8


      Here the result
      enter image description here



      I would like to obtain a map similar to the latter one, but not with discrete points or squares but as a continuous heat map and have a white background where data are not present. Is it possible?







      gnuplot heatmap






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 2 at 21:23









      Michael O.

      2,9142524




      2,9142524










      asked Jan 2 at 14:02









      SimonSimon

      112




      112
























          1 Answer
          1






          active

          oldest

          votes


















          2














          Since your data is irregular, you should use dgrid3d. It has various options (see help dgrid3d), here is a picture I've got while trying different kernels and options:



          set view map
          set palette defined (0 'white', 1 'blue', 2 'green', 3 'yellow', 4 'red')
          set dgrid3d 100,100 exp kdensity 10,10
          splot 'plot.dat' w pm3d palette


          enter image description here



          set dgrid3d 100,100 gauss kdensity 30,30
          replot


          enter image description here






          share|improve this answer


























          • Interesting. The original data ranges from 0 to 65 but the cbrange of the plots are now 0 to 120 and <50 to 400. How to "rescale" properly depending on the kdensity values? And how to distinguish between existing values =0 and missing values? The latter now look like as they would be 0.

            – theozh
            Jan 3 at 7:48











          • Thank you. I obtained different color code between values equal to zero and missing value using the option: set dgrid3d 100,100 hann or set dgrid3d 100,100 box

            – Simon
            Jan 3 at 21:30













          • @Simon Glad to know. Have you found the solution of scaling problem, as theozh mentioned?

            – Michael O.
            Jan 3 at 23:39











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54007706%2fhow-resolve-gnuplot-artifacts-in-heat-map%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Since your data is irregular, you should use dgrid3d. It has various options (see help dgrid3d), here is a picture I've got while trying different kernels and options:



          set view map
          set palette defined (0 'white', 1 'blue', 2 'green', 3 'yellow', 4 'red')
          set dgrid3d 100,100 exp kdensity 10,10
          splot 'plot.dat' w pm3d palette


          enter image description here



          set dgrid3d 100,100 gauss kdensity 30,30
          replot


          enter image description here






          share|improve this answer


























          • Interesting. The original data ranges from 0 to 65 but the cbrange of the plots are now 0 to 120 and <50 to 400. How to "rescale" properly depending on the kdensity values? And how to distinguish between existing values =0 and missing values? The latter now look like as they would be 0.

            – theozh
            Jan 3 at 7:48











          • Thank you. I obtained different color code between values equal to zero and missing value using the option: set dgrid3d 100,100 hann or set dgrid3d 100,100 box

            – Simon
            Jan 3 at 21:30













          • @Simon Glad to know. Have you found the solution of scaling problem, as theozh mentioned?

            – Michael O.
            Jan 3 at 23:39
















          2














          Since your data is irregular, you should use dgrid3d. It has various options (see help dgrid3d), here is a picture I've got while trying different kernels and options:



          set view map
          set palette defined (0 'white', 1 'blue', 2 'green', 3 'yellow', 4 'red')
          set dgrid3d 100,100 exp kdensity 10,10
          splot 'plot.dat' w pm3d palette


          enter image description here



          set dgrid3d 100,100 gauss kdensity 30,30
          replot


          enter image description here






          share|improve this answer


























          • Interesting. The original data ranges from 0 to 65 but the cbrange of the plots are now 0 to 120 and <50 to 400. How to "rescale" properly depending on the kdensity values? And how to distinguish between existing values =0 and missing values? The latter now look like as they would be 0.

            – theozh
            Jan 3 at 7:48











          • Thank you. I obtained different color code between values equal to zero and missing value using the option: set dgrid3d 100,100 hann or set dgrid3d 100,100 box

            – Simon
            Jan 3 at 21:30













          • @Simon Glad to know. Have you found the solution of scaling problem, as theozh mentioned?

            – Michael O.
            Jan 3 at 23:39














          2












          2








          2







          Since your data is irregular, you should use dgrid3d. It has various options (see help dgrid3d), here is a picture I've got while trying different kernels and options:



          set view map
          set palette defined (0 'white', 1 'blue', 2 'green', 3 'yellow', 4 'red')
          set dgrid3d 100,100 exp kdensity 10,10
          splot 'plot.dat' w pm3d palette


          enter image description here



          set dgrid3d 100,100 gauss kdensity 30,30
          replot


          enter image description here






          share|improve this answer















          Since your data is irregular, you should use dgrid3d. It has various options (see help dgrid3d), here is a picture I've got while trying different kernels and options:



          set view map
          set palette defined (0 'white', 1 'blue', 2 'green', 3 'yellow', 4 'red')
          set dgrid3d 100,100 exp kdensity 10,10
          splot 'plot.dat' w pm3d palette


          enter image description here



          set dgrid3d 100,100 gauss kdensity 30,30
          replot


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 2 at 21:49

























          answered Jan 2 at 21:13









          Michael O.Michael O.

          2,9142524




          2,9142524













          • Interesting. The original data ranges from 0 to 65 but the cbrange of the plots are now 0 to 120 and <50 to 400. How to "rescale" properly depending on the kdensity values? And how to distinguish between existing values =0 and missing values? The latter now look like as they would be 0.

            – theozh
            Jan 3 at 7:48











          • Thank you. I obtained different color code between values equal to zero and missing value using the option: set dgrid3d 100,100 hann or set dgrid3d 100,100 box

            – Simon
            Jan 3 at 21:30













          • @Simon Glad to know. Have you found the solution of scaling problem, as theozh mentioned?

            – Michael O.
            Jan 3 at 23:39



















          • Interesting. The original data ranges from 0 to 65 but the cbrange of the plots are now 0 to 120 and <50 to 400. How to "rescale" properly depending on the kdensity values? And how to distinguish between existing values =0 and missing values? The latter now look like as they would be 0.

            – theozh
            Jan 3 at 7:48











          • Thank you. I obtained different color code between values equal to zero and missing value using the option: set dgrid3d 100,100 hann or set dgrid3d 100,100 box

            – Simon
            Jan 3 at 21:30













          • @Simon Glad to know. Have you found the solution of scaling problem, as theozh mentioned?

            – Michael O.
            Jan 3 at 23:39

















          Interesting. The original data ranges from 0 to 65 but the cbrange of the plots are now 0 to 120 and <50 to 400. How to "rescale" properly depending on the kdensity values? And how to distinguish between existing values =0 and missing values? The latter now look like as they would be 0.

          – theozh
          Jan 3 at 7:48





          Interesting. The original data ranges from 0 to 65 but the cbrange of the plots are now 0 to 120 and <50 to 400. How to "rescale" properly depending on the kdensity values? And how to distinguish between existing values =0 and missing values? The latter now look like as they would be 0.

          – theozh
          Jan 3 at 7:48













          Thank you. I obtained different color code between values equal to zero and missing value using the option: set dgrid3d 100,100 hann or set dgrid3d 100,100 box

          – Simon
          Jan 3 at 21:30







          Thank you. I obtained different color code between values equal to zero and missing value using the option: set dgrid3d 100,100 hann or set dgrid3d 100,100 box

          – Simon
          Jan 3 at 21:30















          @Simon Glad to know. Have you found the solution of scaling problem, as theozh mentioned?

          – Michael O.
          Jan 3 at 23:39





          @Simon Glad to know. Have you found the solution of scaling problem, as theozh mentioned?

          – Michael O.
          Jan 3 at 23:39




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54007706%2fhow-resolve-gnuplot-artifacts-in-heat-map%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

          SQL update select statement

          'app-layout' is not a known element: how to share Component with different Modules