[Python] Get a Python plotly output with quarto reveal.js presentation

Discussão em 'Python' iniciado por Stack, Março 3, 2025.

  1. Stack

    Stack Membro Participativo

    Plotly graph are not outputed in quarto.

    Here is my code:

    ---
    title: "Title"
    format:
    revealjs:
    auto-fit: false


    ## Slide

    ```{python}
    from IPython.display import HTML
    import plotly.express as px
    data = {"x": [1, 2, 3, 4], "y": [10, 20, 15, 25]}

    # Create a figure
    fig = px.line(data, x="x", y="y", title="Simple Plotly Line Chart")

    # Show the plot
    fig.show()
    ```

    ## Matplotlib
    ```{python}
    import matplotlib.pyplot as plt
    plt.plot([1,2,3])
    ```


    There is not plotly output, while it works seamlessly for matplotlib plot. [​IMG] How can I get the plotly output?

    Continue reading...

Compartilhe esta Página