Persisting plots to livebook notebooks

I have a livebook that generates a number of VegaLite plots, which I’d like saved as part of the notebook, like you can do in Jupyter.

Unfortunately, if I kill the session and re-open the notebook, none of the plots have been saved, even if I had selected the “persist outputs” options in the save menu. Other types of cell outputs are persisted, sure, but no plots.

Am I missing something here about how to configure livebook so that it will save these plots to the .livemd file?

I want to be able to share this notebook with a colleague and have them be able to view the plots, without having to re-run the entire notebook—the computation required to generate these plots in the first place takes a long time.

Can this be done in Livebook?

1 Like

As far as I know, Livebook doesn’t support that at this moment.

That said, when you mentioned that the computation to generate the plots took a long time, I can see how having a feature to “save” the generated plots together with the notebook makes sense for that scenario. :thinking:

4 Likes

Not having this feature in Livebook makes using it as part of an Elixir data science workflow pretty infeasible, due to the issue I’ve raised above. How hard would it be to embed plots inline (e.g. as PNGs) like Jupyter does? It would be great to know this is a top priority feature for upcoming versions of Livebook.

1 Like