How can I plot a smoothed curve as well as raw data?

I want to add markers to some of my graphs using pointtype

. If I plot the data like this:

plot "somedata.txt" w linespoint pointtype 6 

      

or a function like this:

plot cos(x) pointtype 6

      

I get exactly what I want: a line between the marker and all data points. Now I want to achieve the same, but after "flattening" the dataset with smooth bezier

:

plot "somedata.txt" w linespoint pointtype 6 smooth bezier

      

However pointtype

, it doesn't seem to do anything. I can install linecolor

, linewidth

and linetype

as before, but not pointtype

.

Does anyone know of a job that can still create markers on top of an antialiased plot?

+3


source to share


2 answers


I have the same problem that gnuplot is not plotting points on top of a smooth curve. I am guessing that since gnuplot is displaying a function derived from data points, it doesn't hurt to put point markers on top of the original data points

Note that the bezier curve does not necessarily overlap the original data points.



My workaround would involve plotting the data twice in different ways:

plot 'data.txt' with points title 'original data', \
  '' smooth bezier title 'smoothed data'

      

+1


source


I agree with @andyras. I have had this problem for several weeks and I could not find a way to put both the smoothed curve and the data. So I plotted two series, one with a smoothed curve and the other just for points.



Edit: Sorry for adding a new answer. I am on my phone and cannot find a way to comment on @ andyras answer

0


source







All Articles