Hello,
I have found a problem when using "smooth bezier" (mat be a bug?) and I appreciate any help:
Let us assume the following set of data
1 1.5
2 2
3 3.5
I wish to make the following plot with these data
plot [0:4][0:-4] 'file.dat' using 1:(-$2) with lines
so that the ylabel -4 is at the top of the graphic.
This works ok. But now, if I try to smooth the line
plot [0:4][0:-4] 'file.dat' using 1:(-$2) smooth bezier
I do not get any plot. Why?
The problem seems to be related to setting the interval as [0:-4]. I have tried
plot [0:4][-4:0] 'file.dat' using 1:(-$2) smooth bezier
and it works ok.
Any help, please?
Thanks
Francisco
Similar problem with smooth cspline. It seems to be an issue of the smooth option
Three points are not enough to define a cubic or Bezier spline. Do you really only have 3?
As to the x and y ranges, I strongly suggest not to place these in-line in the plot command.
Set them separately:
set xrange [0:4]
set yrange [-4:0]
plot 'file'....
Thank you for your reply. My file of data actually contains many points.
I have tried your suggestion of defining the xrange and yrange outside the plot command, but the results is the same.
I can reproduce some strangeness when the y range limits are given as [0:-4]. I am not certain what is going on here but there is probably an easy work-around.
Please try the following commands:
set xrange [0:4]
set yrange [:] reverse
plot 'file.dat' using 1:(-$2) smooth bezier
Another possibility is to use the "smooth mcs" option, which does not appear to be affected by this strangeness.
Thank you again for your suggestion.
Unfortunately, the "reverse" flag has no effect if the axis is not autoscaled. And in my particular case, I needed to set a specific yrange.
Yes, as you said, the "smooth mcs" option works fine. A bit strange...
I found a cleaner work-around.
Plot as you were originally. The plot will be blank. Now type "refresh". This will cause the program to use the curve already calculated but recheck the inrange/outrange status of every point before redrawing the plot. This recheck fixes the original error.
Thank you very much for this work-around!
It works perfectly. It is necessary to define the xrange and yrange intervals with the set command (not within the plot command), but it is perfect solution to my problem.
Thank you again for all your help.