Skip to content

Commit b762d90

Browse files
committed
update save_as to accept emf
1 parent b84b7d0 commit b762d90

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plotly/plotly/plotly.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def get(figure_or_data, format='png', width=None, height=None, scale=None):
712712
describes a plotly figure.
713713
Same argument used in `py.plot`, `py.iplot`,
714714
see https://plot.ly/python for examples
715-
- format: 'png', 'svg', 'jpeg', 'pdf'
715+
- format: 'png', 'svg', 'jpeg', 'pdf', 'emf'
716716
- width: output width
717717
- height: output height
718718
- scale: Increase the resolution of the image by `scale`
@@ -730,7 +730,7 @@ def get(figure_or_data, format='png', width=None, height=None, scale=None):
730730
# TODO: format is a built-in name... we shouldn't really use it
731731
figure = tools.return_figure_from_figure_or_data(figure_or_data, True)
732732

733-
if format not in ['png', 'svg', 'jpeg', 'pdf']:
733+
if format not in ['png', 'svg', 'jpeg', 'pdf', 'emf']:
734734
raise exceptions.PlotlyError(
735735
"Invalid format. This version of your Plotly-Python "
736736
"package currently only supports png, svg, jpeg, and pdf. "
@@ -760,7 +760,8 @@ def get(figure_or_data, format='png', width=None, height=None, scale=None):
760760
if ('content-type' in headers and
761761
headers['content-type'] in ['image/png', 'image/jpeg',
762762
'application/pdf',
763-
'image/svg+xml']):
763+
'image/svg+xml',
764+
'image/emf']):
764765
return response.content
765766
elif ('content-type' in headers and
766767
'json' in headers['content-type']):

0 commit comments

Comments
 (0)