plotly / plotly/plotly.py

Feature Request: Implement Bagplot (Bivariate Boxplot) for 2D and 3D Data Visualization

Offen
#5,382 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
18.8k
Forks
2.8k
Ø Merge
16 Std. 26 Min.
Gemergte PRs (30 T.)
21

Beschreibung

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

Image

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()

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Es werden keine Implementierungsdateien oder Tests genannt. Beginne damit, Plotlys Python Express- und graph_objects-APIs zusammen mit dem referenzierten Bagplot-Paper zu überprüfen, und kläre anschließend, ob der Umfang 2D, 3D oder beides umfasst; abgeschlossen bedeutet eine vereinbarte API und ein entsprechendes Visualisierungsverhalten für die angeforderten Data-Depth- und Ausreißerfunktionen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
plotly, python
Bereich
data-visualization
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.