|
From: Valerio S. <val...@gm...> - 2016-04-22 16:43:48
|
Help everyone, following Ethan advice, i've tried to simply the .gp file. Now it looks like this: set term pdfcairo set output "macrobench_latency_heat.pdf" load "../styles.inc" set size 0.9,1.0 set lmargin 20 set rmargin 20 set palette defined (0.0 "white", 1.0 "blue") set tic scale 0 set cblabel "Latency (ms)" set datafile separator comma plot\ "heatmap_latencies_handmade.txt" matrix rowheaders columnheaders u 1:2:3 with image notable Now, how do I show you the result ? I've uploaded it here http://postimg.org/image/sssos6q9j/full/ but here, it shows it something that is completely different from the PDF that I see, in which the cells are smoothed/interpolated...for some reason.. Ideas? -- Valerio On Fri, Apr 22, 2016 at 5:50 PM, sfeam <sf...@us...> wrote: > On Friday, 22 April 2016 09:46:50 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 ? > > Most of those commands are irrelevant to what you want. > This is not a 3D surface, so you don't need "splot". > The colors are categorical, not smoothed, so you don't want pm3d. > Disregarding labels, it is sufficient to say > > set datafile separator comma > set palette defined (0.0 "white", 1.0 "blue") > plot "heatmap_latencies.txt" matrix rowheaders columnheaders with image > > > Ethan > |