在破折号或散景中绘制时间轴

问题描述 投票:0回答:1

我想在python中绘制一个时间轴。但指责matplotlib有阿拉伯语单词的问题,我想使用dashbokeh为此。我搜索了互联网,但找不到任何可以在那些地方绘制时间线的东西。

有人可以帮帮我吗?

python bokeh timeline plotly-dash
1个回答
0
投票

这可以在Bokeh中找到,你可以在this页面上找到一个简单的例子。

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

df = pd.DataFrame(AAPL)
df['date'] = pd.to_datetime(df['date'])

output_file("datetime.html")

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

p.line(df['date'], df['close'], color='navy', alpha=0.5)

show(p)
© www.soinside.com 2019 - 2024. All rights reserved.