How to get URL of new graph when it's generated?

Greetings,

I am generating the data for a graph within a python program, and ultimately creating a graph by calling the “.plot” method of the plotly class.

After the call, the newly generated graph is displayed in a browser window.

I am wondering if there’s any way within the python program to get the exact URL of the newly created graph so that I could save it automatically?

Best Regards,

Adam

@ajf6347 Extract the URL assigned to you plot as follows:

url=py.iplot(fig, filename='your_filename')

Then you can print or save the string url.resource, i.e. a string that gives the URL of your plot:
'https://plot.ly/~your_username/14797'.

Works perfectly. Thank you.

  • Adam