plotly / plotly.py

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

Traces in facet plot drawn outside of figure area. #3549

Open rileygemynd opened 2 years ago

rileygemynd commented 2 years ago

Code to reproduce the issue:

import pandas as pd
import numpy as np
import plotly
import string
np.random.seed(0)
plotly.io.renderers.default = "browser"
COL_NAME = "Key"
FIGURE_HEIGHT = 12200
column_names = string.ascii_letters[0:20]
# FIGURE_HEIGHT = 7200  # This removes the issue 
# column_names = string.ascii_letters[0:10]  # This removes the issue 
df = pd.DataFrame(np.random.randint(0,100,size=(100, len(column_names))), columns=list(column_names))
df.columns.name = COL_NAME
fig = plotly.express.line(df,facet_row=COL_NAME,height=FIGURE_HEIGHT)
fig.show()

Screenshot of what I'm seeing: image

Issue may have to do with the height argument or the number of traces included in the figure, or some other aspect I don't suspect.

Thank you for the help and for the great visualization tool!

bjrnfrdnnd commented 2 years ago

I have the same issue. Strange detail: the markers are drawn wrongly, but the sensitive region for tooltips seems to be correct. I tried that with a number of browsers: chrome, opera, firefox, safari, edge. All show incorrect traces.

henighan commented 2 years ago

Tried a few different versions. I saw the above behavior on v5.3.1-5.6.0, but 4.14.3 seemed to work correctly