Open cderv opened 1 year ago
Thanks, I can reproduce.
In principle I agree that we should suppress auto-printing of the intermediate figures here, but changing the auto-printing semantics here is going to be a breaking change which we'll have to do thoughtfully.
For now, users can explicitly disable printing of intermediate plots by enabling jupyter_compat=TRUE
mode. In this mode, only the very last expression in a chunk gets auto-printed, and only if it doesn't end with a trailing ;
.
E.g., updating the chunk like:
```{python}
#| jupyter_compat: true
#| echo: false
import plotly.graph_objects as go
import numpy as np
.... (same as before)
Thanks ! I did not know about this jupyter_compat
mode.
You may want to have a peek at ?reticulate::eng_python
. We recently updated the help page to comprehensively list all the knitr options we support.
From https://github.com/quarto-dev/quarto-cli/issues/4507 - idea is to try the examples at https://plotly.com/python/sliders/