Python Forum
Second window with buttons and plot
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Second window with buttons and plot
#1
Hey, I have main window and if I click on button then second window will open. In second window I will have buttons and text fields on the left and one plot on the right side. This is my code now:

class SecondWindow(QWidget):
    def __init__(self):
        super().__init__()                          
        self.setMinimumSize(600,300)   
        self.setWindowTitle("Second Window")
        self.label1 = QLabel("Value1: ", self)          
        self.label1.setGeometry(20, 20, 150, 20)
        self.edit1 = QLineEdit("", self)
        self.edit1.setGeometry(160, 20, 50, 20)
If I add code for circle (below) nothing happened.
How to add plot on the right side of this window?

Circle:
        figure, axes = plt.subplots()
        Drawing_uncolored_circle = plt.Circle( (0.6, 0.6 ), 0.3 ,fill = False )
 
        axes.set_aspect( 1 )
        axes.add_artist( Drawing_uncolored_circle )
        plt.title( 'Circle' )
        plt.draw()
Thanks
Reply
#2
What is plt? Are you using matplotlib?

If you want the plot to be visible you need to call show(). draw() is used to update a plot, not draw it to the screen.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a way to call and focus any popup window outside of the main window app? Valjean 6 1,610 Oct-02-2023, 04:11 PM
Last Post: deanhystad
  Pyspark Window: perform sum over a window with specific conditions Shena76 0 1,131 Jun-13-2022, 08:59 AM
Last Post: Shena76
  How to plot intraday data of several days in one plot mistermister 3 2,854 Dec-15-2020, 07:43 PM
Last Post: deanhystad
  How to plot vertically stacked plot with same x-axis and SriMekala 0 1,884 Jun-12-2019, 03:31 PM
Last Post: SriMekala
  Buttons or Radio Buttons on Tkinter Treeview draems 0 3,328 Oct-31-2017, 04:06 AM
Last Post: draems

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020