You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a workaround for my problem: simply switch to SVGBackend. I am using Raspberry Pi computers based on CM4 module and with a 64-bit image of Raspberry pi OS. I am doing a pretty basic line plot with two series. My machines make a new plot every 5 minutes. The function appeared ok until I noticed that occasionally one cpu core would be pegged at 100%. I logged the information with a bash script and found it would be this way for 8-9 minutes in the occasion it happened.
Later, I added Rust code to time how long it took to generate the plots and also made a switch in my code to load one backend or the other and this confirmed that i could break the machine or correct it depending on the backend. My module does not crash/panic as far as I know because the machine does keep operating. what I found is that the plot generation command in Rust would take 8-9 minutes! instead of a fraction of a second and that matches what I see for cpu usage.
In the end my solution is to use the SVG backend to create that file and then I use a library called Cairo and python bindings to convert the svg to a png for use in my program.
plotters is a black box to me, so I didn't know how to do any more troubleshooting. I am just putting this here as fyi I guess.
plotters = "0.3.5"
rustc 1.74.1 (a28077b28 2023-12-04)
Python 3.9.2
UsingPy03 to create Rust modules for Python
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I found a workaround for my problem: simply switch to SVGBackend. I am using Raspberry Pi computers based on CM4 module and with a 64-bit image of Raspberry pi OS. I am doing a pretty basic line plot with two series. My machines make a new plot every 5 minutes. The function appeared ok until I noticed that occasionally one cpu core would be pegged at 100%. I logged the information with a bash script and found it would be this way for 8-9 minutes in the occasion it happened.
Later, I added Rust code to time how long it took to generate the plots and also made a switch in my code to load one backend or the other and this confirmed that i could break the machine or correct it depending on the backend. My module does not crash/panic as far as I know because the machine does keep operating. what I found is that the plot generation command in Rust would take 8-9 minutes! instead of a fraction of a second and that matches what I see for cpu usage.
In the end my solution is to use the SVG backend to create that file and then I use a library called Cairo and python bindings to convert the svg to a png for use in my program.
plotters is a black box to me, so I didn't know how to do any more troubleshooting. I am just putting this here as fyi I guess.
plotters = "0.3.5"
rustc 1.74.1 (a28077b28 2023-12-04)
Python 3.9.2
UsingPy03 to create Rust modules for Python
Beta Was this translation helpful? Give feedback.
All reactions