In the last section, we covered how to get plotting with Ploty using Plotly for Rust paired with our very own workaround. If you continued experimenting with this approach before starting this section you may have encountered some limitations:

File size . The notebook file from the previous section, plotting-with-plotly.ipynb , weighed in at around $3.4$ MB. This is an unusually large file for what was only a few paragraphs and a single interactive plot.

. The notebook file from the previous section, , weighed in at around $3.4$ MB. This is an unusually large file for what was only a few paragraphs and a single interactive plot. Multiple plots . If you tried to output a second Plotly plot in the same notebook, only the first one would be rendered.

. If you tried to output a second Plotly plot in the same notebook, only the first one would be rendered. File size, again. If you did solve the issue regarding multiple plots, your file size would grow linearly for every plot output. A second plot would take you from $3.4$ MB to $6.8$ MB.

We're going to improve our workaround so that we can produce many of our nice interactive plots without bloating our notebooks and any HTML files we may save to.

Example Plotly Plot¶

Let's use the code from the previous section to generate our plot. We will then save this to a file as HTML, and load it back into a string for further processing.