title: Python plot legend is not draggable. gives an error
body: <p>I have data and I am trying for produce the plot. It does produce plot but legend is not draggable. It gives me an error mentioned below. </p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib
  import ast
  ...................
  ...................
  .
  .
  .
  .
  .   
  
  fig, ax = plt.subplots()
  
  for f in datafile:
      plt.plot(f[0],f[1])
  
  
  
  
  plt.tick_params(axis='both', which='major', labelsize=15)
  plt.legend(datanames)
  plt.legend(loc='best', numpoints=1)
  plt.legend().draggable()    
  
  
  plt.grid()  
  plt.show()
  </code></pre>
  
  <p>I am trying plot and it gives me an error</p>
  
  <blockquote>
    <p>AttributeError: 'NoneType' object has no attribute 'draggable'</p>
  </blockquote>
  
  <p>How can it be fixed?</p>