0

Using Gnuplot, I tried to fill the surface between a discrete gaussian and the x-axis: the problem comes when the gaussian is cut from the bounds parallel to the y-axis. This is the result:The ugly effect

The code (splitted in two files):

set terminal pngcairo 
set xrange [0:1]
set yrange [0:1.2]


########
set border linewidth 1.5
# Axes
set style line 11 lc rgb '#808080' lt 1
set border 3 back ls 11
set tics nomirror out scale 0.75
# Grid
set style line 12 lc rgb'#808080' lt 0 lw 1
set grid back ls 12
########

#set style fill transparent solid 0.5 noborder
set style function filledcurves below x1=0
set clip two

plot '../results/free' u 1:t w filledcurves below lc rgb "forest-green"  notitle

Any suggestion to avoid that?

0

You don't give any source or tell us what you tried, but:

The filledcurves style is only relevant to 2-d plotting. Three variants are possible. The first two variants require either a function or two columns of input data, and may be further modified by the options listed below. The first variant, closed, treats the curve itself as a closed polygon. This is the default.

The second variant is to fill the area between the curve and a given axis, a horizontal or vertical line, or a point.

http://gnuplot.sourceforge.net/docs_4.2/node245.html#5596

"Second variant" means option {above | below} (e.g. plot ... with filledcurves below)

  • The commands: set style function filledcurves below x1=0 plot '../results/free' u 1:t w filledcurves below lc rgb "forest-green" notitle I added below but it doesn't seem to work... – Gabriele Mar 16 '16 at 19:43
  • @Gabriele: try "set style function filledcurves below x1" – Yorik Mar 16 '16 at 20:27
  • still not working... – Gabriele Mar 17 '16 at 17:15
  • you need to remove the "=0" ( plotshare.com/index.ws/plot/139136922 ) – Yorik Mar 17 '16 at 20:46
  • I did so and it isn't working still: the problem isn't with a generic function as you did, but when plotting data, and only at borders. – Gabriele Mar 30 '16 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.