Place graph on Qiwi as widget with button

I want to put a graph that updates itself. So when I click the Kivy button on my GUI script written in Python and it should take me in Screen

. Screen

has a graph on the part Screen

and buttons on the rest of the screen. However, I add a graph and it opens in a separate window. How to do it?

I used a library matplotlib

for plotting.

I have used plt.show()

and it opens another window.

+3


source to share


1 answer


To prevent it matplotlib

from stealing your focus Window

, you need to tell it to do it for some strange reason (maybe high MPL usage in IPython notebook?)

import matplotlib
matplotlib.use('Agg')

      



After these lines, the window should stop stealing. An update, on the other hand, is something else and that's why garden.graph

and garden.matplotlib

.

If you intend to just draw some simple plots, just use Graph. If you really need MPL and / or want to do something complex, use the MPL ( garden.matplotlib

) server .

+1


source







All Articles