Feature Request: Implement Bagplot (Bivariate Boxplot) for 2D and 3D Data Visualization
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
This proposal suggests adding support for Bagplots (also known as bivariate boxplots) as a new visualization type in Plotly.
Bagplots are a powerful extension of the traditional boxplot to two or more dimensions, providing a powerful vizualisation which shows statistical properties of 2-3 different variables.
While Plotly currently provides strong support for univariate distribution plots (box, violin, histogram), there is no direct tool to visualize bivariate distribution summaries in a similar “statistical boxplot” style.
The Bagplot, introduced by Rousseeuw, Ruts, and Tukey (1999), fills this gap by visualizing the data depth and outliers in 2D (and potentially 3D) space.
It provides an intuitive, robust alternative to kernel density estimates or convex hulls when exploring multivariate data.
Reference:
Rousseeuw, P. J., Ruts, I., & Tukey, J. W. (1999). The Bagplot: A Bivariate Boxplot. The American Statistician, 53(4), 382–387.
ResearchGate link
Figure 1: Example of a 2D Bagplot showing data depth and outliers (adapted from Rousseeuw et al., 1999).
Proposed Functionality
Using the plotly api:
Express:
import plotly.express as px
# 2D Bagplot
fig2d = px.bagplot(df, x="feature1", y="feature2", depth_method="tukey", show_outliers=True)
fig2d.show()
# 3D Bagplot
fig3d = px.bagplot_3d(df, x="feature1", y="feature2", z="feature3",
depth_method="tukey", show_outliers=True)
fig3d.show()
Graph Objects:
import plotly.graph_objects as go
fig = go.Figure(data=go.Bagplot(
x=df["feature1"],
y=df["feature2"],
show_outliers=True,
depth_method="tukey"
))
fig.show()
fig = go.Figure(data=go.Bagplot3D(
x=df["x"], y=df["y"], z=df["z"],
show_outliers=True,
depth_method="tukey"
))
fig.show()
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定任何实现文件或测试。首先查看 Plotly 的 Python Express 和 graph_objects API,以及所引用的 Bagplot 论文,然后明确范围是否包括 2D、3D 或两者;完成意味着已就所请求的 data-depth 和异常值功能达成 API 共识,并确定相应的可视化行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- plotly, python
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100