I have two sets of points: “test1.dat” and “test2.dat”, they do not share same X-values.
I want to draw two smooth lines first due to the data is noisy, and
then draw a filledcurve between the smooth lines.
I’ve read the tutorial, and cannot find the answer.
piggy-backing off of Raphael Roth’s answer and looking at the gnuplot documentation, you can probably achieve this with a little shell magic for datasets that don’t share X values as well.
One thing that I noticed when testing this out is that you should make sure that you have a newline at the end of test2.dat, otherwise
tail -rwon’t work correctly (tacwould probably work too, but it isn’t installed on my Mac. This works taking the first datafile and appending the second datafile to the first one in reverse. (I am assuming the first and second datafiles are already ordered using ascending X values). In other words, as far as gnuplot is concerned, the data is ascending in x then descending in x. Since we usedwith filledcurves closedgnuplot treats all the points as a single polygon and then connects them. As far as smoothing the data, that is another question entirely. Just looking at the documentation, gnuplot offers a few smoothing algorithms, but they’ll need to be used on your data ahead of time. The following is completely untested, but hopefully will be something similar to what you want (it will also probably only work in a unix type environment) …If it doesn’t work, take a look at the gnuplot generated files “smoothed1” and “smoothed2” and see if that gives you any hints (e.g. are there extra newlines that should be removed?)