-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
@mwouts
Description
Hi, thanks for the great library, I am a huge fan !
I observe an issue with Plotly 6 that prevents me from updating. Some of my plots appear empty, like here:
ImageLocally I am able to reproduce the problem with this minimal environment
uv init empty_plot_issue
cd empty_plot_issue/
uv add 'plotly>6' pandas ipykernel nbformat
uv run python -m ipykernel install --user --name empty_plot_issue
and minimal code:
import plotly.express as px
data_canada = px.data.gapminder().query("country == 'Canada'")
fig = px.bar(data_canada, x='year', y='pop')
fig.show()
In the problematic plot, x
and y
are np.array
objects. If I convert them to lists then I get the expected bar plot:
import plotly.graph_objects as go
data_canada = px.data.gapminder().query("country == 'Canada'")
data = [go.Bar(
# without tolist the plot appears empty
x=data_canada['year'].tolist(),
y=data_canada['pop'].tolist()
)]
go.Figure(data)
Could this relate to my version of JupyterLab? Do I need to update my Jupyter server maybe?