title: How to produce a matplotlib graph in a tabbed panel using the kivy liabary
body: <p>Hi there please can I have some help? I have been trying to produce a school planner app. I am using tabbed panels in python using the kivy library and where the third tab produces a matplotlib graph. However I keep getting an error and the kivy display window doesn't display.</p>
  <p>My .py file called tabbed panel 4 graph.py-</p>
  <pre><code>from kivy.app import App
  from kivy.uix.widget import Widget
  from kivy.properties import ObjectProperty
  from kivy.lang import Builder
  from kivy.uix.tabbedpanel import TabbedPanel
  from matplotlib import pyplot as plt
  import numpy as np
  
  Builder.load_file('tabbedpanel4graph.kv.py')
  
  class MyLayout(TabbedPanel):
      pass
  
  class StudentPlannerAppApp(App):
      def build(self):
          return MyLayout()
  
  if __name__ == '__main__':
      StudentPlannerAppApp().run()
  </code></pre>
  <p>My .kv file called tabbedpanel4graph.kv-</p>
  <pre><code>&lt;MyLayout&gt;
      do_default_tab:False
      TabbedPanelItem:
          text:&quot;Welcome&quot;
          Label:
              text: &quot;Hello!&quot;
      TabbedPanelItem:
          text:&quot;Timetable&quot;
          BoxLayout:
              Label:
                  text:&quot;Button --&gt;&quot;
              Button:
                  text:&quot;Click me&quot;
      TabbedPanelItem:
          text: &quot;Graphs&quot;
          BoxLayout:
              layout:layout
                  id:Layout
                  x = [7,89.6,45,32]
                  y = [3,2,78,4]
                  plt.plot(x,y)
                  plt.xlabel('Time(s)')
                  plt.ylabel('signal (norm)')
                  self.str.layout.add_widget(FigureCanvasKivyAgg(plt.gcf()))
                  return self.str
  </code></pre>
  <p>My error-</p>
  <pre><code>     if current_property[:3] == 'on_':
   TypeError: 'NoneType' object is not subscriptable
  </code></pre>
  <p>Thanks in advance.</p>