Peter S
Peter S

Reputation: 575

Gnuplot Heatmap from multiple Files

My Data looks like this:

2015-08-01 07:00    0.23    0.52    0.00    0.52    9   14.6    14.6 14.6   67  8.5 0.0 --- 0.00    0.0 --- 14.6    14.1    14.1    16.3    1016.2  0.00      0.0   156 0.22    156 0.0 0.00    0.0 0.003   0.000   23.9    39  9.1 23.4    0.05    23  1   100.0   1   1.8797836153192153  660.7143449269239

2015-08-01 07:01    0.25    0.53    0.00    0.53    0   14.6    14.6    14.6    67  8.5 0.0 --- 0.00    0.0 --- 14.6    14.1    14.1    16.3    1016.2  0.00    0.0 153 0.22    153 0.0 0.00    0.0 0.003   0.000   23.9    39  9.1 23.4    0.00    23  1   100.0   1   1.8894284951616422  657.3416264126714   105 73  121 163

2015-08-01 07:02    0.25    0.52    0.00    0.52    0   14.7    14.7    14.6    67  8.6 0.0 --- 0.00    0.0 --- 14.7    14.2    14.2    16.1    1016.2  0.00    0.0 139 0.20    139 0.0 0.00    0.0 0.003   0.000   23.9    39  9.1 23.4    0.00    24  1   100.0   1   1.8976360559992214  654.4985251906015

2015-08-01 07:03    0.26    0.53    0.00    0.53    0   14.7    14.7    14.7      67    8.6 0.0 --- 0.00    0.0 --- 14.7    14.2    14.2    16.1    1016.3  0.00    0.0 139 0.20    144 0.0 0.00    0.0 0.003   0.000   23.9    39  9.1 23.4    0.00    23  1   100.0   1   1.9047561611790007  652.0519661851259

2015-08-01 07:04    0.25    0.53    0.00    0.53    0   14.7    14.7    14.7    67  8.7 0.0 --- 0.00    0.0 --- 14.7    14.2    14.2    16.2    1016.3  0.00    0.0 141 0.20    141 0.0 0.00    0.0 0.003   0.000   23.9    39  9.1 23.4    0.00    24  1   100.0   1   1.903537153899393   652.4695341279602

2015-08-01 07:05    0.25    0.52    0.00    0.52    0   14.8    14.8    14.7    67  8.7 0.0 --- 0.00    0.0 --- 14.8    14.3    14.3    16.3    1016.3  0.00    0.0 148 0.21    148 0.0 0.00    0.0 0.002   0.000   23.9    39  9.1 23.4    0.00    23  1   100.0   1   1.897596925383499   654.5120216976508
 ........
 ........

I've got multiple files looking that way: so I got data from 2015-08-01, 2015-06-05 and so on.

i want to plot the 43rd row in relation to the 3rd and 25th row :-) in some kind of heat map style from all those files in ONE plot. So those are the rows want to pick out of each the file:

0.23 156 660.7143449269239
0.25 153 660.7143449269239
0.25 139 654.4985251906015
0.26 139 652.0519661851259

i got the format right through dgrid 3d and that ist my output so far: enter image description here

here's my code

set dgrid3d
set grid
set palette model HSV defined ( 0 0 1 1, 1 1 1 1 )
set pm3d map 
unset surf
set pm3d at b

splot "data_AIT_lvl1_20150604.csv" every ::121::600 using 3:25:43 lc    palette   title '{/Symbol l}average 20150604',\
"data1.csv" every ::121::361 using 3:25:43 lc palette title '{/Symbol l}average 20150605',\
"data2" every ::121::361 using 3:25:43 lc palette title '{/Symbol l}average 20150606',\
"data3.csv" every ::121::361 using 3:25:43 lc palette title '{/Symbol l}average 20150703',\
and so on for multple files

I like the output but I'd like to know if there's a way to improve the overlaying areas in the plot to distinguish the values better? Is there a gnuplot way to write all the data I hwant to plot from each file into one big table and plot the data from that table into a heat map. I tried a few things but somehow lost track of all my try and error steps so I thought maybe one of you could help me out with a clean approach to this.

Thanks for the answers so far I'm trying my best to specify my second question a bit more: right now I have the values of multiple days plotted in the graph, it looks good but there are parts overlapping so I can't see the values (hue) of all the days in the plot. Since in my experience, I tend to overcomplicate problems like this a bit so I decided to ask the question if there's a way to solve that. I thought maybe by putting all the days into one big table all the data is plotted on one level so I'd get a simple colored heat map. I tried Joces table solution, which works flawlessly but Joce was right, it didn't actually solve my problem. enter image description here

as you can see there's now a huge block of data, with different colors, but you can't distinguish between the different days. Alos, the gap from the first picture (between the left big purple block and the entered orange block) is gone and melted into one big block.

So I think what I'm trying to ask is if there's another better way maybe with contour to get what I want.

Upvotes: 0

Views: 419

Answers (1)

Joce
Joce

Reputation: 2342

What you ask for is

set table
set output "one_big_table"
splot "file1" using c1:c2:c3:..., \
      "file2" using C1:C2:C3:...., \
      ...
unset table

This will create as many blocks as you have files, so I am not sure your final goal will be so easy to achieve. That's a different issue though.

Upvotes: 1

Related Questions