title: How do I create nested windows in python Tkinter?
body: <p>I want to create a window inside a window. The outer window is just plain and the inner window is a graph. The reason for it is that I would like to make a monitoring system with multiple graphs where nested windows would help. </p>
  
  <p>Here is the code : </p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.dates as mdates
  import Tkinter
  
  x = []
  y = []
  
  top = Tkinter.Tk()
  
  top.title("Hello tkInter");
  top.geometry("1000x1000")
  
  fig=plt.figure()
  
  rect = fig.patch
  rect.set_facecolor('#31312e')
  
  readFile = open('sampleCSV.csv','r')
  sepFile = readFile.read().split('\n')
  readFile.close()
  
  for plotPair in sepFile:
      xAndY = plotPair.split(',')
      if xAndY[0] != '':
          x.append(int(xAndY[0]))
          y.append(int(xAndY[1]))
  
  ax1 = fig.add_subplot(2,2,1, axisbg='grey')
  ax1.plot(x, y, 'c', linewidth=3.3)
  ax1.tick_params(axis='x', colors='c')
  ax1.tick_params(axis='y', colors='c')
  ax1.spines['bottom'].set_color('w')
  ax1.spines['top'].set_color('w')
  ax1.spines['left'].set_color('w')
  ax1.spines['right'].set_color('w')
  ax1.yaxis.label.set_color('c')
  ax1.xaxis.label.set_color('c')
  ax1.set_title('Matplotlib graph', color = 'c')
  ax1.set_xlabel('x axis')
  ax1.set_ylabel('y axis')
  
  ax2 = fig.add_subplot(2,2,2, axisbg='grey')
  ax2.plot(x, y, 'c', linewidth=3.3)
  ax2.tick_params(axis='x', colors='c')
  ax2.tick_params(axis='y', colors='c')
  ax2.spines['bottom'].set_color('w')
  ax2.spines['top'].set_color('w')
  ax2.spines['left'].set_color('w')
  ax2.spines['right'].set_color('w')
  ax2.yaxis.label.set_color('c')
  ax2.xaxis.label.set_color('c')
  ax2.set_title('Matplotlib graph', color = 'c')
  ax2.set_xlabel('x axis')
  ax2.set_ylabel('y axis')
  
  ax3 = fig.add_subplot(2,1,2, axisbg='grey')
  ax3.plot(x, y, 'c', linewidth=3.3)
  ax3.tick_params(axis='x', colors='c')
  ax3.tick_params(axis='y', colors='c')
  ax3.spines['bottom'].set_color('w')
  ax3.spines['top'].set_color('w')
  ax3.spines['left'].set_color('w')
  ax3.spines['right'].set_color('w')
  ax3.yaxis.label.set_color('c')
  ax3.xaxis.label.set_color('c')
  ax3.set_title('Matplotlib graph', color = 'c')
  ax3.set_xlabel('x axis')
  ax3.set_ylabel('y axis')
  
  plt.show()
  
  fig.pack()
  
  top.mainloop()
  </code></pre>
  
  <p>I am not able to figure out a solution to this. Please HELP! </p>