Black Lives Matter. Please consider donating to Black Girls Code today.

Using py.image.save_as to save image as displayed

I am new to so I appreciate people’s help.

I have produced an image that I can view via (offline) iplot in a jupyter notebook and then when I try to save it with py.image.save_as it changes the image (grid is different for example).

I have looked at the documentation for offline image saving where they recommend to use the entry image=‘png’ (although I need an svg file) and tried the example:

import plotly.offline as offline
import plotly.graph_objs as go


offline.iplot({‘data’: [{‘y’: [4, 2, 3, 4]}],
‘layout’: {‘title’: ‘Test Plot’,
‘font’: dict(size=16)}},

but it gives me an error:

TypeError Traceback (most recent call last)
in ()
7 ‘layout’: {‘title’: ‘Test Plot’,
8 ‘font’: dict(size=16)}},
----> 9 image=‘png’)

TypeError: iplot() got an unexpected keyword argument ‘image’

I was hoping that to try image = ‘svg’ to see if that would render the same displayed in the notebook to the one I saved, but apparently iplot does not accept image as argument.

Any ideas? Thank you