在 Plotly 中是否有使用 python 绘制类似于 geom_smooth() 的函数?
Is there any function to plot similar to geom_smooth() in Plotly using python?
我使用 Plotly (python) 制作了一个散点图,我想使用类似于 geom_smooth() 函数的东西连接这些点。
类似于下图:
你应该可以通过在定义线条时设置shape='spline'来完成。这是情节示例
trace2 = go.Scatter(
x=[1, 2, 3, 4, 5],
y=[6, 8, 7, 8, 6],
mode='lines+markers',
name="'spline'",
text=["tweak line smoothness<br>with 'smoothing' in line object"],
hoverinfo='text+name',
line=dict(
shape='spline'
)
)
请在此处查看示例:plotly line charts
我使用 Plotly (python) 制作了一个散点图,我想使用类似于 geom_smooth() 函数的东西连接这些点。
类似于下图:
你应该可以通过在定义线条时设置shape='spline'来完成。这是情节示例
trace2 = go.Scatter(
x=[1, 2, 3, 4, 5],
y=[6, 8, 7, 8, 6],
mode='lines+markers',
name="'spline'",
text=["tweak line smoothness<br>with 'smoothing' in line object"],
hoverinfo='text+name',
line=dict(
shape='spline'
)
)
请在此处查看示例:plotly line charts