Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bar plot appears empty with Plotly 6 #5341

Closed
Labels
P1needed for current cycle bugsomething broken regressionthis used to work
@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:

Image

Locally 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1needed for current cycle bugsomething broken regressionthis used to work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /