def display_figure_with_iterm2(fig):
 print display_image_bytes(_get_buffer(fig, format='png', dpi=fig.dpi).read())

def display_figure_with_iterm2 ( fig ) : print display_image_bytes ( _get_buffer ( fig , format = 'png' , dpi = fig . dpi ) . read ( ) )
displays a matplotlib figure using iterm2 inline-image escape sequence .