0

I was working with this piece of code and it is not working . Or maybe I don't know how to do it. What I am trying to do is putting a matplotlib plot in guizero. Is there a way to do it?

import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from guizero import App, Text,TextBox,PushButton fig, ax = plt.subplots() # Create a figure containing a single axes. ax.plot([1, 2, 3, 4], [1, 4, 2, 3]); # Plot some data on the axes. fig = plt.figure() # an empty figure with no Axes fig, ax = plt.subplots() # a figure with a single Axes #fig, axs = plt.subplots(2, 2) # a figure with a 2x2 grid of Axes plt.show() input_text='' def do_nothing(): input_text=input_box.value text.value=input_box.value app = App() input_box = TextBox(app) text = Text(app, text="The value") button = PushButton(app, command=do_nothing) app.display() 
3
  • Looks like off-topic to me. What is Pi specific in this question? Commented Sep 14, 2022 at 8:23
  • @Vadim but I am doing it on py. Could be another issue. Can't say anything. Commented Sep 14, 2022 at 9:24
  • Are you sure it is at all possible to plot MPL figures inside guizero UI? Quick search didn't give any meaningful results... Commented Sep 14, 2022 at 20:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.