简体   繁体   English

Plotly / plotly.express 中的群图

[英]Swarm plots in Plotly / plotly.express

you can do Plotly.Scatter with the 'jitter' argument but that seems to scatter randomly.您可以使用 'jitter' 参数执行 Plotly.Scatter ,但这似乎是随机分散的。 Notice how neatly these are spaced out in Seaborn?请注意这些在 Seaborn 中的间隔是多么整齐? Can that be replicated in Plotly?可以在 Plotly 中复制吗?

Seaborn 'Swarm' 地块

To my knowledge, no, but there is an option points="all" to the px.box function that would add the swarm plot to the left side of the box.据我所知,没有,但是px.box function 有一个选项points="all"可以将群 plot 添加到框的左侧。 The example below is taken from the plotly documentation page about boxplot下面的示例取自plotly 文档页面关于箱线图

import plotly.express as px
df = px.data.tips()
fig = px.box(df, x="time", y="total_bill", points="all")
fig.show()

Output: Output:

在此处输入图像描述

See strip from plotly.express .请参阅plotly.express中的strip

在此处输入图像描述

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

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