1

I am kinda confused why this is happening if running a jupyter notebook (using nbconvert --execute) with the following code:

for key in dict:
   data = [go.Bar (x = dict[key].values(),
                   y = dict[key].keys(),
                   orientation = 'h')]

   layout = go.Layout(title = key, showlegend = False)
   fig = go.Figure(data = data, layout = layout)
   plotly.offline.plot(fig, filename= plots_path + key + '_plotly.html')

always leads to starting vs-code. Does anyone experienced that issue before ? How can I suppress it because I do the plotting in a loop and it is quite annoying to close more than 10 vs-code windows after each run.

Apparently it has to do something with the writing to html if I comment the last line out no vs-code windows are popping up.

1 Answer 1

1

Try this: plotly.offline.plot(fig, filename= plots_path + key + '_plotly.html', auto_open=False)

Default behavior is it will try to find a program to immediately open the html file.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot for the fast reply! It worked :) I wonder why my system chose to open the HTML with vs-code and not with chrome...
If you need you can change the default application associated with .html files like this: techforluddites.com/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.