#NEWLINE# def display( fig = None , closefig = True , **kwargs ) : #NEWLINE# #INDENT# '\n    Convert a Matplotlib Figure to a Leaflet map. Embed in IPython notebook.\n\n    Parameters\n    ----------\n    fig : figure, default gcf()\n        Figure used to convert to map\n    closefig : boolean, default True\n        Close the current Figure\n    ' #NEWLINE# from IPython.display import HTML #NEWLINE# if ( fig is None ) : #NEWLINE# #INDENT# fig = plt . gcf ( ) #NEWLINE# #UNINDENT# if closefig : #NEWLINE# #INDENT# plt . close ( fig ) #NEWLINE# #UNINDENT# html = fig_to_html ( fig , ** kwargs ) #NEWLINE# iframe_html = '<iframe src="data:text/html;base64,{html}" width="{width}" height="{height}"></iframe>' . format ( html = base64 . b64encode ( html . encode ( 'utf8' ) ) . decode ( 'utf8' ) , width = '100%' , height = int ( ( 60.0 * fig . get_figheight ( ) ) ) ) #NEWLINE# return HTML ( iframe_html )