Gabriel Dupras - 2021-02-06

This can be done with bins. The width of each bin is 1 day or 60*60*24 seconds.

set style data lines
set xdata time
set timefmt "%Y-%m-%d"
set xrange ["2020-05-02":"2020-05-18"]
set yrange [0:5]
plot 'sample2.txt' using 1:2 bins binwidth=60*60*24