这是太阳强度的数据记录器输出。gnuplot - X轴是一个时间值 - X11图是好的。如何使.png看起来类似
这里是什么样的数据看起来像一个摘录:
2017-09-24 12:44:48 1440
2017-09-24 12:45:49 1434
2017-09-24 12:46:50 1445
2017-09-24 12:47:51 1446
2017-09-24 12:48:52 1434
2017-09-24 12:49:53 1431
此图显示在一个xterm,看起来完美:
这个程序产生:
set title "OUTSIDE Light Intensity"
set xlabel "Time"
set ylabel "LUX"
set yrange [0:*]
set grid
unset mouse
unset log
set key top left
set timestamp
set xdata time
set timefmt '%H:%M:%S'
set xtics format '%H:%M'
set terminal x11
set datafile missing "0.00"
plot 1750 lw 1 lc rgb 'black' t "South", \
"today.dat" using 2:($3*1.5) with lines lw 1 lc rgb 'red' t "Lux"
pause 30
reread
按照
How can you watch gnuplot realtime data plots as a live graph, with automatic updates?
到目前为止,一切都很好。
即在cron运行的gnuplot的程序生成PNG文件等效。这是除了一个输出文件的终端设置和规格相同:
set output "plux.png"
set terminal pngcairo
plot 1750 lw 2 lc rgb 'black' t "South", \
"today.dat" using 2:($3*1.5) with lines lw 2 lc rgb 'red' t "Lux"
和输出看起来是这样的:
所以我的问题是:我如何控制.png的情节,所以它看起来像在X11终端相同?
似乎与字体有关。
这篇文章会谈到它:
摘录:
的Gnuplot不提供任何自己的字体。它依赖于外部字体处理,不幸的是,从一种终端类型到另一种终端类型的细节不同。
使用'wxt'和'pngcairo',https://stackoverflow.com/a/30334657/260421 – Christoph
这很酷。但是,这将假设我总是有活动图表运行。我选择使用cron生成png文件,一直到午夜,当eod(一天结束时)python脚本运行时,将从各个Rpi/Nano传感器收集的所有内容按日期命名。这样,我可以继续进行野营旅行,它仍然可以自动运行,将其全部保存到磁盘以防止出现SD卡或闪存驱动器故障(其中有几个故障)。所以png世代节目与现场情节节目是分开的。 – SDsolar