From b7318fb12418a81a7de829ebec21cefd5698dffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Fri, 28 Jun 2019 00:00:00 +0000 Subject: [PATCH] bst_vst_heap_vs_hashmap: make graph beautiful --- bst-vs-heap-vs-hashmap-gem5-stats | 1 + bst-vs-heap-vs-hashmap.gnuplot | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/bst-vs-heap-vs-hashmap-gem5-stats b/bst-vs-heap-vs-hashmap-gem5-stats index 7662d3f..a33d42a 100755 --- a/bst-vs-heap-vs-hashmap-gem5-stats +++ b/bst-vs-heap-vs-hashmap-gem5-stats @@ -11,6 +11,7 @@ class Main(common.LkmcCliFunction): }, description='''\ Convert a BST vs heap stat file into a gnuplot input +https://github.com/cirosantilli/linux-kernel-module-cheat#bst-vs-heap-vs-hashmap ''', ) diff --git a/bst-vs-heap-vs-hashmap.gnuplot b/bst-vs-heap-vs-hashmap.gnuplot index 5137ee7..5f21964 100755 --- a/bst-vs-heap-vs-hashmap.gnuplot +++ b/bst-vs-heap-vs-hashmap.gnuplot @@ -1,11 +1,22 @@ #!/usr/bin/env gnuplot +# https://github.com/cirosantilli/linux-kernel-module-cheat#bst-vs-heap-vs-hashmap +# +# A stacked plot with a single xlabel as shown at: +# +# * https://tex.stackexchange.com/questions/346882/creating-an-equally-distributed-multiplot-with-gnuplottex +# * http://gnuplot.sourceforge.net/demo_canvas_5.2/layout.html +# +# would be even nicer, but it was hard to get right, and this +# is pretty good already. + set terminal png noenhanced size 800, 1400 set output input_noext . ".tmp.png" set multiplot layout 5,1 title "\nC++ Heap vs BST vs Hash map insert time" font ",22" -set xlabel "container size" -set ylabel "insert time (ns)" +set lmargin 12 +set label "Insert time (ns)" at screen 0.05,0.5 center front rotate font ",16" set title font ",16" +set format y "%5.0f" set title "Heap (std::priority_queue)" plot input_noext . ".dat" using 1:2 notitle @@ -22,6 +33,7 @@ set title "Hash map (std::unordered_set)" set yrange [*:*] plot input_noext . ".dat" using 1:4 notitle -set title "Hash map zoom" +set xlabel "Container size" font ",16" +set title "Hash map (zoom)" set yrange [0:hashmap_zoom_max] plot input_noext . ".dat" using 1:4 notitle