|
From: Daniel J S. <dan...@ie...> - 2016-04-22 16:02:49
|
On 04/22/2016 02:46 AM, Valerio Schiavoni wrote: > Hello, > i've been trying to make an heat map that looks like the one in this > blog entry > https://learnr.wordpress.com/2010/01/26/ggplot2-quick-heatmap-plotting/ > Unfortunately they don't use gnuplot. > > My attempt so far produces a poor result, i think because I'm not using > the right approach. > > Here's my current version: > > set term pdfcairo > set output "latency_heat.pdf" > load "../styles.inc" > set size 0.9,1.0 > set lmargin 15 > set rmargin 20 > set pm3d #interpolate 0,100 > set view map scale 1 > set style func pm3d > set style data pm3d; > set dgrid3d > set pal defined ( 0 0 0 0, 1 1 1 1 ) > set tic scale 0 > set cblabel "Latency (ms)" > set datafile separator comma > splot "heatmap_latencies.txt" matrix rowheaders columnheaders using > 1:2:3 with image title "" > > Where the input file is: > > ,One,Two,Three > a,675.0, 1177.0, 1975.0 > b,744.0, 13908.0, 20191.0 > c,1767.0, 4374.0 ,5165.0 > d,678.0, 1101.0 ,1888.0 > e, 771.0, 13842.0 ,18648.0 > f, 1372.0, 4264.0 ,5187.0 > g,753.0 , 1541.0 ,1729.0 > h,791.0 , 5832.0 ,20528.0 > i,1310.0, 1225.0 ,5436.0 > l,747.0, 1516.0 ,2118.0 > m,825.0 , 16719.0 ,0 > n,1341.0, 4427.0 ,9040.0 > > > Any idea on how to improve this ? > > Thanks ! > -- > Valerio You are trying to do something like the blue-tinted images Valerio? What I see from your example is a greyscale which is sort of the right idea, and I think you should be able to achieve most of the other properties in those blue-tinted images. You can 1) Change the color map (palette) from greyscale to one that has the blue tint. (And perhaps there is already a predefined color map that is close.) http://gnuplot.sourceforge.net/demo_5.0/heatmaps.html 2) Apply a non-90 degree rotation to the x-axis annotation. http://gnuplot.sourceforge.net/demo_5.0/tics.html 3) Draw individual white lines across the axes to create the borders between individual elements. http://gnuplot.sourceforge.net/demo_5.0/rgb_variable.html Look through some of the demos here for ideas: http://gnuplot.sourceforge.net/demo_5.0/ http://gnuplot.sourceforge.net/demo_5.1/ Dan |