def ishow(cls, figure_or_data, format='png', width=None, height=None,
scale=None):
"""Display a static image of the plot described by `figure_or_data`
in an IPython Notebook.
positional arguments:
- figure_or_data: The figure dict-like or data list-like object that
describes a plotly figure.
Same argument used in `py.plot`, `py.iplot`,
see https://plot.ly/python for examples
- format: 'png', 'svg', 'jpeg', 'pdf'
- width: output width
- height: output height
- scale: Increase the resolution of the image by `scale` amount
Only valid for PNG and JPEG images.
example:
import plotly.plotly as py
fig = {'data': [{'x': [1, 2, 3], 'y': [3, 1, 5], 'type': 'bar'}]}
py.image.ishow(fig, 'png', scale=3)
"""
if format == 'pdf':
raise exceptions.PlotlyError(
"Aw, snap! "
"It's not currently possible to embed a pdf into "
"an IPython notebook. You can save the pdf "
"with the `image.save_as` or you can "
"embed an png, jpeg, or svg.")
img = cls.get(figure_or_data, format, width, height, scale)
from IPython.display import display, Image, SVG
if format == 'svg':
display(SVG(img))
else:
display(Image(img))
```