flutter-pi icon indicating copy to clipboard operation
flutter-pi copied to clipboard

How can I show a python plot? (Question)

Open AndroidDesigner opened this issue 1 year ago • 2 comments

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?

AndroidDesigner avatar Mar 01 '24 18:03 AndroidDesigner

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).

dylanhillier avatar Mar 20 '24 05:03 dylanhillier

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.

ardera avatar Mar 20 '24 14:03 ardera