有没有办法让gnuplot使用xaxis时间数据,但是跳过某些时间间隔(例如非交易时间) [英] Is there a way to have gnuplot use xaxis time data, but skip certain intervals (e.g. non-trading hours)

查看:164
本文介绍了有没有办法让gnuplot使用xaxis时间数据,但是跳过某些时间间隔(例如非交易时间)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在交易时间内收集有关股票和期权的价格数据,并将它们附加到我用gnuplot绘制的数据文件中.该文件如下所示:

I'm collecting pricing data on stocks and options during trading hours and appending them to a data file that I plot with gnuplot. The file looks like:

2013-01-30--15:58:14 38.68 0.64
2013-01-30--15:58:44 38.70 0.64
2013-01-30--15:59:15 38.70 0.64
2013-01-30--15:59:45 38.69 0.64

由于市场休市,我最终会长时间不收集任何数据.

I end up with large periods of time that I don't collect any data for since the markets are closed.

当我使用gnuplot绘制此数据时,使用xdata作为timefmt,它显示了从一天结束到另一天开始的巨大差距.

When I plot this data with gnuplot, using xdata as timefmt, it displays large gaps from the end of one day to the start of another.

在没有实际数据的日子里,我希望它跳过那些时间...有办法吗?

I'd prefer to have it skip those times during the days where there is no actual data... Is there a way to do this?

我能够通过不对第一列中的时间值绘制数据来接近目标,但是我想显示时间数据,因为它很好地跳过了未收集数据的那些时间.

I've been able to come close by not plotting the data against the time value in the first column, but I'd like to show the time data AS WELL AS skip those times when the data was not collected.

我希望这是有意义的,并感谢您的帮助.

I hope this makes sense and appreciate your help.

推荐答案

如果我理解正确,则可以充分利用x上的断开轴.

If I understood correctly, you can make good use of a broken axis on x.

有两种获取断轴的方法.第一个依赖于三元运算符,仅在您感兴趣的区域绘制数据(在您的情况下甚至没有必要),并向左移动xtics以减小空白区域的尺寸. 这是一个很好的教程:

There are two ways to obtain broken axis. The first one relies on ternary operators to plot the data only in the region of your interest, which in your case should not even be necessary, and shifting the xtics left in order to reduce the dimension of the empty region. This is a nice tutorial:

http://gnuplot-tricks.blogspot.com/2009/06/broken-axis-revisited.html

第二个方法改为使用多图.这可能更适合您的需求.

The second one makes uses of multiplots instead. This is probably better suit to your needs.

http://gnuplot-tricks.blogspot. com/2010/06/broken-axis-once-more.html

希望有帮助.

这篇关于有没有办法让gnuplot使用xaxis时间数据,但是跳过某些时间间隔(例如非交易时间)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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