ardera / flutter-pi

A light-weight Flutter Engine Embedder for Raspberry Pi that runs without X.
MIT License
1.48k stars 153 forks source link

How can I show a python plot? (Question) #393

Open AndroidDesigner opened 2 months ago

AndroidDesigner commented 2 months ago

Hi everyone. I need to run a python code using process_run to plot something by matplotlib python package, but flutter-pi runs without X11. Therefore, my python command executes but no plot can be shown. So what do I have to do?

dylanhillier commented 2 months ago

You could probably not use flutter-pi, but instead build your flutter app so that it runs on X11? Or you could run the process to generate an image instead of attempting to load the plot through an X11 window, then just display the window.. Or you could instead of trying to use matplot lib, just output a CSV temp file, then use a flutter graphing library to display the plot (assuming its simple).

ardera commented 1 month ago

If the plot isn't interactive, you could also save the plot as a png in python and use an Image widget in flutter to show it.