Menu

Heatmaps assembly into a cube

Help
Jerome
2017-11-28
2018-01-16
  • Jerome

    Jerome - 2017-11-28

    Dear community,

    Suppose that I know to generate several 2D-heatmaps, say 3 of them ( each map is a 2D representation with a color code coding the itnensity of a third-variable) from differnt files. I would like to assemble these maps into a cube. For illustrative exemple, see the Fig.2 of the following .pdf article, page 7.

    Best regards,

     

    Last edit: Jerome 2017-12-10
    • Jerome

      Jerome - 2018-01-11

      Hi guys,
      I'm afraid. Any ideas?
      Regards

       
      • Ethan Merritt

        Ethan Merritt - 2018-01-11

        This does not seem difficult. What have you tried that didn't work?
        See for example the last plot in the image2 demo, where a 2D image is plotted in two different planes in 3D
        http://gnuplot.sourceforge.net/demo_cvs/image2.html

         
  • Jerome

    Jerome - 2018-01-16

    Thx for the help, appreciated. First, I don't use with image to generate my heatmaps (not supported on my mac for some reasons). I tried the following (following the link provided above) without being succesfull:

    --
    unset border
    unset key
    set view 60, 45, 1, 1
    unset xtics
    unset ytics
    unset ztics
    set lmargin 0
    set bmargin 0
    set rmargin 0
    set tmargin 0
    unset colorbox
    set view map

    splot 'data.txt' u 2:1:3 with point palette pointsize 1 pointtype 5 origin=(0,0,0) perp = (1,0,0),'data.txt' u 2:1:3 with point palette pointsize 1 pointtype 5 origin=(0,0,0) perp = (1,0,0)

     
    • Ethan Merritt

      Ethan Merritt - 2018-01-16

      Thx for the help, appreciated. First, I don't use with image to generate my heatmaps (not supported on my mac for some reasons).

      Are you sure? "with image" has been a supported plot mode on all platforms since about 2006 (version 4.2). How old is your gnuplot version?

       
      • Jerome

        Jerome - 2018-01-16

        Yes I'am. That's why I'm using the aformentioned method (with point palette)
        G N U P L O T
        Version 5.2 patchlevel 2

         
        • Ethan Merritt

          Ethan Merritt - 2018-01-16

          OK. So create the 3 heatmaps you want to place on the cube faces. Write each one to a file (probably PNG). Then read in the 3 PNG files using "with image" and position them as desired in 3D.

           
          • Jerome

            Jerome - 2018-01-16

            thx but it's not that clear. Do you have a minimal reproducible example?
            cheers,

             
            • Ethan Merritt

              Ethan Merritt - 2018-01-16

              Minimal example.
              Does not use PNG files for intermediate storage of heat maps
              Requires verion 5.2.2, earlier version will not accept the sampling directive

              set xyplane at 0
              set style data pm3d
              set pm3d depthorder
              #
              splot sample [u=0:10:1][v=0:10:1] '++' using (u):(0):(v):(u*v), \
                           [u=0:10:1][v=0:10:1] '++' using (u):(v):(0):(u*v), \
                           [u=0:10:1][v=0:10:1] '++' using (0):(u):(v):(u*v)
              
               

              Last edit: Ethan Merritt 2018-01-16

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.