Get a Python plotly output with quarto reveal.js presentation - Stack Overflow

admin2025-04-19  0

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. How can I get the plotly output?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745078110a283688.html

最新回复(0)