代码之家  ›  专栏  ›  技术社区  ›  Felipe

正在努力将多个图表合并到一个图表中,并使用Gnuplot保持清晰

  •  0
  • Felipe  · 技术社区  · 4 年前

    enter image description here

    我所说的问题是,它最终会变得混乱,图表在可读性方面会显得非常肮脏。但是,也许Gnuplot为我提供了一个更好的解决方案,我仍然不知道。这是我的Gnuplot代码,可以找到数据文件 here .

    #!/usr/bin/gnuplot
    
    reset session
    
    set style line 1 lc rgb '#3274D9' lt 1 lw 1.0 ps 0.4 pt 2 pi 15 # auto-combiner input    throughput - 8combines.8reducers
    set style line 2 lc rgb '#3274D9' lt 1 lw 1.0 ps 0.4 pt 2 pi 15 # auto-combiner output   throughput - 8combines.8reducers
    set style line 3 lc rgb '#FF780A' lt 1 lw 1.0 ps 0.4 pt 2 pi 15 # static-combiner input  throughput - 8combines.8reducers
    set style line 4 lc rgb '#FF780A' lt 1 lw 1.0 ps 0.4 pt 2 pi 15 # static-combiner output throughput - 8combines.8reducers
    set style line 5 lc rgb '#E02F44' lt 1 lw 1.0 ps 0.4 pt 2 pi 15 # no-combiner input      throughput - 8combines.8reducers
    set style line 6 lc rgb '#E02F44' lt 1 lw 1.0 ps 0.4 pt 2 pi 15 # no-combiner output     throughput - 8combines.8reducers
    set style line 7 lc rgb '#008000' lt 1 lw 1.0 ps 0.4 pt 2 pi 15 # auto-combiner average processing latency         - 8combines.8reducers
    set style line 8 lc rgb '#9ACD32' lt 1 lw 1.0 ps 0.4 pt 2 pi 15 # auto-combiner 99th percentile processing latency - 8combines.8reducers
    
    set style line 9 lc rgb '#3274D9' lt 1 lw 1.0 ps 0.4 pt 1 pi 15 # auto-combiner input    throughput - 16combines.16reducers
    set style line 10 lc rgb '#3274D9' lt 1 lw 1.0 ps 0.4 pt 1 pi 15 # auto-combiner output   throughput - 16combines.16reducers
    set style line 11 lc rgb '#FF780A' lt 1 lw 1.0 ps 0.4 pt 1 pi 15 # static-combiner input  throughput - 16combines.16reducers
    set style line 12 lc rgb '#FF780A' lt 1 lw 1.0 ps 0.4 pt 1 pi 15 # static-combiner output throughput - 16combines.16reducers
    set style line 13 lc rgb '#E02F44' lt 1 lw 1.0 ps 0.4 pt 1 pi 15 # no-combiner input      throughput - 16combines.16reducers
    set style line 14 lc rgb '#E02F44' lt 1 lw 1.0 ps 0.4 pt 1 pi 15 # no-combiner output     throughput - 16combines.16reducers
    set style line 15 lc rgb '#008000' lt 1 lw 1.0 ps 0.4 pt 1 pi 15 # auto-combiner average processing latency         - 16reducers.8reducers
    set style line 16 lc rgb '#9ACD32' lt 1 lw 1.0 ps 0.4 pt 1 pi 15 # auto-combiner 99th percentile processing latency - 16reducers.8reducers
    
    set style line 17 lc rgb '#3274D9' lt 1 lw 1.0 ps 0.3 pt 5 pi 15 # auto-combiner input    throughput - 8combines.16reducers
    set style line 18 lc rgb '#3274D9' lt 1 lw 1.0 ps 0.3 pt 5 pi 15 # auto-combiner output   throughput - 8combines.16reducers
    set style line 19 lc rgb '#FF780A' lt 1 lw 1.0 ps 0.3 pt 5 pi 15 # static-combiner input  throughput - 8combines.16reducers
    set style line 20 lc rgb '#FF780A' lt 1 lw 1.0 ps 0.3 pt 5 pi 15 # static-combiner output throughput - 8combines.16reducers
    set style line 21 lc rgb '#E02F44' lt 1 lw 1.0 ps 0.3 pt 5 pi 15 # no-combiner input      throughput - 8combines.16reducers
    set style line 22 lc rgb '#E02F44' lt 1 lw 1.0 ps 0.3 pt 5 pi 15 # no-combiner output     throughput - 8combines.16reducers
    set style line 23 lc rgb '#008000' lt 1 lw 1.0 ps 0.3 pt 5 pi 15 # auto-combiner average processing latency         - 8combines.16reducers
    set style line 24 lc rgb '#9ACD32' lt 1 lw 1.0 ps 0.3 pt 5 pi 15 # auto-combiner 99th percentile processing latency - 8combines.16reducers
    
    set style line 25 lc rgb '#3274D9' lt 1 lw 1.0 ps 0.35 pt 7 pi 15 # auto-combiner input    throughput - 8combines.24reducers
    set style line 26 lc rgb '#3274D9' lt 1 lw 1.0 ps 0.35 pt 7 pi 15 # auto-combiner output   throughput - 8combines.24reducers
    set style line 27 lc rgb '#FF780A' lt 1 lw 1.0 ps 0.35 pt 7 pi 15 # static-combiner input  throughput - 8combines.24reducers
    set style line 28 lc rgb '#FF780A' lt 1 lw 1.0 ps 0.35 pt 7 pi 15 # static-combiner output throughput - 8combines.24reducers
    set style line 29 lc rgb '#E02F44' lt 1 lw 1.0 ps 0.35 pt 7 pi 15 # no-combiner input      throughput - 8combines.24reducers
    set style line 30 lc rgb '#E02F44' lt 1 lw 1.0 ps 0.35 pt 7 pi 15 # no-combiner output     throughput - 8combines.24reducers
    set style line 31 lc rgb '#008000' lt 1 lw 1.0 ps 0.35 pt 7 pi 15 # auto-combiner average processing latency         - 8combines.24reducers
    set style line 32 lc rgb '#9ACD32' lt 1 lw 1.0 ps 0.35 pt 7 pi 15 # auto-combiner 99th percentile processing latency - 8combines.24reducers
    
    set term pdfcairo size 5.0in,3.5in
    set pointintervalbox 0
    set datafile separator ','
    set output "efficiency-throughput-networkbuffer-TaxiRideNYC-500K-merged.pdf"
    set title "Efficiency evaluation: throughput vs. network buffer usage\nworkload of 500K rec/sec and different topologies" font ",16" offset 0,0.5,0
    myTimeFmt = "%Y-%m-%d %H:%M:%S"
    set xtics nomirror
    
    set key under center maxrows 1 horizontal
    set key font ",9"
    set ylabel "Throughput (K rec/sec)" font ",10" #offset 1,0,0
    set xtics font ",8" offset 0,0.5,0
    set format x "%tH:%tM" time
    set xlabel "time (hour:minute)" font ",10" offset 0,1,0
    set xrange [0:5400]
    set yrange [0:7]
    set y2label "Combiner buffer usage" font ",10" #offset -1.5,0,0
    set y2range [20:100]
    set ytics nomirror font ",10"
    set y2tics 0, 20  font ",10"
    set format y2 "%g%%"
    plot t=0 "throughput-vs-networkbuffer-500K-8combiners-8reducers-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(6)) skip 2 notitle "auto-combiner avg. buffer usage (8:8)" with linespoints ls 7 axis x1y2 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-8reducers-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(6)/1000):(column(7)/1000) skip 2 title "auto-combiner avg. buffer usage (8:8)" with yerrorbars ls 7 axis x1y2 \
    , t=0 "throughput-vs-networkbuffer-500K-16combiners-16reducers-static-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000) skip 2 notitle "static-combiner input throughput (16:16)" with linespoints ls 11 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-16combiners-16reducers-static-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000):(column(3)/1000) skip 2 title "static-combiner input throughput (16:16)" with yerrorbars ls 11 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-16reducers-static-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000) skip 2 notitle "static-combiner input throughput (8:16)" with linespoints ls 19 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-16reducers-static-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000):(column(3)/1000) skip 2 title "static-combiner input throughput (8:16)" with yerrorbars ls 19 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-24reducers-static-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000) skip 2 notitle "static-combiner input throughput (8:24)" with linespoints ls 27 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-24reducers-static-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000):(column(3)/1000) skip 2 title "static-combiner input throughput (8:24)" with yerrorbars ls 27 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-8reducers-static-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000) skip 2 notitle "static-combiner input throughput (8:8)" with linespoints ls 3 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-8reducers-static-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000):(column(3)/1000) skip 2 title "static-combiner input throughput (8:8)" with yerrorbars ls 3 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-16reducers-no-combiner-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(4)/1000) skip 2 notitle "no-combiner input throughput (8:16)" with linespoints ls 21 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-16reducers-no-combiner-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(4)/1000):(column(5)/1000) skip 2 title "no-combiner input throughput (8:16)" with yerrorbars ls 21 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-16combiners-16reducers-no-combiner-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(4)/1000) skip 2 notitle "no-combiner throughput (16:16)" with linespoints ls 13 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-16combiners-16reducers-no-combiner-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(4)/1000):(column(5)/1000) skip 2 title "no-combiner throughput (16:16)" with yerrorbars ls 13 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-24reducers-no-combiner-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(4)/1000) skip 2 notitle "no-combiner input throughput (8:24)" with linespoints ls 29 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-24reducers-no-combiner-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(4)/1000):(column(5)/1000) skip 2 title "no-combiner input throughput (8:24)" with yerrorbars ls 29 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-8reducers-no-combiner-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(4)/1000) skip 2 notitle "no-combiner throughput (8:8)" with linespoints ls 5 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-8reducers-no-combiner-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(4)/1000):(column(5)/1000) skip 2 title "no-combiner throughput (8:8)" with yerrorbars ls 5 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-16combiners-16reducers-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000) skip 2 notitle "auto-combiner input throughput (16:16)" with linespoints ls 9 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-16combiners-16reducers-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000):(column(3)/1000) skip 2 title "auto-combiner input throughput (16:16)" with yerrorbars ls 9 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-8reducers-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000) skip 2 notitle "auto-combiner input throughput (8:8)" with linespoints ls 1 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-8reducers-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000):(column(3)/1000) skip 2 title "auto-combiner input throughput (8:8)" with yerrorbars ls 1 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-16reducers-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000) skip 2 notitle "auto-combiner input throughput (8:16)" with linespoints ls 17 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-16reducers-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000):(column(3)/1000) skip 2 title "auto-combiner input throughput (8:16)" with yerrorbars ls 17 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-24reducers-all.csv" u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000) skip 2 notitle "auto-combiner input throughput (8:24)" with linespoints ls 25 axis x1y1 \
    , t=0 "throughput-vs-networkbuffer-500K-8combiners-24reducers-all.csv" every 10 u (t==0?(t0=timecolumn(1,myTimeFmt),t=1):NaN, timecolumn(1,myTimeFmt)-t0):(column(2)/1000):(column(3)/1000) skip 2 title "auto-combiner input throughput (8:24)" with yerrorbars ls 25 axis x1y1 \
    

    谢谢你的建议!

    0 回复  |  直到 4 年前
        1
  •  1
  •   Felipe    4 年前

    fence plot constructed with separate parametric surfaces 属于 Gnuplot 3D带 splot 可获得的 here .

    enter image description here