Skip to content

Plotly plots do not display with marimo 0.17.1 #6926

@zaneselvans

Description

@zaneselvans

Describe the bug

Upon upgrading to marimo v0.17.1, I seem to have lost the ability to display plots created using Plotly. There are no errors -- they simply do not display.

Matplotlib still behaves as expected. Downgrading to marimo v0.17.0 restores the expected behavior of plots being displayed.

Screenshot with marimo v0.17.0:

Image

Screenshot with marimo v0.17.1:

Image

Will you submit a PR?

  • Yes

Environment

I'm not sure how to generate this for the environment that is relevant to the sandboxed notebook included below to reproduce the behavior.

Replace this line with the output of marimo env. Leave the backticks in place.

Code to reproduce

# /// script
# requires-python = ">=3.13"
# dependencies = [
#     "marimo==0.17.1",
#     "pandas==2.3.3",
#     "plotly==6.3.1",
#     "matplotlib>=3.8.0",
# ]
# ///

import marimo

__generated_with = "0.17.1"
app = marimo.App(width="full")


@app.cell
def _():
    """Import minimal dependencies for plotting bug reproduction."""

    import matplotlib.pyplot as plt
    import pandas as pd
    import plotly.express as px
    return pd, plt, px


@app.cell
def _(pd):
    """Create minimal test dataset."""

    test_data = pd.DataFrame({"x": [1, 2, 3, 4, 5], "y": [2, 5, 3, 8, 7]})

    test_data
    return (test_data,)


@app.cell
def _(px, test_data):
    """Create basic plotly figure - this demonstrates the display bug."""

    fig = px.line(test_data, x="x", y="y", title="Test Line Chart (Plotly)")
    fig
    return


@app.cell
def _(plt, test_data):
    """Create analogous matplotlib figure for comparison."""

    plt.plot(test_data["x"], test_data["y"], marker="o")
    plt.title("Test Line Chart (Matplotlib)")

    plt.show()
    return


if __name__ == "__main__":
    app.run()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions