Gnuplot:如何在Xtics TimeFMT中设置新行 [英] Gnuplot: How to set new line in xtics timefmt

查看:57
本文介绍了Gnuplot:如何在Xtics TimeFMT中设置新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在绘制一个gnuplot图,其中y轴上的浮点值,x轴上的时间值.绘图本身就像一种魅力,但我无法使用时间格式的换行符来工作.

I'm plotting a gnuplot diagram with float values in the y-axis and time values in the x-axis. The plotting itself works like a charm, but I can't get newlines in the time format to work.

如果我使用格式说明符%d.%m.%y%H:%M" ,它的作用就像一个超级按钮,结果是: 25.05.1983 17:23 .但是,当我添加换行符时,我有了%d.%m.%y \ n%H:%M" ,结果标签实际上包含换行符,但我看到的只是: 1983年5月25日.

If I use the format specifier "%d.%m.%y %H:%M" it works like a charm, and the result is: 25.05.1983 17:23. But when I add a newline character, so I have "%d.%m.%y\n%H:%M" the resulting labels are actually containing a line break but all I see is: 25.05.1983.

我还尝试将 bmargin 增加几个值,直到压实结果图为止,但是我无法显示时间.

I also tried to increase the bmargin by several values, up to the point where the resulting plot was squished, but I just can't get the time to be shown.

时间格式不支持换行符吗?还是对标签根本不起作用?还是 png增强终端不支持它?

Is the newline character not supported in a time format? Or does this not work at all with labels? Or maybe the png enhanced terminal doesn't support it?

更新

样本输入数据

20140617000045
20140617000245
20140617000445
20140617000645

我在日期和时间之间没有空格.

I don't have any space between date and time.

推荐答案

对于您的测试数据,以下脚本可以在4.6.5下正常工作:

With your test data the following script works fine with 4.6.5:

set terminal pngcairo enhanced
set output 'timetest.png'
set xdata time
set timefmt '%Y%m%d%H%M%S'
set format x "%d.%m.%y\n%H:%M"
plot 'test.dat' using 1:0 with lp notitle

输出为:

是的, png 终端也可以正常工作(但其输出通常较难看).

Yes, the png terminal works fine as well (but its output is in general uglier).

这篇关于Gnuplot:如何在Xtics TimeFMT中设置新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆