【发布时间】:2017-11-01 15:00:40
【问题描述】:
我用 Bokeh 创建了一个图表,其中 X 轴的类型为“日期时间”。 不幸的是,X 轴上显示的标签被截断。 如何防止这种截断?
这是我的代码:
TOOLS = "pan,wheel_zoom,box_zoom,reset,save"
p = figure(x_axis_type="datetime", tools=TOOLS, plot_width=1000, plot_height=600, title = "Feed")
p.xaxis.formatter=DatetimeTickFormatter(
hours=["%d %B %Y"],
days=["%d %B %Y"],
months=["%d %B %Y"],
years=["%d %B %Y"],
)
p.grid.grid_line_alpha=0.3
p.line(_df.datetime, [i for i in range(len(_df.datetime))], color='firebrick', legend='Fast Ask')
output_file("bokeh.html", title="example")
output_notebook()
show(p) # open a browser
这是图表:
谢谢, 杰拉德
【问题讨论】:
标签: bokeh