我正在尝试使用Plotly绘制事件的时间轴,我有以下示例代码:
res = {
"First event": 5,
"Second event": 6,
"Third event": 30
}
names, dates = zip(*res.items())
trace = go.Scatter(
x=dates, y=[0] * len(names), text=names, mode='lines+markers+text',
marker=dict(
symbol="hexagon-dot",
size=10,
)
)
layout = go.Layout()
fig = go.Figure(layout=layout, data=[trace])
iplot(fig)
我想要做的是旋转标记文本,使标记不重叠。可以这样做吗?