For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
2 2 2 4

iplot doesnt work

Hi,

I am struggling with to run a piece of code of the INTRODUCTION TO EIKON WEB AND SCRIPTING API webinar.

import eikon as ek
ek.set_app_id('xxxxxxxxx')
msft=ek.get_timeseries('MSFT.O',fields='CLOSE',start_date='2015-06-23',end_date='2017-06-23')
import cufflinks
msft.iplot(kind='line',color='blue',bestfit=True)

returns

Aw, snap! We don't have an account for ''. Want to try again? You can authenticate with your email address or username. Sign in is not case sensitive.

Don't have an account? plot.ly

Questions? support@plot.ly
---------------------------------------------------------------------------
PlotlyError                               Traceback (most recent call last)
<ipython-input-12-df8fac0cd8d5> in <module>()
----> 1msft.iplot(kind='line',color='blue',bestfit=True)

C:\Users\koflerma\AppData\Local\Continuum\Anaconda3\lib\site-packages\cufflinks\plotlytools.py in _iplot(self, data, layout, filename, sharing, kind, title, xTitle, yTitle, zTitle, theme, colors, colorscale, fill, width, dash, mode, symbol, size, barmode, sortbars, bargap, bargroupgap, bins, histnorm, histfunc, orientation, boxpoints, annotations, keys, bestfit, bestfit_colors, mean, mean_colors, categories, x, y, z, text, gridcolor, zerolinecolor, margin, labels, values, secondary_y, secondary_y_title, subplots, shape, error_x, error_y, error_type, locations, lon, lat, asFrame, asDates, asFigure, asImage, dimensions, asPlot, asUrl, online, **kwargs)
   1043                 return py.plot(figure,sharing=sharing,filename=filename,validate=validate,auto_open=False)
   1044         else:
-> 1045return iplot(figure,sharing=sharing,filename=filename,validate=validate,online=online)
   1046 
   1047 

C:\Users\koflerma\AppData\Local\Continuum\Anaconda3\lib\site-packages\cufflinks\plotlytools.py in iplot(data_or_figure, validate, sharing, filename, online, **kwargs)
   1187                         filename='Plotly Playground {0}'.format(time.strftime("%Y-%m-%d %H:%M:%S"))
   1188 		return py.iplot(data_or_figure,validate=validate,sharing=sharing,
-> 1189 						filename=filename)
   1190 
   1191 def _ta_figure(self,**kwargs):

C:\Users\koflerma\AppData\Local\Continuum\Anaconda3\lib\site-packages\plotly\plotly\plotly.py in iplot(figure_or_data, **plot_options)
    156         embed_options['height'] = str(embed_options['height']) + 'px'
    157 
--> 158return tools.embed(url, **embed_options)
    159 
    160 

C:\Users\koflerma\AppData\Local\Continuum\Anaconda3\lib\site-packages\plotly\tools.py in embed(file_owner_or_url, file_id, width, height)
    388         else:
    389             url = file_owner_or_url
--> 390return PlotlyDisplay(url, width, height)
    391     else:
    392         if (get_config_defaults()['plotly_domain']

C:\Users\koflerma\AppData\Local\Continuum\Anaconda3\lib\site-packages\plotly\tools.py in __init__(self, url, width, height)
   1363         def __init__(self, url, width, height):
   1364             self.resource = url
-> 1365self.embed_code = get_embed(url, width=width, height=height)
   1366             super(PlotlyDisplay, self).__init__(data=self.embed_code)
   1367 

C:\Users\koflerma\AppData\Local\Continuum\Anaconda3\lib\site-packages\plotly\tools.py in get_embed(file_owner_or_url, file_id, width, height)
    293                 "'{1}'."
    294                 "\nRun help on this function for more information."
--> 295                 "".format(url, plotly_rest_url))
    296         urlsplit = six.moves.urllib.parse.urlparse(url)
    297         file_owner = urlsplit.path.split('/')[1].split('~')[1]

PlotlyError: Because you didn't supply a 'file_id' in the call, we're assuming you're trying to snag a figure from a url. You supplied the url, '', we expected it to start with 'https://plot.ly'.
Run help on this function for more information.

I have to admit that a am not overly familiar with Jupyter.

Thanks in advance!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvote
Accepted
434 1 2 2

Hi @m.kofler

As mentioned on the webinar - I use cufflinks which is a library based on plotly. This is not created/supported by Thomson Reuters. You can see a tutorial of how to setup your plot.ly account here.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Followed the steps and works, cheers Jorge!

Upvotes
166 10 17 21

The 'cufflinks' pacakge makes use of 'plot.ly'. It looks like this has to do with using online vs. off-line methods of plot.ly. Could you restart your kernel and try again?

Could you help @jorge.santos ?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
2 2 2 4

Thanks Joris. Have restarted, but no luck

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvote
9.7k 49 38 60

Hi @m.kofler,

You have to explicitly go offline when using cufflinks if you don't have an account. For example:

import cufflinks as cf
cf.go_offline()
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Worked. Many thanks Nick!

Upvotes
13k 32 12 18

@m.kofler: Please see iPython notebooks at TR samples github site, which have working samples using plotly and cufflinks.

Another sample.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea