Integrating Plotly inside WxPython

允我心安 提交于 2021-02-11 12:43:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!