要从sqlite数据库中提取数据,您可以使用
sqlite3命令行工具即时提取数据。使用gnuplot可以做到这一点,方法是使用a
<生成外壳并使用给定的shell命令的输出进行绘图。
plot '< sqlite3 myfile.db3 "SELECt temp1, temp2, pressure, humidity FROM myTable;"' using 0:1 title 'temp1', '' using 0:2 title 'temp2'
这将为每个图提取所有四个字段(
''重复先前的文件名/ shell命令)。您还可以使用函数格式化shell命令:
SqliteField(f) = '< sqlite3 myfile.db3 "SELECt '.f.' from myTable;"'fields = 'temp1 temp2 pressure humidity'plot for [f in fields] SqliteField(f) using 0:1 title f



