Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Discontinuities in fill plot

841 views
Skip to first unread message

cschwan

unread,
Nov 18, 2011, 5:36:45 AM11/18/11
to
Hello,

I am using Gnuplot 4.4.3 together with the lua+tikz terminal.
Everything is working fine except that my filled plot shows
discontinuities; one can see very small vertical white lines in the
plot [1]. I hope thats not intended by the fill plot, does anyone know
how to fill them ? I am using the following commands:

set xlabel 'Monte Carlo Steps $N$'
set ylabel 'Squared amplitude $\frac{1}{N} \sum_{i = 1}^N | \mathcal{A}
_i |^2$'
set logscale x
set nokey

set multiplot
set bar 0
set zeroaxis

set style fill transparent solid 0.5 noborder

plot 'data/6gluons_helicity_sampling.out' using 1:($2-$3):($2+$3) with
\
filledcurve, 2.4279722369399930 with lines linetype 1 linecolor 3

set origin 0.55, 0.55
set size 0.4, 0.4

set xrange [1e5:1e6]

unset xlabel
unset ylabel

replot


[1] http://www.students.uni-mainz.de/cschwan/main2.pdf

Oliver Jennrich

unread,
Nov 18, 2011, 5:42:11 PM11/18/11
to
cschwan <csc...@students.uni-mainz.de> writes:

> Hello,
>
> I am using Gnuplot 4.4.3 together with the lua+tikz terminal.
> Everything is working fine except that my filled plot shows
> discontinuities; one can see very small vertical white lines in the
> plot [1]. I hope thats not intended by the fill plot, does anyone know
> how to fill them ?

...

>
> set style fill transparent solid 0.5 noborder

My first guess would be the 'noborder'. If you tell gnuplot, not to plot
borders, it won't do it. When plotting data, small trapezoids seem to be
filled, defined by neighboring data points. If you don't set borders,
those trapezoids will have gaps between them.

Having said that, a quick try with another data file (and gp 4.5) did not show that
problem. Which brings me to a point of procedure: nobody here can check
upon your problem, as we don't have (and really don't want) your data
file. Create a *minimal* file that shows your problem - in many cases
you will find the problem while creating the minimal file.

--
Space - The final frontier

cschwan

unread,
Nov 20, 2011, 5:21:43 AM11/20/11
to
Thank you for your answer and sorry for not providing a minimal
example. I checked 'noborder', but this seems not to be a problem.
Using data from [1] and the following example:

#set terminal lua tikz standalone
#set output 'minimal.tex'
set logscale x

plot 'data' using 1:($2-$3):($2+$3) with filledcurve

I observed that it works fine in the x11 and png terminal. If I use
the lua terminal with tikz (by uncommenting the first and second line)
the problem appears again. Any ideas?

[1] http://www.students.uni-mainz.de/cschwan/data

Christoph Bersch

unread,
Nov 24, 2011, 9:44:44 AM11/24/11
to
The same happens with 'set terminal postscript eps', as far as I
remember, this is a long standing problem related to antialiasing
problems of some viewer and ghostscript (tested here with GPL
Ghostscript 8.71 (2010-02-10)). I don't know if there is any solution.

The pdf-file produced with "terminal lua tikz" + pdflatex looks good
with Acrobat Reader 9, but not with xpdf, evince, okular.

The pdf files produced with "terminal pdfcairo" shows lines in all four
viewer, the same with the pdf file produced with "terminal postscript
eps" + epstopdf (uses ghostscript).

So, this is not a solution, but an extended problem description. I think
there is nothing which can be done from the gnuplot side, here.

Christoph

marcell...@gmail.com

unread,
Jan 13, 2014, 8:41:22 PM1/13/14
to
The problem disappears when instead of plotting with a filledcurve style, you explicitly define a polygon with the "set object" command.

set object 1 polygon fc rgb 'red' front \
from 0 , 0.0886798 \
to 0.01 , 0.0938408 \
to 0.02 , 0.0990018 \
# ... add more points as you please

plot 'something'

The "set object" man page is of great help.

You cannot use the same data file this way, but if you have a program that generates your data, then you can easily modify it a little to output the polygon object for you. Or you can use a macro or search and replace with regular expressions to modify your data file to polygon object syntax.

dkea...@gmail.com

unread,
Mar 2, 2015, 9:12:59 AM3/2/15
to
This seems like an old question, but I had the same issue. I think the suggestion to draw a polygon is a good one. However, I found that this is actually what happens when you use filledcurves to fill a region between the x-axis and a single curve, so this is not an issue for one curve. However, if you are trying to fill between two curves with the notation suggested by most demo scripts as shown here (i.e. plot ... using 1:2:3 ...), it uses a bunch of separate trapezoids rather than one solid polygon. You can see this by making the sampling larger. The issue seems to be that tikz is always making a very find border that has a slightly different color than the transparent fill.

I found the solution to be in the end to plot one vector where each point is a vertex of the polygon that would fill between the curves. In other words, the vector sarts by specifying all of the x-y points of the top curve, moving from left to right in x, followed by all of the x-y points of the bottom curve, moving from right to left. Then just plot this one vector with plot ... using 1:2 ... This makes one polygon with a single face so you don't have this stitching/border error between a bunch of separate polygons.
0 new messages