Menu

Juxtaposition of heatmaps

Help
Jerome
2017-11-27
2017-11-28
  • Jerome

    Jerome - 2017-11-27

    Dear community,

    I'm interested in a physical problem which depends on a parameter. For each value of a specified parameter, I produce a 2D-heatmap. Say now that I have 5 heatmaps. I would like to juxtapose these 5 maps in the direction of the parameter. I'm pretty dry on how to do it.

    Help appreciated,
    regards,

     
  • Jerome

    Jerome - 2017-11-27

    Well, it's not was I was looking for. I want to 'combine' the heat-maps in a '3D box' by juxtaposition, not just to plot several times a 2D map.

    regards

     
  • Bastian Märkisch

    Ok. I was just guessing what you want from the "google definition" :

    juxtaposition: the fact of two things being seen or placed close together with contrasting effect.
    "the juxtaposition of these two images"

    To help you we probably need an example image to understand what you are aiming at.

     
  • Jerome

    Jerome - 2017-11-28

    This is what I mean by 'juxtaposition': https://lee-phillips.org/qdf/
    Now keep in mind that the only thing that I know to generate are the color slices, in a 2d, as a result of an heatmap (3 coordinates, one coding the 'intensity' with a color code). I hope it helps.

    Now the question is: how can I juxtapose my heatmaps as in my illustrative example?

    regards

     
  • Bastian Märkisch

    Thanks for the clarification. You can easily do that by combining several image with splot.
    Use set view to change the viewing angle. Please find below a sample script:

    unset cbrange
    unset colorbox
    set xrange [-1:5]
    set yrange [-1:5]
    
    # view-point
    set view 75, 18
    set view azimuth -95
    
    # position of xy-plane
    set xyplane at 1
    
    # set labels and tweak positions
    set xlabel "{/:Italic x}" offset 1,0
    set ylabel "{/:Italic y}" offset 2,1
    set zlabel "parameter {/:Italic i}" offset 0,-2 #rotate by 90
    set ztics 1 offset 1,-1
    
    # sample data
    $map2 << EOD
    0 0 5
    0 1 4
    0 2 3
    0 3 1
    0 4 0
    
    1 0 2
    1 1 2
    1 2 0
    1 3 0
    1 4 1
    
    2 0 0
    2 1 0
    2 2 0
    2 3 1
    2 4 0
    
    3 0 0
    3 1 0
    3 2 0
    3 3 2
    3 4 3
    
    4 0 0
    4 1 1
    4 2 2
    4 3 4
    4 4 3
    EOD 
    
    # "fence" plot of heat-maps:
    #   third coordinate is z-position (index)
    #   color code is in fourth column, shifted here according to plot index i
    splot \
        for [i=1:5] \
        '$map2' using 2:1:(i):($3+i) with image not
    
     
  • Jerome

    Jerome - 2017-11-28
     

    Last edit: Jerome 2017-11-28
  • Jerome

    Jerome - 2017-11-28

    Bastian,
    Thx a lot for your help. Thx to your inputs, I converged to something that I do like. I wanted to get this figure done since my PhD. Also, I would like to know if there is a way to 'personalize/custom' the color cbrange (coding the 'intensity') of each maps independently.
    If yes, that would be a subtle and nice refinement considering the physical problem that I have at hand.
    Regards,

     

    Last edit: Jerome 2017-11-28
    • Bastian Märkisch

      Jerome, Great you succeeded - I would be eager to see the result ;).
      As for the custom color ranges: I guess you could map the values to RGB yourself and then use with rgbimage with 5 columns in the using statement. Each heatmap would need its own set of three mapping functions, though.
      If there would be a way to write out gnuplot's color mapping this could be turned into a two step process, where we first map the data and then plot the results. But I don't know if that can be done.

       
  • Jerome

    Jerome - 2017-11-28

    Please see the result. If you have any advices to improve the presentation I'm all hears. I'm still not very happy with the labels epsilon and e (too far from the axis in my opinion).

    What you see if a transition order/chaos (chaos is color coded in yellow) in the context of terrestrial dynamics (eccentricity, inclination) as a function of a pertubative parameter epsilon. Some simulations are still runing, the final plot might incorporate one to three more maps. It's very didactic to present the results in that way in my opinion.

    Nota: I don't want to add any ztics for epsilon, to keep the figure minimalist and 'clean'. That's why I added an arrow to give only the direction of the variation (for the range of variation, it will be written in the paper).

    I have a new question for you (and/or the community), I will create a dedicated topic.
    regards,

     

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.