Skip to content

Support marginal_x/marginal_y="heatmap" in density_heatmap/density_contour #5706

Description

@lucasjamar

For density_heatmap/density_contour, it would be great to specify a heatmap as the marginal plot type as well: a single-row (for marginal_x) or single-column (for marginal_y) heatmap in the margins, colored by the same aggregate (z/histfunc) as the main plot, instead of a bar chart.

Example:

import plotly.express as px
df = px.data.tips()

fig = px.density_heatmap(
    df, x="size", y="tip", z="total_bill", histfunc="sum",
    marginal_x="heatmap", marginal_y="heatmap",
)
fig.show()

Today marginal_x/marginal_y only support 'rug', 'box', 'violin', 'histogram'.

I have an implementation ready and will open a PR referencing this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions