title: Does method for plotting need return?
body: <p>I have a class with methods to build some plots. I try to display different plots on one figure. The properties (title, legend...) of the figure are always overwritten by the last plot. I expected that if I have <code>return</code> in my method the behaviour would be different to the method without it, but it seems to not be true.</p>
  
  <p>I would like to figure out what difference makes to have <code>return</code>. The code to illustrate my question is:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  
  class myClass1(object):
      def __init__(self):
          self.x = np.random.random(100)
          self.y = np.random.random(100)
  
      def plotNReturn1(self):
          plt.plot(self.x,self.y,'-*',label='randNxy')
          plt.title('Plot No Return1')
          plt.legend(numpoints = 1)
      def plotNReturn2(self):
          plt.plot(self.y,self.x,'-x',label='randNzw')
          plt.title('Plot No Return2')
          plt.legend(numpoints = 2)
  
      def plotWReturn1(self):
          fig = plt.plot(self.x,self.y,'-*',label='randWxy')
          fig = plt.title('Plot With Return1')
          fig = plt.legend(numpoints = 1)
          return fig
      def plotWReturn2(self):
          fig = plt.plot(self.y,self.x,'-x',label='randWzw')
          fig = plt.title('Plot With Return2')
          plt.legend(numpoints = 3)
          return fig
  
  
  if __name__=='__main__':
      f = myClass1()
      p = plt.figure()
  
      p1 = p.add_subplot(122)
      p1 = f.plotWReturn1()
      p1 = f.plotWReturn2()
      print 'method with return: %s: ' % type(p1)
  
      p2 = p.add_subplot(121)
      p2 = f.plotNReturn1()
      p2 = f.plotNReturn2()
      print 'method without return: %s: ' % type(p2)
  
      plt.show()
  </code></pre>
  
  <p>The only difference I noticed is the type of the output, but I don't know what it means in practice.</p>
  
  <pre><code> method with return: &lt;class 'matplotlib.text.Text'&gt;: 
   method without return: &lt;type 'NoneType'&gt;: 
  </code></pre>
  
  <p>Is it only about "pythonic" practice or is there anything practical to use any of the style? </p>