2
votes

I have been attempting to plot two heat maps with data from two data files using gnuplot. I have plotted heat maps using gnuplot before, but never tried to "overlay them".

My attempt is as follows:

    set terminal pngcairo
    set xrange[-2:2]
    set yrange[-2:2]
    unset surface
    set view map
    set pm3d       
    set size square
    set key outside
    set pm3d depthorder 
    splot "file_1" u 1:2:3 w pm3d notitle, \
    "file_2" u 1:2:3 w pm3d notitle   

This produces the following output:

Contour plot

There is a faint ring which corresponds to one of the data files but this is not what is desired. By removing the map you can see what the data looks like:

Double ring 3D plot

So the first plot has plotted the outer, lower ring but seems to have not plotted the inner taller ring even though it has registered its scale. What I am looking for is a view of this second plot from above.

By manipulating the view of this 3-D plot, I can do this:

Third plot

but is there a way to obtain a top down view of this plot without having to set the view, and by just using the view map and splot commands? The view method does not look as good, and I would like to know why it does not behave as expected.

Thank you in advance

1
It is quite difficult to investigate what is going wrong here without the actual data files. Can you upload them somewhere (not here)? BTW: these aren't contour plots - Christoph
Thank you for the reply Christoph. I was lazy with my labeling and changed "contour plot" to a more suitable label. They were contour plots to begin with, but changed with the project. Do you recommend a place to upload the data files? I did not include them in the original post as they contain over 30,000 data points each, so thought to try the "may be a quick fix method" first! - Yeti
You could try set pm3d map and remove the view part. Or try to exchange the order of both files. I haven't used any uploading site myself, but I've seen people using pastebin.com - Christoph
Thanks. I can reproduce this also with the newest development version. I filed a bug for this: #1711 Pm3d map ignores depthorder. - Christoph

1 Answers

2
votes

In the meantime that the bug will be fixed you can use the following workaround:

max(a,b)=(a>b)?a:b
splot "<paste file_1 file_2" u 1:2:(max($3,$6)) w pm3d notitle

Because in this case depth ordering is equivalent to sorting the z values.

enter image description here