code: def inline(width=900):
      
      from IPython.display import Image, HTML, display, clear_output
      import random
      import string
      import urllib
      import os
  
      while True:
          fname = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(32))
          if not os.path.isfile(fname + '.png'):
              break
  
      savefig(fname)
  
      if os.path.isfile(fname + '.png'):
          with open(fname + '.png', 'rb') as fin:
              encoded = base64.b64encode(fin.read())
              b64 = urllib.parse.quote(encoded)
  
          image_html = "<img style='width: %dpx; margin: 0px; float: left; border: 1px solid black;' src='data:image/png;base64,%s' />" % (width, b64)
  
          display(HTML(image_html))
          os.remove(fname + '.png')
docs: display the map inline in ipython
  
      :param width: image width for the browser