plotly / plotly.py

The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
https://plotly.com/python/
MIT License
16.31k stars 2.55k forks source link

empty splom in case of two dimensions #4802

Open jbentvelsen opened 1 month ago

jbentvelsen commented 1 month ago

Creating a splom with two dimensions, no diagonal and only the upper or lower half results in an empty figure.

Code that reproduces the issue:

import numpy as np
import pandas as pd
import plotly.graph_objects as go

data = pd.DataFrame({"col1": np.random.rand(10), "col2": np.random.rand(10)})

fig = go.Figure(
    go.Splom(
        dimensions=[{"label": label, "values": data[label]} for label in data.columns],
        diagonal={"visible": False},
        showupperhalf=False,
        showlowerhalf=True,
    ),
)

fig.write_html("test.html")  # or fig.show()
# Gives me an empty plot. Setting `diagonal` or `showupperhalf` to `True` does give a plot

Expected result A single scatter plot.

Coding-with-Adam commented 1 month ago

original issue reported on the Plotly forum in this post.