plotly/plotly.rs

Plot to ImageBuffer -- [Feature-Request]

Closed this issue · 1 comments

Can there be a feature to convert a plotly::Plot to image::ImageBuffer & image::DynamicImage

Unfortunately, this is not possible. plotly-rs like plotly-py and variants are wrappers around plotly.js . What you are requesting cannot be done in this crate alone. In plotly terminology, what you are referring to is static image export. This is explained for example here: https://plotly.com/python/static-image-export/

If you really need this, one not so nice way could be to do as this SO answer suggests https://stackoverflow.com/questions/70308066/python-plotly-image-how-to-save-image-to-a-iobuffer-and-read-it-back