1
votes

I'm having trouble with Gnuplot filledcurve showing gaps. I'm on Version 4.6 patchlevel 5 as supplied with Fedora.

Here's what I am doing:

    - Generate a table of smoothed values like so:
set table 'smoothedhdata'
plot 'data_file' using 1:2 smooth cspline
unset table
    - Unset the table, set output, set multiplot, set yrange
    - Plot:
plot 'smootheddata' using 1:2 with filledcurves x1 lc rgb "forest-green" title "Some Title";

The problem that arises is, that there are a few values in the data, that are above of the area limited by the yrange. For those values, there are gaps in the output using pngcairo, as well as using svg. Maybe this is trivial for someone more familiar with gnuplot, however I have so far not found a solution. Has anyone seen this behaviour and knows a workaround or is this likely a bug somewhere in Gnuplot?

    - Here's a plot showing a few of those gaps in the green graph:

Here's a plot showing a few of those gaps in the green graph

1

1 Answers

1
votes

Gnuplot version 4.6 has some problems with proper clipping of filled areas. Possibly this is what makes problems. Version 5.0 has reworked clipping, so could be that the newer version works fine (cannot test it since I have no test data).

Alternatively you might try to manually clip the values in the using statement. This should work since you plot your data twice anyway and you have the precomputed yrange limits (or you use your custom yrange values for ymin and ymax):

set table 'smoothedhdata'
plot 'data_file' using 1:2 smooth cspline
unset table

ymax = GPVAL_Y_MAX
ymin = GPVAL_Y_MIN
clip(y) = (y < ymin ? ymin : (y > ymax ? ymax : y))

plot 'smootheddata' using 1:(clip($2)) with filledcurves x1 lc rgb "forest-green" title "Some Title"