def icreate_animations(figure, filename=None, sharing='public', auto_open=False):
 url = create_animations(figure, filename, sharing, auto_open)
 if isinstance(figure, dict):
  layout = figure.get('layout', {})
 else:
  layout = {}
 embed_options = dict()
 embed_options['width'] = layout.get('width', '100%')
 embed_options['height'] = layout.get('height', 525)
 try:
  float(embed_options['width'])
 except (ValueError, TypeError):
  pass
 else:
  embed_options['width'] = (str(embed_options['width']) + 'px')
 try:
  float(embed_options['height'])
 except (ValueError, TypeError):
  pass
 else:
  embed_options['height'] = (str(embed_options['height']) + 'px')
 return tools.embed(url, **embed_options)

def icreate_animations ( figure , filename = None , sharing = 'public' , auto_open = False ) : url = create_animations ( figure , filename , sharing , auto_open ) if isinstance ( figure , dict ) : layout = figure . get ( 'layout' , { } ) else : layout = { } embed_options = dict ( ) embed_options [ 'width' ] = layout . get ( 'width' , '100%' ) embed_options [ 'height' ] = layout . get ( 'height' , 525 ) try : float ( embed_options [ 'width' ] ) except ( ValueError , TypeError ) : pass else : embed_options [ 'width' ] = ( str ( embed_options [ 'width' ] ) + 'px' ) try : float ( embed_options [ 'height' ] ) except ( ValueError , TypeError ) : pass else : embed_options [ 'height' ] = ( str ( embed_options [ 'height' ] ) + 'px' ) return tools . embed ( url , ** embed_options )
create a unique url for this animated plot in plotly and open in ipython .