gnuplot - X轴是时间值 - X11图很好。如何使.png看起来相似

时间:2017-09-25 05:34:27

标签: fonts gnuplot

这是太阳强度的数据记录器输出。

以下是数据外观的摘录:

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显示,看起来很完美:

enter image description here

由该程序生成:

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"

,输出如下:

enter image description here

所以我的问题是:如何控制.png图,使其看起来与x11终端相同?

似乎与字体有关。

本文与它对话:

gnuplot documentation: fonts

摘录:

  

Gnuplot不提供任何自己的字体。它依赖于外部字体处理,不幸的是,它的细节因终端类型而异。

1 个答案:

答案 0 :(得分:0)

当终端设置为png时,答案会更容易:

set term png font "arial,11"

完成后,输出文件如下所示:

enter image description here

那很好。

但是它引出了X11终端中使用什么字体的问题,因为在OP中提供的字体页面中没有提到它。

所以我们走了:gnuplot: X11_fonts

摘录:

  

初次启动时,默认字体取自X11资源   在系统或用户.Xdefaults文件中或在命令行中设置。

     

实施例:        gnuplot *字体:lucidasans-bold-12

     

可以使用

从gnuplot内部为x11驱动程序指定新的默认字体
`set term x11 font "<fontspec>"`
     

驱动程序首先在X服务器上查询确切名称的字体   给出。

最后,带有arial字体的png终端适用于这些png文件。

它们在每天的蒙太奇中使用,其中包括太阳能发电站的一整套绘制变量。

让它们彼此相似对于这个项目来说要比强制它们看起来和它们在屏幕上看起来一样重要得多。