Reputation: 43
I have 1000 x 4 data having float values between [0, 100]. How can I create comparison heat map for this data in gnuplot?
I have tried the demo version of heatmap example on Gnuplot. However, I could not find my answer from it.
The data looks like this:
And what I want to show comparison of each columns(sorted) in heatmap.
For example:
Upvotes: 0
Views: 175
Reputation: 15143
As I understand it you want to treat the columns individually rather than treating the whole thing as a matrix. The following gnuplot commands will do that:
unset xtics
unset ytics
unset border
set bmargin screen 0.1
set key samplen -1
set style fill solid
set palette defined (0 "forest-green", 1 "goldenrod")
plot for [col=1:4] 'data' \
using (col):0:(0.45):(1.0):col with boxxy \
lc palette title columnhead(col) at first col, graph -0.05
Notes:
You mention sorting but it is not clear exactly what you want. If the idea is to sort the values within each column prior to plotting, I think that will have to be done by invoking a system command. On linux this could be done by replacing the first line of the plot command with something like:
plot for [col=1:4] sprintf("<sort -n -k %d data",col) \
etc
Upvotes: 2