我每隔10分钟收集一次温度数据,并绘制最近三天的温度数据。目前,我正在使用xrange
来限制情节的范围。这是正确的方法吗?我担心gnuplot会在内部为文件中的所有数据创建一个图表,并显示范围内的数据。当我有数月的数据时,这可能会成为一个问题。
这是gnuplot代码:
#!/opt/local/bin/gnuplot
# Make PNG for iPhone
set terminal pngcairo enhanced background "#000000" font "Lato-Light,20" linewidth 1 rounded size 1366,660
set output "/Users/steve/Documents/Temperature History/temperatureHistory.png"
dataFileHistory = "/Users/steve/Documents/Temperature History/Temperature History.csv"
set datafile separator ','
set xdata time
# create function to ignore first four characters of time string
# http://stackoverflow.com/questions/26793373/how-to-ignore-timezone-in-csv-data
timefmt = "%b %d %H:%M:%S %Y"
timeval(s) = strptime(timefmt, substr(s, 5, strlen(s)))
set border linetype rgb "#666666"
set boxwidth 0.25 relative
set key off
#set style fill transparent solid 1
set style fill solid 1
set style line 1 linetype rgb "#666666" lw 2 #outside
set style line 2 linetype rgb "#990099" lw 3 #bedroom
set style line 3 linetype rgb "#999900" #upstairs
set style line 4 linetype rgb "#0055DD" #downstairs
set style line 5 linetype rgb "#666666" #grid
# X Axis
endTime = time(0) - 7*60*60 #Adjust for time zone
startTime = endTime-72*60*60
set xtics 6*60*60 format "%l %p" nomirror
set xrange [startTime:endTime]
# Y Axis
set ytics format "%2.0f°" nomirror
set grid ytics linestyle 5
plot dataFileHistory using (timeval(strcol(1))):2 with lines linestyle 1, \
dataFileHistory using (timeval(strcol(1))):3 with lines linestyle 2, \
dataFileHistory using (timeval(strcol(1))):4 with lines linestyle 3, \
dataFileHistory using (timeval(strcol(1))):5 with lines linestyle 4
# Make PNG for iPad
set terminal pngcairo enhanced background "#000000" font "Lato-Light,20" linewidth 1 rounded size 2048,689
set output "/Users/steve/Documents/Temperature History/temperatureHistory-iPad.png"
plot dataFileHistory using (timeval(strcol(1))):2 with lines linestyle 1, \
dataFileHistory using (timeval(strcol(1))):3 with lines linestyle 2, \
dataFileHistory using (timeval(strcol(1))):4 with lines linestyle 3, \
dataFileHistory using (timeval(strcol(1))):5 with lines linestyle 4
以下是数据样本:
Fri Jul 3 10:20:01 2015, 75.1, 80.0, 80.0, 75.0
Fri Jul 3 10:30:01 2015, 76.1, 80.0, 80.0, 75.0
Fri Jul 3 10:40:01 2015, 77.3, 80.0, 80.0, 75.0
Fri Jul 3 10:50:01 2015, 78.5, 80.0, 80.0, 75.0
Fri Jul 3 11:00:01 2015, 79.5, 80.0, 80.0, 75.0
Fri Jul 3 11:10:01 2015, 80.2, 80.0, 80.0, 75.0
Fri Jul 3 11:20:02 2015, 80.6, 80.0, 80.0, 75.0
Fri Jul 3 11:30:01 2015, 80.6, 80.0, 80.0, 75.0
Fri Jul 3 11:40:01 2015, 81.5, 81.0, 80.0, 75.0
Fri Jul 3 11:50:01 2015, 81.2, 81.0, 80.0, 75.0
Fri Jul 3 12:00:01 2015, 82.2, 81.0, 80.0, 75.0
Fri Jul 3 12:10:00 2015, 83.3, 81.0, 81.0, 75.0
Fri Jul 3 12:20:00 2015, 83.1, 81.0, 81.0, 75.0
Fri Jul 3 12:30:00 2015, 82.9, 81.0, 81.0, 75.0
Fri Jul 3 12:40:00 2015, 83.4, 81.0, 81.0, 75.0
Fri Jul 3 12:50:00 2015, 84.2, 81.0, 81.0, 75.0
Fri Jul 3 13:00:01 2015, 84.6, 81.0, 81.0, 75.0
Fri Jul 3 13:10:00 2015, 85.4, 81.0, 82.0, 75.0
Fri Jul 3 13:20:00 2015, 86.5, 81.0, 82.0, 75.0
Fri Jul 3 13:30:00 2015, 87.5, 81.0, 82.0, 75.0
Fri Jul 3 13:40:00 2015, 89.7, 81.0, 82.0, 75.0
Fri Jul 3 13:50:00 2015, 90.5, 81.0, 82.0, 75.0
Fri Jul 3 14:00:01 2015, 91.3, 81.0, 82.0, 75.0
Fri Jul 3 14:10:01 2015, 91.9, 82.0, 83.0, 75.0
Fri Jul 3 14:20:01 2015, 92.8, 82.0, 83.0, 75.0
Fri Jul 3 14:30:01 2015, 93.5, 82.0, 83.0, 75.0
Fri Jul 3 14:40:01 2015, 93.8, 82.0, 83.0, 75.0
Fri Jul 3 14:50:01 2015, 93.6, 82.0, 83.0, 75.0
Fri Jul 3 15:00:01 2015, 94.2, 83.0, 84.0, 75.0
Fri Jul 3 15:10:01 2015, 94.5, 83.0, 84.0, 75.0
Fri Jul 3 15:20:01 2015, 94.6, 83.0, 84.0, 75.0
Fri Jul 3 15:30:01 2015, 94.6, 83.0, 84.0, 75.0
Fri Jul 3 15:40:01 2015, 94.0, 83.0, 84.0, 75.0
Fri Jul 3 15:50:01 2015, 93.3, 83.0, 84.0, 75.0
Fri Jul 3 16:00:01 2015, 92.9, 83.0, 85.0, 75.0
Fri Jul 3 16:10:01 2015, 92.6, 83.0, 85.0, 75.0
Fri Jul 3 16:20:01 2015, 92.5, 83.0, 85.0, 75.0
Fri Jul 3 16:30:01 2015, 92.0, 83.0, 85.0, 75.0
Fri Jul 3 16:40:01 2015, 91.7, 83.0, 85.0, 75.0
Fri Jul 3 16:50:01 2015, 91.2, 83.0, 85.0, 75.0
Fri Jul 3 17:00:01 2015, 89.9, 84.0, 85.0, 75.0
Fri Jul 3 17:10:01 2015, 89.6, 84.0, 85.0, 75.0
Fri Jul 3 17:20:01 2015, 89.0, 84.0, 85.0, 75.0
Fri Jul 3 17:30:01 2015, 88.8, 84.0, 85.0, 75.0
Fri Jul 3 17:40:01 2015, 87.8, 84.0, 85.0, 75.0
Fri Jul 3 17:50:01 2015, 87.6, 84.0, 85.0, 75.0
Fri Jul 3 18:00:01 2015, 86.9, 84.0, 85.0, 75.0
Fri Jul 3 18:10:01 2015, 86.7, 84.0, 85.0, 75.0
Fri Jul 3 18:20:01 2015, 86.1, 84.0, 85.0, 75.0
Fri Jul 3 18:30:01 2015, 85.7, 84.0, 85.0, 75.0
Fri Jul 3 18:40:01 2015, 85.5, 84.0, 85.0, 75.0
Fri Jul 3 18:50:01 2015, 85.1, 84.0, 85.0, 75.0
Fri Jul 3 19:00:01 2015, 84.4, 84.0, 85.0, 75.0
Fri Jul 3 19:10:01 2015, 84.2, 85.0, 85.0, 76.0
Fri Jul 3 19:20:01 2015, 83.8, 85.0, 85.0, 76.0
Fri Jul 3 19:30:01 2015, 83.4, 85.0, 85.0, 76.0
Fri Jul 3 19:40:01 2015, 82.4, 85.0, 85.0, 76.0
Fri Jul 3 19:50:01 2015, 82.2, 85.0, 85.0, 76.0
Fri Jul 3 20:00:01 2015, 81.8, 85.0, 85.0, 76.0
Fri Jul 3 20:10:01 2015, 81.3, 85.0, 85.0, 76.0
Fri Jul 3 20:20:01 2015, 80.2, 85.0, 85.0, 76.0
Fri Jul 3 20:30:01 2015, 79.7, 85.0, 85.0, 76.0
Fri Jul 3 20:40:01 2015, 79.1, 85.0, 85.0, 76.0
Fri Jul 3 20:50:01 2015, 78.8, 85.0, 85.0, 76.0
Fri Jul 3 21:00:01 2015, 77.9, 85.0, 85.0, 76.0
Fri Jul 3 21:10:01 2015, 77.3, 85.0, 85.0, 76.0
Fri Jul 3 21:20:01 2015, 77.0, 85.0, 85.0, 76.0
Fri Jul 3 21:30:01 2015, 76.4, 85.0, 85.0, 76.0
Fri Jul 3 21:40:01 2015, 75.9, 85.0, 84.0, 76.0
Fri Jul 3 21:50:01 2015, 75.5, 85.0, 84.0, 76.0
Fri Jul 3 22:00:01 2015, 75.3, 85.0, 84.0, 76.0
Fri Jul 3 22:10:01 2015, 74.9, 85.0, 84.0, 76.0
Fri Jul 3 22:20:01 2015, 74.3, 85.0, 84.0, 76.0
Fri Jul 3 22:30:01 2015, 74.0, 85.0, 84.0, 76.0
Fri Jul 3 22:40:01 2015, 73.5, 84.0, 84.0, 76.0
Fri Jul 3 22:50:01 2015, 73.3, 84.0, 84.0, 76.0
Fri Jul 3 23:00:01 2015, 73.1, 84.0, 84.0, 76.0
Fri Jul 3 23:10:01 2015, 72.7, 84.0, 84.0, 76.0
Fri Jul 3 23:20:01 2015, 72.4, 84.0, 84.0, 76.0
Fri Jul 3 23:30:01 2015, 72.2, 84.0, 84.0, 76.0
Fri Jul 3 23:40:00 2015, 71.9, 84.0, 83.0, 76.0
Fri Jul 3 23:50:00 2015, 71.4, 84.0, 83.0, 76.0
Sat Jul 4 00:00:01 2015, 71.2, 84.0, 83.0, 76.0
Sat Jul 4 00:10:00 2015, 71.0, 84.0, 83.0, 76.0
Sat Jul 4 00:20:00 2015, 70.4, 84.0, 83.0, 76.0
Sat Jul 4 00:30:00 2015, 70.1, 84.0, 83.0, 76.0
Sat Jul 4 00:40:00 2015, 69.9, 84.0, 82.0, 76.0
Sat Jul 4 00:50:00 2015, 69.7, 84.0, 82.0, 76.0
Sat Jul 4 01:00:00 2015, 69.6, 84.0, 82.0, 76.0
Sat Jul 4 01:10:01 2015, 69.3, 84.0, 82.0, 76.0
Sat Jul 4 01:20:00 2015, 69.1, 84.0, 82.0, 76.0
Sat Jul 4 01:30:01 2015, 68.9, 84.0, 82.0, 76.0
Sat Jul 4 01:40:01 2015, 68.8, 84.0, 81.0, 76.0
Sat Jul 4 01:50:01 2015, 68.5, 84.0, 81.0, 76.0
Sat Jul 4 02:00:00 2015, 68.4, 84.0, 81.0, 76.0
Sat Jul 4 02:10:00 2015, 68.3, 83.0, 81.0, 76.0
Sat Jul 4 02:20:00 2015, 68.2, 83.0, 81.0, 76.0
Sat Jul 4 02:30:00 2015, 67.9, 83.0, 81.0, 76.0
Sat Jul 4 02:40:00 2015, 67.9, 83.0, 81.0, 76.0
Sat Jul 4 02:50:01 2015, 67.9, 83.0, 81.0, 76.0
Sat Jul 4 03:00:01 2015, 67.7, 83.0, 81.0, 76.0
Sat Jul 4 03:10:00 2015, 67.6, 83.0, 81.0, 76.0
Sat Jul 4 03:20:00 2015, 67.6, 83.0, 81.0, 76.0
Sat Jul 4 03:30:01 2015, 67.4, 83.0, 81.0, 76.0
Sat Jul 4 03:40:01 2015, 67.1, 83.0, 80.0, 75.0
Sat Jul 4 03:50:01 2015, 67.0, 83.0, 80.0, 75.0
Sat Jul 4 04:00:00 2015, 66.8, 83.0, 80.0, 75.0
Sat Jul 4 04:10:00 2015, 66.7, 83.0, 80.0, 75.0
Sat Jul 4 04:20:00 2015, 66.4, 83.0, 80.0, 75.0
Sat Jul 4 04:30:01 2015, 66.3, 83.0, 80.0, 75.0
Sat Jul 4 04:40:01 2015, 66.5, 83.0, 80.0, 75.0
Sat Jul 4 04:50:01 2015, 66.2, 83.0, 80.0, 75.0
Sat Jul 4 05:00:00 2015, 65.9, 83.0, 80.0, 75.0
Sat Jul 4 05:10:00 2015, 65.9, 82.0, 80.0, 75.0
Sat Jul 4 05:20:00 2015, 65.8, 82.0, 80.0, 75.0
Sat Jul 4 05:30:01 2015, 65.9, 82.0, 80.0, 75.0
Sat Jul 4 05:40:01 2015, 65.5, 82.0, 79.0, 75.0
Sat Jul 4 05:50:01 2015, 65.5, 82.0, 79.0, 75.0
Sat Jul 4 06:00:00 2015, 65.4, 82.0, 79.0, 75.0
Sat Jul 4 06:10:00 2015, 65.3, 82.0, 79.0, 75.0
Sat Jul 4 06:20:00 2015, 65.0, 82.0, 79.0, 75.0
Sat Jul 4 06:30:00 2015, 65.1, 82.0, 79.0, 75.0
Sat Jul 4 06:40:00 2015, 64.9, 82.0, 79.0, 75.0
Sat Jul 4 06:50:01 2015, 65.2, 82.0, 79.0, 75.0
Sat Jul 4 07:00:00 2015, 65.3, 82.0, 79.0, 75.0
Sat Jul 4 07:10:00 2015, 65.3, 82.0, 79.0, 75.0
Sat Jul 4 07:20:00 2015, 65.4, 82.0, 79.0, 75.0
Sat Jul 4 07:30:00 2015, 65.7, 82.0, 79.0, 75.0
Sat Jul 4 07:40:00 2015, 65.9, 82.0, 79.0, 75.0
Sat Jul 4 07:50:01 2015, 66.3, 82.0, 79.0, 75.0
Sat Jul 4 08:00:01 2015, 66.6, 82.0, 79.0, 75.0
Sat Jul 4 08:10:01 2015, 66.9, 81.0, 79.0, 75.0
Sat Jul 4 08:20:00 2015, 67.1, 81.0, 79.0, 75.0
Sat Jul 4 08:30:00 2015, 67.2, 81.0, 79.0, 75.0
Sat Jul 4 08:40:01 2015, 67.6, 81.0, 79.0, 75.0
Sat Jul 4 08:50:01 2015, 67.8, 81.0, 79.0, 75.0
Sat Jul 4 09:00:00 2015, 68.5, 81.0, 79.0, 75.0
Sat Jul 4 09:10:00 2015, 68.8, 81.0, 79.0, 75.0
Sat Jul 4 09:20:00 2015, 69.2, 81.0, 79.0, 75.0
Sat Jul 4 09:30:00 2015, 69.9, 81.0, 79.0, 75.0
Sat Jul 4 09:40:01 2015, 71.3, 81.0, 79.0, 75.0
Sat Jul 4 09:50:00 2015, 71.9, 81.0, 79.0, 75.0
Sat Jul 4 10:00:00 2015, 72.4, 81.0, 79.0, 75.0
Sat Jul 4 10:10:00 2015, 73.0, 81.0, 79.0, 75.0
Sat Jul 4 10:20:00 2015, 74.5, 81.0, 79.0, 75.0
Sat Jul 4 10:30:00 2015, 75.6, 81.0, 79.0, 75.0
Sat Jul 4 10:40:00 2015, 76.8, 81.0, 79.0, 75.0
Sat Jul 4 10:50:00 2015, 78.2, 81.0, 79.0, 75.0
Sat Jul 4 11:00:01 2015, 80.4, 81.0, 79.0, 75.0
Sat Jul 4 11:10:00 2015, 81.7, 81.0, 80.0, 75.0
Sat Jul 4 11:20:00 2015, 83.7, 81.0, 80.0, 75.0
Sat Jul 4 11:30:00 2015, 85.6, 81.0, 80.0, 75.0
Sat Jul 4 11:40:00 2015, 86.8, 81.0, 80.0, 75.0
Sat Jul 4 11:50:00 2015, 87.1, 81.0, 80.0, 75.0
Sat Jul 4 12:00:01 2015, 87.1, 81.0, 80.0, 75.0
Sat Jul 4 12:10:00 2015, 87.8, 82.0, 80.0, 75.0
Sat Jul 4 12:20:00 2015, 87.9, 82.0, 80.0, 75.0
Sat Jul 4 12:30:00 2015, 87.4, 82.0, 80.0, 75.0
Sat Jul 4 12:40:00 2015, 87.6, 82.0, 80.0, 75.0
Sat Jul 4 12:50:00 2015, 88.0, 82.0, 81.0, 75.0
Sat Jul 4 13:00:00 2015, 89.1, 82.0, 81.0, 75.0
Sat Jul 4 13:10:03 2015, 89.3, 82.0, 81.0, 75.0
Sat Jul 4 13:20:00 2015, 89.8, 82.0, 81.0, 75.0
Sat Jul 4 13:30:00 2015, 90.9, 82.0, 81.0, 75.0
Sat Jul 4 13:40:00 2015, 92.3, 82.0, 81.0, 75.0
Sat Jul 4 13:50:00 2015, 92.6, 83.0, 82.0, 75.0
Sat Jul 4 14:00:01 2015, 93.3, 83.0, 82.0, 75.0
Sat Jul 4 14:10:01 2015, 94.3, 83.0, 82.0, 75.0
Sat Jul 4 14:20:00 2015, 94.9, 83.0, 82.0, 75.0
Sat Jul 4 14:30:00 2015, 94.2, 83.0, 82.0, 75.0
Sat Jul 4 14:40:00 2015, 94.2, 83.0, 82.0, 75.0
Sat Jul 4 14:50:00 2015, 93.9, 83.0, 82.0, 75.0
Sat Jul 4 15:00:00 2015, 92.3, 83.0, 82.0, 75.0
Sat Jul 4 15:10:01 2015, 91.8, 83.0, 82.0, 75.0
Sat Jul 4 15:20:00 2015, 91.0, 83.0, 82.0, 75.0
Sat Jul 4 15:30:00 2015, 90.5, 83.0, 82.0, 75.0
Sat Jul 4 15:40:00 2015, 89.3, 83.0, 82.0, 75.0
Sat Jul 4 15:50:00 2015, 89.1, 83.0, 82.0, 75.0
Sat Jul 4 16:00:00 2015, 88.5, 84.0, 83.0, 75.0
Sat Jul 4 16:10:00 2015, 88.0, 84.0, 83.0, 75.0
Sat Jul 4 16:20:00 2015, 87.6, 84.0, 83.0, 75.0
Sat Jul 4 16:30:00 2015, 87.4, 84.0, 83.0, 75.0
Sat Jul 4 16:40:00 2015, 87.4, 84.0, 83.0, 75.0
Sat Jul 4 16:50:00 2015, 87.5, 84.0, 83.0, 75.0
Sat Jul 4 17:00:00 2015, 87.4, 84.0, 83.0, 75.0
Sat Jul 4 17:10:00 2015, 87.4, 84.0, 83.0, 75.0
Sat Jul 4 17:20:01 2015, 87.1, 84.0, 83.0, 75.0
Sat Jul 4 17:30:00 2015, 87.2, 84.0, 83.0, 75.0
Sat Jul 4 17:40:00 2015, 86.9, 84.0, 83.0, 75.0
Sat Jul 4 17:50:00 2015, 86.6, 84.0, 83.0, 75.0
Sat Jul 4 18:00:00 2015, 86.6, 84.0, 83.0, 76.0
Sat Jul 4 18:10:00 2015, 86.3, 84.0, 83.0, 76.0
Sat Jul 4 18:20:01 2015, 86.3, 84.0, 83.0, 76.0
Sat Jul 4 18:30:00 2015, 86.0, 84.0, 83.0, 76.0
Sat Jul 4 18:40:00 2015, 85.8, 84.0, 83.0, 76.0
Sat Jul 4 18:50:00 2015, 85.6, 84.0, 83.0, 76.0
Sat Jul 4 19:00:00 2015, 85.1, 85.0, 84.0, 76.0
Sat Jul 4 19:10:00 2015, 84.8, 85.0, 84.0, 76.0
Sat Jul 4 19:20:00 2015, 84.5, 85.0, 84.0, 76.0
Sat Jul 4 19:30:01 2015, 84.1, 85.0, 84.0, 76.0
Sat Jul 4 19:40:00 2015, 83.6, 85.0, 84.0, 76.0
Sat Jul 4 19:50:00 2015, 83.1, 85.0, 84.0, 76.0
Sat Jul 4 20:00:00 2015, 82.8, 85.0, 84.0, 76.0
Sat Jul 4 20:10:00 2015, 82.2, 85.0, 84.0, 76.0
Sat Jul 4 20:20:00 2015, 81.5, 85.0, 84.0, 76.0
Sat Jul 4 20:30:01 2015, 81.2, 85.0, 84.0, 76.0
Sat Jul 4 20:40:01 2015, 80.7, 85.0, 84.0, 76.0
Sat Jul 4 20:50:00 2015, 80.1, 85.0, 84.0, 76.0
Sat Jul 4 21:00:00 2015, 79.2, 85.0, 84.0, 76.0
Sat Jul 4 21:10:00 2015, 78.7, 85.0, 84.0, 76.0
Sat Jul 4 21:20:00 2015, 78.4, 85.0, 84.0, 76.0
Sat Jul 4 21:30:01 2015, 78.0, 85.0, 84.0, 76.0
Sat Jul 4 21:40:00 2015, 77.1, 85.0, 84.0, 76.0
Sat Jul 4 21:50:00 2015, 76.7, 85.0, 84.0, 76.0
Sat Jul 4 22:00:00 2015, 76.1, 85.0, 84.0, 76.0
Sat Jul 4 22:10:00 2015, 75.8, 85.0, 84.0, 76.0
Sat Jul 4 22:20:00 2015, 75.1, 85.0, 84.0, 76.0
Sat Jul 4 22:30:02 2015, 75.0, 85.0, 84.0, 76.0
Sat Jul 4 22:40:00 2015, 74.5, 85.0, 84.0, 76.0
Sat Jul 4 22:50:00 2015, 74.3, 84.0, 83.0, 76.0
Sat Jul 4 23:00:00 2015, 73.7, 84.0, 83.0, 76.0
Sat Jul 4 23:10:01 2015, 73.4, 83.0, 82.0, 76.0
Sat Jul 4 23:20:00 2015, 73.3, 83.0, 82.0, 76.0
Sat Jul 4 23:30:00 2015, 73.0, 83.0, 82.0, 76.0
Sat Jul 4 23:40:01 2015, 72.5, 83.0, 82.0, 76.0
Sat Jul 4 23:50:00 2015, 72.2, 83.0, 81.0, 76.0
Sun Jul 5 00:00:01 2015, 71.9, 83.0, 81.0, 76.0
Sun Jul 5 00:10:00 2015, 71.7, 82.0, 82.0, 76.0
Sun Jul 5 00:20:01 2015, 71.4, 82.0, 82.0, 76.0
Sun Jul 5 00:30:00 2015, 71.2, 82.0, 82.0, 76.0
Sun Jul 5 00:40:01 2015, 71.0, 82.0, 81.0, 76.0
Sun Jul 5 00:50:00 2015, 70.7, 82.0, 81.0, 76.0
Sun Jul 5 01:00:02 2015, 70.1, 82.0, 81.0, 76.0
Sun Jul 5 01:10:01 2015, 70.0, 81.0, 80.0, 76.0
Sun Jul 5 01:20:01 2015, 69.9, 81.0, 80.0, 76.0
Sun Jul 5 01:30:01 2015, 69.7, 81.0, 80.0, 76.0
Sun Jul 5 01:40:02 2015, 69.3, 81.0, 80.0, 76.0
Sun Jul 5 01:50:01 2015, 69.2, 81.0, 80.0, 76.0
Sun Jul 5 02:00:01 2015, 69.2, 81.0, 80.0, 76.0
Sun Jul 5 02:10:00 2015, 68.8, 81.0, 80.0, 76.0
Sun Jul 5 02:20:00 2015, 68.7, 81.0, 80.0, 76.0
Sun Jul 5 02:30:01 2015, 68.6, 80.0, 80.0, 76.0
Sun Jul 5 02:40:00 2015, 68.4, 80.0, 80.0, 76.0
Sun Jul 5 02:50:02 2015, 68.1, 80.0, 80.0, 76.0
Sun Jul 5 03:00:01 2015, 67.8, 80.0, 79.0, 76.0
Sun Jul 5 03:10:01 2015, 67.7, 80.0, 79.0, 76.0
Sun Jul 5 03:20:01 2015, 67.7, 80.0, 79.0, 76.0
Sun Jul 5 03:30:00 2015, 67.6, 80.0, 79.0, 76.0
Sun Jul 5 03:40:01 2015, 67.2, 79.0, 79.0, 76.0
Sun Jul 5 03:50:01 2015, 67.4, 79.0, 79.0, 76.0
Sun Jul 5 04:00:01 2015, 66.9, 79.0, 79.0, 76.0
Sun Jul 5 04:10:01 2015, 66.8, 79.0, 78.0, 76.0
Sun Jul 5 04:20:01 2015, 66.5, 79.0, 78.0, 76.0
Sun Jul 5 04:30:01 2015, 66.6, 79.0, 78.0, 76.0
Sun Jul 5 04:40:02 2015, 66.2, 79.0, 78.0, 76.0
Sun Jul 5 04:50:01 2015, 66.4, 79.0, 78.0, 76.0
Sun Jul 5 05:00:01 2015, 65.9, 78.0, 78.0, 76.0
Sun Jul 5 05:10:02 2015, 66.1, 78.0, 78.0, 76.0
Sun Jul 5 05:20:01 2015, 65.7, 78.0, 78.0, 76.0
Sun Jul 5 05:30:01 2015, 65.6, 78.0, 78.0, 76.0
Sun Jul 5 05:40:01 2015, 65.5, 78.0, 77.0, 75.0
Sun Jul 5 05:50:01 2015, 65.4, 78.0, 78.0, 75.0
Sun Jul 5 06:00:01 2015, 65.4, 78.0, 78.0, 75.0
Sun Jul 5 06:10:01 2015, 65.1, 78.0, 77.0, 75.0
Sun Jul 5 06:20:01 2015, 65.0, 78.0, 77.0, 75.0
Sun Jul 5 06:30:01 2015, 65.1, 78.0, 77.0, 75.0
Sun Jul 5 06:40:01 2015, 65.1, 78.0, 77.0, 75.0
Sun Jul 5 06:50:01 2015, 65.1, 78.0, 77.0, 75.0
Sun Jul 5 07:00:02 2015, 65.1, 78.0, 77.0, 75.0
Sun Jul 5 07:10:01 2015, 65.3, 77.0, 77.0, 75.0
Sun Jul 5 07:20:01 2015, 65.3, 77.0, 77.0, 75.0
Sun Jul 5 07:30:01 2015, 65.2, 77.0, 77.0, 75.0
Sun Jul 5 07:40:01 2015, 65.5, 77.0, 77.0, 75.0
Sun Jul 5 07:50:01 2015, 65.7, 77.0, 77.0, 75.0
Sun Jul 5 08:00:01 2015, 65.6, 77.0, 77.0, 75.0
Sun Jul 5 08:10:01 2015, 66.0, 77.0, 77.0, 75.0
Sun Jul 5 08:20:01 2015, 66.5, 77.0, 77.0, 75.0
Sun Jul 5 08:30:01 2015, 66.8, 77.0, 77.0, 75.0
Sun Jul 5 08:40:01 2015, 67.2, 77.0, 77.0, 75.0
Sun Jul 5 08:50:01 2015, 67.6, 77.0, 77.0, 75.0
Sun Jul 5 09:00:02 2015, 68.8, 77.0, 77.0, 75.0
Sun Jul 5 09:10:01 2015, 69.4, 77.0, 77.0, 75.0
Sun Jul 5 09:20:01 2015, 69.8, 77.0, 77.0, 75.0
Sun Jul 5 09:30:02 2015, 70.7, 77.0, 77.0, 75.0
Sun Jul 5 09:40:01 2015, 72.0, 77.0, 77.0, 75.0
Sun Jul 5 09:50:01 2015, 72.7, 77.0, 77.0, 75.0
Sun Jul 5 10:00:01 2015, 73.0, 78.0, 78.0, 75.0
Sun Jul 5 10:10:01 2015, 73.7, 78.0, 78.0, 75.0
Sun Jul 5 10:20:01 2015, 74.9, 78.0, 79.0, 75.0
Sun Jul 5 10:30:01 2015, 76.4, 78.0, 79.0, 75.0
Sun Jul 5 10:40:01 2015, 77.8, 78.0, 79.0, 75.0
Sun Jul 5 10:50:01 2015, 79.3, 78.0, 79.0, 75.0
Sun Jul 5 11:00:01 2015, 81.1, 79.0, 80.0, 75.0
Sun Jul 5 11:10:01 2015, 82.4, 79.0, 80.0, 75.0
Sun Jul 5 11:20:01 2015, 84.6, 79.0, 80.0, 75.0
Sun Jul 5 11:30:01 2015, 86.2, 79.0, 80.0, 75.0
Sun Jul 5 11:40:01 2015, 89.0, 79.0, 80.0, 75.0
Sun Jul 5 11:50:01 2015, 89.7, 79.0, 80.0, 75.0
Sun Jul 5 12:00:01 2015, 89.9, 79.0, 80.0, 75.0
Sun Jul 5 12:10:01 2015, 90.1, 80.0, 82.0, 75.0
Sun Jul 5 12:20:01 2015, 90.2, 81.0, 82.0, 75.0
Sun Jul 5 12:30:02 2015, 90.0, 81.0, 82.0, 75.0
Sun Jul 5 12:40:01 2015, 89.9, 81.0, 82.0, 75.0
Sun Jul 5 12:50:01 2015, 89.9, 81.0, 83.0, 75.0
Sun Jul 5 13:00:01 2015, 90.3, 81.0, 83.0, 75.0
Sun Jul 5 13:10:02 2015, 90.9, 81.0, 83.0, 75.0
Sun Jul 5 13:20:00 2015, 91.2, 81.0, 83.0, 75.0
Sun Jul 5 13:30:01 2015, 92.1, 81.0, 83.0, 75.0
Sun Jul 5 13:40:00 2015, 93.3, 82.0, 84.0, 75.0
Sun Jul 5 13:50:00 2015, 93.8, 82.0, 84.0, 75.0
Sun Jul 5 14:00:00 2015, 94.3, 82.0, 84.0, 75.0
Sun Jul 5 14:10:00 2015, 94.9, 82.0, 85.0, 75.0
Sun Jul 5 14:20:00 2015, 96.1, 82.0, 85.0, 75.0
Sun Jul 5 14:30:00 2015, 96.0, 82.0, 85.0, 75.0
Sun Jul 5 14:40:01 2015, 96.0, 83.0, 85.0, 75.0
Sun Jul 5 14:50:00 2015, 96.3, 83.0, 85.0, 75.0
Sun Jul 5 15:00:00 2015, 96.7, 83.0, 85.0, 75.0
Sun Jul 5 15:10:00 2015, 96.5, 83.0, 86.0, 75.0
Sun Jul 5 15:20:01 2015, 96.8, 83.0, 86.0, 75.0
Sun Jul 5 15:30:00 2015, 96.7, 83.0, 86.0, 75.0
Sun Jul 5 15:40:00 2015, 95.6, 84.0, 86.0, 75.0
Sun Jul 5 15:50:00 2015, 94.9, 84.0, 86.0, 75.0
Sun Jul 5 16:00:00 2015, 94.4, 84.0, 86.0, 75.0
Sun Jul 5 16:10:00 2015, 94.1, 84.0, 86.0, 75.0
Sun Jul 5 16:20:00 2015, 93.4, 84.0, 86.0, 75.0
Sun Jul 5 16:30:01 2015, 93.0, 84.0, 86.0, 75.0
Sun Jul 5 16:40:00 2015, 92.2, 84.0, 86.0, 75.0
Sun Jul 5 16:50:00 2015, 91.7, 84.0, 86.0, 75.0
Sun Jul 5 17:00:00 2015, 90.2, 84.0, 86.0, 75.0
Sun Jul 5 17:10:00 2015, 89.8, 84.0, 86.0, 76.0
Sun Jul 5 17:20:00 2015, 89.1, 84.0, 86.0, 76.0
Sun Jul 5 17:30:01 2015, 88.7, 84.0, 86.0, 76.0
Sun Jul 5 17:40:00 2015, 87.9, 85.0, 86.0, 76.0
Sun Jul 5 17:50:00 2015, 87.5, 85.0, 86.0, 76.0
Sun Jul 5 18:00:00 2015, 86.8, 85.0, 87.0, 76.0
Sun Jul 5 18:10:00 2015, 86.3, 85.0, 87.0, 76.0
Sun Jul 5 18:20:00 2015, 85.4, 85.0, 87.0, 76.0
Sun Jul 5 18:30:01 2015, 84.9, 85.0, 87.0, 76.0
Sun Jul 5 18:40:00 2015, 84.6, 85.0, 86.0, 76.0
Sun Jul 5 18:50:00 2015, 84.4, 85.0, 87.0, 76.0
Sun Jul 5 19:00:00 2015, 83.7, 85.0, 87.0, 76.0
Sun Jul 5 19:10:00 2015, 83.5, 85.0, 86.0, 76.0
Sun Jul 5 19:20:00 2015, 83.2, 85.0, 86.0, 76.0
Sun Jul 5 19:30:00 2015, 82.7, 85.0, 86.0, 76.0
Sun Jul 5 19:40:01 2015, 81.7, 85.0, 86.0, 76.0
Sun Jul 5 19:50:00 2015, 81.4, 85.0, 86.0, 76.0
Sun Jul 5 20:00:00 2015, 80.7, 85.0, 86.0, 76.0
Sun Jul 5 20:10:00 2015, 80.1, 85.0, 86.0, 76.0
Sun Jul 5 20:20:00 2015, 79.0, 85.0, 86.0, 76.0
Sun Jul 5 20:30:00 2015, 78.4, 85.0, 86.0, 76.0
Sun Jul 5 20:40:00 2015, 78.2, 84.0, 84.0, 76.0
Sun Jul 5 20:50:00 2015, 77.5, 82.0, 84.0, 76.0
Sun Jul 5 21:00:00 2015, 76.7, 82.0, 84.0, 76.0
Sun Jul 5 21:10:01 2015, 75.9, 80.0, 83.0, 76.0
Sun Jul 5 21:20:00 2015, 75.4, 80.0, 83.0, 76.0
这是情节的样子:
答案 0 :(得分:1)
只需设置xrange
gnuplot可能至少使用范围之外的一些点,具体取决于yrange
。例如,请考虑以下数据:
1 2
2 3
3 4
4 5
只是在没有设置范围的情况下绘制它:
设置set xrange [1.5:*]
以使第一个点在外面忽略第一个点:
然而,设置yrange
即使超出范围,也会包含此点,例如set xrange [1.5:*]; set yrange [2:5]
:
要正确排除点,您需要使用条件图告诉gnuplot忽略点(1/0
),如果它超出范围:
xmin=1.5; xmax=4
set xrange [xmin:xmax]; set yrange [2:5]
plot "datafile" u ($1 >= xmin && $1 <= xmax ? $1 : 1/0):($2) w lp pt 7 not
答案 1 :(得分:1)
简短回答:
通过index
等设置的范围仅定义轴的长度。评估文件中的所有点(您可以根据数据文件的格式使用every
或(un)set clip one/two
说明符明确限制此值。
如果其中一个点位于内部,则默认情况下会绘制连接线,但如果两个点都位于外部,则不会绘制。您可以使用unset clip one
影响这两项。
unset clip two
不会向偏离点划一条线将所需范围之外的值切换为NaN(== 1/0),就像Miguels中的答案一样,但我很难理解为什么它是必要的。