title: Python- plotting multiple graphs on same figure in frame in Tkinter
body: <p>I am building a GUI where values from some models will show graphs upon button click. As of now it works with one graph but when i try to plot the second graph, both of them plotted but merged. I want them to show separately inside one frame. For now, i am using tkinter canvas for plotting. Here is what i have done till now-</p>
  
  <pre><code>    f = Figure(figsize=(3,3), dpi=100)
      def graph1():
  
          a = f.add_subplot(111)
          a.plot([1, 2, 3, 4], [1, 4, 9, 16])
          canvas = FigureCanvasTkAgg(f, self.RightFrame)
          canvas.get_tk_widget().pack(side=LEFT)
          canvas._tkcanvas.pack(side=LEFT)
      def graph2():
          a = f.add_subplot(121)
          a.plot([6, 9, 12, 15], [20, 25, 30, 35])
          canvas = FigureCanvasTkAgg(f, self.RightFrame)
          canvas.get_tk_widget().pack(side=LEFT)
          canvas._tkcanvas.pack(side=LEFT)
  
      Button(self.RightFrame,text='Show Graph1',command=graph1).pack(side=TOP)    
      Button(self.RightFrame,text='Show Graph2',command=graph2).pack(side=TOP) 
  </code></pre>
  
  <p>code for the frame is below-</p>
  
  <pre><code>    self.RightFrame = Frame(Tab1)
      self.RightFrame.place(relx=0.165, rely=0.066, relheight=0.83, relwidth=0.842)
      self.RightFrame.configure(relief='groove')
      self.RightFrame.configure(borderwidth="2")
  </code></pre>
  
  <p>The graphs i am getting-
  <a href="https://i.stack.imgur.com/yx2nH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yx2nH.png" alt="enter image description here"></a></p>
  
  <p>Instead of pack(), i tried to use grid and place but still nothing. I want to plot at least 4 graphs. What am i doing wrong/missing here? Thank you</p>
  
  <p>P.S. i am using sample values for basic plotting for the time being.</p>