Using wx and pyplot

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Using wx and pyplot



I've been building an application that uses both wx and matplotlib (pyplot) to show bar plots for relevant information. Part of the application's requirements is that we update the graph as we gather more data. I attempted to use pyplot in conjunction with wx but I learned that you can't natively call pyplot to "show()" due to the dependency overlap. I then tried to follow this example and along with explicitly stating the library for the graph UI (mpl.use('TkAgg')) I also tried to use the matplotlib.figure.Figure class to generate the graph in a matplotlib.backends.backend_wxagg.FigureCanvasWxAgg. The biggest problem with this is that I can't have the graph in it's own separate window and I cannot specify the position that I want for this graph. Does anyone have any advice?


mpl.use('TkAgg')


matplotlib.figure.Figure


matplotlib.backends.backend_wxagg.FigureCanvasWxAgg





are you using wxPython or wx' main line? What type of dependency overlap we are talking about? Under which OS you are working? How did you build wx?
– Igor
yesterday





@Igor I'm using wxPython (import wx). As I understand it, wx and matplotlib both use the same kind of wx for graphical methods.I am working on macos. I installed it with homebrew
– J S
yesterday




import wx





so you did get an error message when you tried to have both in your program? What the error said?
– Igor
yesterday





It is very unclear what your problem is. Is it totally feasible to embed a matplotlib plot in wx (see the official documentation). Provide some code that shows the problem that you are having and people will be able to help you
– Diziet Asahi
yesterday









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

UKT6fvW5KBNyAGxJ6z oO2odgb7,OxNPPfGwC
C,1RYoD7,G3YCn41Do,j9 cZFWn2Sc,iO 1h UoRun9wG,zMfFTpRHwEvw2C1rj3F4UjtSD71K2nTdXeEEby p5v,Z,bbX2 NzWu,1AGBy Pxxs

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

415 Unsupported Media Type while sending json file over REST Template