Show Y Label in groups with Gnuplot Show Y Label in groups with Gnuplot bash bash

Show Y Label in groups with Gnuplot


Here is a modification of your script that might do what you want, if I understand you correctly:

set title "Memory Latency Benchmark (Stride 512)"set xlabel "Memory Depth (MB)"set ylabel "Latency (ns)"set xtics rotate by 45 offset 0,-1set xtics font "Times-Roman, 8"set grida = ""; p = 0; nn = 1; nt = 37; d = 4; s = 0f(x) = (x>p+d || nn >= nt)?(nn=nn+1, p=x, a=a." ".sprintf("%5.2f", s/n), n=1, s=x):(nn=nn+1, p=x, s=s+x, n=n+1)plot "lat_mem_rd.dat" using 1:(f($2)) # Just to set array "a"set ytics 0,0,0set yrange [0:90]set for [aa in a] ytics add (aa aa)set style line 1 lc rgb '#0060ad' lt 1 lw 2 pt 7 ps 1   # --- blueset terminal pngset output "lat_mem_rd.png" plot "lat_mem_rd.dat" using (log($1)):2:xtic(1) smooth unique title "" with linespoints ls 1

This script produces this plot:

enter image description here

The strategy is to accumulate a sum of Y-values and calculate an average every time the Y-value increases by at least an amount d; these averages are stored in a string variable "a", which is looped over to set the ytic values before the final plot command. This way clusters of closely-spaced Y-values give rise to a ytic at their average value; I think that was what you wanted.