问题
Plotly says it is a web library. Matplotlib does support Wxpython but comparatively, it is too low level. Is there any way to integrate Plotly inside a Wxpython GUI or are there any alternative for it?
回答1:
You might be able to use Plotly's ability to export plots to images to get the plots into wxPython:
- https://plot.ly/python/offline/#static-image-export
If you need the live plotting though, then you will need to use Webview:
- https://wxpython.org/Phoenix/docs/html/wx.html2.WebView.html
I also see that Plotly can now be used offline, so if you used that plus Webview, it should work.
回答2:
Wxpython webview doesn't support 3-d graphs from plotly.
For 3-d graphs, I used cefpython. It embeds a full chromium browser inside python application. wxpython example can be found here: https://github.com/cztomczak/cefpython/blob/master/examples/wxpython.py.
I used plotly offline, and read the file inside cefpython.
来源:https://stackoverflow.com/questions/55356863/integrating-plotly-inside-wxpython