Smoothing your data
As an option to the plot
command, gnuplot offers several smoothing functions. The name smooth is a bit misleading. Included in the options for the smooth
plotstyle are several ways to process your data that would not most naturally be described as smoothing. We give examples of some of these in the following recipes. In the current recipe we show how to use the smoothing option that seems to be most immediately useful if you have some noisy data and want to draw a qualitatively smooth curve through it, to, as they say, guide the eye.
Getting ready
This recipe uses the datafile rs.dat
; make sure that it is in your current directory. This file contains two columns that are the x and y coordinates of a simple sine wave of frequency and amplitude 1
to which normally distributed random data centered on 0
is added; that is, a sine curve plus the type of noise that might arise from actual measurements. In the following figure, we have a plot of the noisy sine wave, plotted with...