|
From: Baptiste <bap...@er...> - 2013-03-29 08:35:41
|
Hi all,
I am a new user of Gnuplot, and I would like to draw a Heat Map.
My original data are a 41x41 matrix where each line and row represent a
country and the value of the matrix are numeric value.
Such as:
Country1 Country2 …. CountryN
Country1 Z11 Z12 ….. Z1N
Country2 Z21 Z22 ….. Z2N
…
CountryN ZN1 ZN2 ….. ZNN
I have already succeed in some steps but I still have some problems.
Here, what I have already done:
cd '/dir/'
set xrange [0.5:41.5]
set yrange [0.5:41.5] reverse
set xtics ("AUS" 1,"AUT" 2,"BEL" 3,"BGR" 4,"BRA" 5,"CAN" 6,"CHN" 7,"CYP"
8,"CZE" 9,"DEU" 10,"DNK" 11,"ESP" 12,"EST" 13,"FIN" 14,"FRA" 15,"GBR"
16,"GRC" 17,"HUN" 18,"IDN" 19,"IND" 20,"IRL" 21,"ITA" 22,"JPN" 23,"KOR"
24,"LTU" 25,"LUX" 26,"LVA" 27,"MEX" 28,"MLT" 29,"NLD" 30,"POL" 31,"PRT"
32,"ROM" 33,"RUS" 34,"SVK" 35,"SVN" 36,"SWE" 37,"TUR" 38,"TWN" 39,"USA"
40,"RoW" 41)
set ytics ("AUS" 1,"AUT" 2,"BEL" 3,"BGR" 4,"BRA" 5,"CAN" 6,"CHN" 7,"CYP"
8,"CZE" 9,"DEU" 10,"DNK" 11,"ESP" 12,"EST" 13,"FIN" 14,"FRA" 15,"GBR"
16,"GRC" 17,"HUN" 18,"IDN" 19,"IND" 20,"IRL" 21,"ITA" 22,"JPN" 23,"KOR"
24,"LTU" 25,"LUX" 26,"LVA" 27,"MEX" 28,"MLT" 29,"NLD" 30,"POL" 31,"PRT"
32,"ROM" 33,"RUS" 34,"SVK" 35,"SVN" 36,"SWE" 37,"TUR" 38,"TWN" 39,"USA"
40,"RoW" 41)
set datafile separator ";"
set pm3d map
set view map
splot '/file/.csv' matrix with image
But, I have two problems:
1) In the output file (below), it misses the first line and row of the
matrix, and the mapping between the content of the matrix (Zx,y) and the
countries is then shifted from one line and one row.
2) I would like to defined intervals for the palette colour according to the
value of the records. For instance, if the value of Zx,y is inferior to 1 so
in green, if Zx,y between 1 and 2 so in white, etc…
I have tried several things but these problems remain.
Thanks in advance
<http://gnuplot.10905.n7.nabble.com/file/n17220/EMCONS_96.png>
PS: Sorry for the English, I am French.
--
View this message in context: http://gnuplot.10905.n7.nabble.com/Heat-map-line-and-row-shift-problem-tp17220.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|