Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 754a1be

Browse files
committed
return a (local file) url, just like py.plot
1 parent 6e9bdb3 commit 754a1be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plotly/offline/offline.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,11 @@ def plot(figure_or_data,
279279
'</body>',
280280
'</html>']))
281281

282+
url = 'file://' + os.path.abspath(filename)
282283
if auto_open:
283-
webbrowser.open('file://' + os.path.abspath(filename))
284+
webbrowser.open(url)
285+
286+
return url
284287

285288
elif output_type == 'div':
286289
if include_plotlyjs:

0 commit comments

Comments
 (0)