Closed wangjiawen2013 closed 1 month ago
It sounds interesting. I didn't know we could fetch dependencies via git and wasn't aware of pyo3. Thanks.
I've read a little about Pyo3, but unfortunately, I won't have the time to implement it. The approach of saving an SVG (or PNG) file has worked for me for years. I'll close this for now, but the possibility of using Pyo3 is on the table as a future PR.
Hi,
As is said in https://github.com/cpmech/plotpy/issues/58#issuecomment-2303621266 "I assume some of the crates wouldn't have save in the name because they don't need to save a file in order to show it - i.e. they just print out the image data directly to stdout without creating any files."
The working strategy of plotpy is practical but inefficient, especially when the dataset is larger. I am trying to run python code in rust directly without saving them to the disk. This is a minimal example: Cargo.toml:
main.rs
I ran the "buffer" from plotpy in pyo3 successfully without any interaction with disk. And we perhaps can even get svg string from matplotlib and showing jupyter directly without saving the figure (such as through Try using StringIO to avoid writing any file-like object to disk). This is only a minimal example. I think a great effort is needed if we adopt this strategy. But now we can keep an eye on it in the future.