- status: open --> closed-accepted
Patch #824 introduced changes allowing the "hsteps" style to use "set boxwidth" setting, but it did not fully address cases where the bins filter is applied. This patch modifies the behavior so that even when the bins filter is used, the "hsteps" style can still respect the width setting specified by "set boxwidth".
When the bins filter is applied, the number of members in each bin is stored in "points[i].z". However, "plot_hsteps()" expects "points[i].z" to represent the width of each segment. Since the bins filter provides invalid data in "points[i].z" as the width, this caused incorrect handling of the "set boxwidth" setting.
This patch ensures that when the bins filter is applied, "plot_hsteps()" no longer uses "points[i].z" for determining the segment width.
Here is a sample script:
set print $random
do for [i=1:100] {
k = int(10*rand(0))+1
if (k < 4) {
print "a"
} else {
print "b"
}
}
unset print
set xrange [0:3]
set yrange [0:100]
set xtic ("a" 1, "b" 2)
set boxwidth 0.6 relative
set title "set boxwidth 0.6 relative"
plot $random using ((strcol(1) eq "a") ? 1 : 2) bins=2 with hsteps pillar
pause -1
set boxwidth 1.5
replot
pause -1