The following code using silver.dat from demo directory of the 5.2 tarball as data source will create wrong fillings with gnuplot 5.2.0 while same code worked well with gnuplot 5.0.7:
set terminal png size 1280,720
set output "silver.png"
set title "Fill area between two curves (above/below)"
set style fill solid 1.0 noborder
set xrange [250:500]
set auto y
plot 'silver.dat' u 1:2:(12.0) w filledcurves above title 'Above', \
'' u 1:2:(10.0) w filledcurves below title 'Below', \
'' u 1:2 lt 2 lw 2 title 'curve 1', \
'' u 1:(10.) lt 3 lw 2 title '10', \
'' u 1:(12.) lt 3 lw 2 title '12'
Diff:
Same problem in 5.3.0 from cvs downloaded a few minutes ago.
Added Files showing problem:
silver.dat: Data file from gnuplot source
silver.dem: gnuplot directives for generating the graph
silver_5.0.7.png: Graph generated with gnuplot 5.0.7
silver_5.2.0.png: Graph generated with gnuplot 5.2.0
Weird. It behaves correctly for "below y=10.1" and "below y=9.8" but messes up at exactly "below y=10.0". I suppose that's a hint to something!
I don't think that exactly y=10 is the problem because a user of the german linux server distribution "eisfair", where I'm maintaining the gnuplot package for, gave me an example in which "below y=20.0" did not work similar to my example. As test I tried to make it reproducable using data an examples from the gnuplot source. It was accidental that I used a value of 10.
Sure. I'm not saying that 10 is a magical bad number. The issue seems to be that if a "below" region starts at a point whose y value is exactly on the limit (rather than slightly below it) the entire region is missed. I.e. there is a test somewhere in the code that is essentially "if (y < limit)" instead of "if (y <= limit)".
The 'silver.dat' data has several points with y=10, so it demonstrates the problem if you set the limiting value to exactly 10.
I think I have a fix
If it tests out OK the fix will be included in release 5.2.1, expected soon.
Perfect analysis; I have tested your theory with the data and directives from the user I have spoken about in my previous statement.
The problem disappears when setting the below and above boundaries to values not appearing in the data.
Last edit: Marcus Roeckrath 2017-10-25
Hi Ethan,
the fix seams to have side effects which I was informed about by an user of my gnuplot package on eisfair, which I updated to gnuplot 5.2.1 yesterday.
Here the files showing the problem:
plottest_below_above: the directives including data
plottest_below_above_5.0.7.png: below is filled perfect with filledcurves
plottest_below_above_5.2.0.png: below isn't filled
plottest_below_above_5.2.1.png: below fills a triangle
If y=20.01 on filledcurves below on 5.2.1 all works as expected.
Last edit: Marcus Roeckrath 2017-10-30
Oh dear.
Here's another patch on top of the one that went into 5.2.1.
I'm not sure what to do about fixing it in the release package. The code repository is still frozen while people work on converting development to git.
Thanks Ethan, I applied the patch and the plottest_below_above now creates an accurate graphic.
Hi Ethan,
I'm missing these patches in the master repo so that the bug will reappear in the developer version 5.3.
The repository on SourceForge is in the process of being converted from CVS to git. Normal development is on hold until the dust settles. I am pessimistically estimating mid-December but maybe I'll be pleasantly surprised.
Ok, I saw that you have made commits to both the 5.2 and the master tree so that I feared this patches could have been forgotten in the master.