简体   繁体   English

散景时间图

[英]Bokeh time plotting

I am experimenting with time plots such as this example from bokeh . 我有时间试验地块像这样的例子 ,从bokeh Is it possible to create minor ticks for the x-axis? 是否可以为x轴创建较小的刻度线? I tried all the different options inside p.xaxis.minor but none seemed useful. 我尝试了p.xaxis.minor内部的所有不同选项,但似乎没有用。

Here's the code from example: 这是示例代码:

import pandas as pd
from bokeh.plotting import figure, output_file, show

AAPL = pd.read_csv(
        "http://ichart.yahoo.com/table.csv?s=AAPL&a=0&b=1&c=2000&d=0&e=1&f=2010",
        parse_dates=['Date']
    )

output_file("datetime.html")

# create a new plot with a datetime axis type
p = figure(width=800, height=250, x_axis_type="datetime")

p.line(AAPL['Date'], AAPL['Close'], color='navy', alpha=0.5)

show(p)

And the image: 和图像:

在此处输入图片说明

From what it seems it's automatically turned off, and the x-axis updates properly as you zoom in, but it would be great to include minor ticks for visualization purpose. 从外观上看,它会自动关闭,并且在您放大时x-axis正确更新,但是最好包括较小的刻度以实现可视化。

As of Bokeh 0.10, the BokehJS DatetimeTicker sets num_minor_ticks to zero on the internal tickers that it uses: 由于散景0.10,在BokehJS DatetimeTicker设置num_minor_ticks上它使用的内部代号零:

https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/ticking/datetime_ticker.coffee#L23 https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/ticking/datetime_ticker.coffee#L23

There is currently no simple way exposed to override this (You could write some JavaScript to reach in directly, but that would be a pain). 当前没有简单的方法可以覆盖此方法(您可以编写一些JavaScript以直接到达,但这会很痛苦)。 I am not sure if this state of affairs is due to some inherent problem with minor ticks and datatime ranges, or if this was merely an oversight. 我不确定这种情况是否是由于一些较小的滴答声和数据时间范围所固有的问题,还是仅仅是一个疏忽。 Please make a new issue on the Bokeh GH issue tracker so it can be investigated: 请在Bokeh GH问题跟踪器上发布一个新期刊,以便对其进行调查:

https://github.com/bokeh/bokeh/issues https://github.com/bokeh/bokeh/issues

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM