In [3]:
import plotly.plotly as py
import plotly.graph_objs as go

trace1 = go.Scatter(x=[1,2,3], y=[4,5,6], marker={'color': 'red', 'symbol': 104, 'size': "10"}, 
                    mode="markers+lines",  text=["one","two","three"], name='1st Trace')
                                               
data=go.Data([trace1])
layout=go.Layout(title="First Plot", xaxis={'title':'x1'}, yaxis={'title':'x2'})
figure=go.Figure(data=data,layout=layout)
py.iplot(figure, filename='pyguide_1')


---------------------------------------------------------------------------
PlotlyLocalCredentialsError               Traceback (most recent call last)
<ipython-input-3-0392cb682435> in <module>()
      8 layout=go.Layout(title="First Plot", xaxis={'title':'x1'}, yaxis={'title':'x2'})
      9 figure=go.Figure(data=data,layout=layout)
---> 10 py.iplot(figure, filename='pyguide_1')

C:\Users\jag\Anaconda3\lib\site-packages\plotly\plotly\plotly.py in iplot(figure_or_data, **plot_options)
    149     if 'auto_open' not in plot_options:
    150         plot_options['auto_open'] = False
--> 151     url = plot(figure_or_data, **plot_options)
    152 
    153     if isinstance(figure_or_data, dict):

C:\Users\jag\Anaconda3\lib\site-packages\plotly\plotly\plotly.py in plot(figure_or_data, validate, **plot_options)
    239 
    240     plot_options = _plot_option_logic(plot_options)
--> 241     res = _send_to_plotly(figure, **plot_options)
    242     if res['error'] == '':
    243         if plot_options['auto_open']:

C:\Users\jag\Anaconda3\lib\site-packages\plotly\plotly\plotly.py in _send_to_plotly(figure, **plot_options)
   1374                       cls=utils.PlotlyJSONEncoder)
   1375     credentials = get_credentials()
-> 1376     validate_credentials(credentials)
   1377     username = credentials['username']
   1378     api_key = credentials['api_key']

C:\Users\jag\Anaconda3\lib\site-packages\plotly\plotly\plotly.py in validate_credentials(credentials)
   1323     api_key = credentials.get('api_key')
   1324     if not username or not api_key:
-> 1325         raise exceptions.PlotlyLocalCredentialsError()
   1326 
   1327 

PlotlyLocalCredentialsError: 
Couldn't find a 'username', 'api-key' pair for you on your local machine. To sign in temporarily (until you stop running Python), run:
>>> import plotly.plotly as py
>>> py.sign_in('username', 'api_key')

Even better, save your credentials permanently using the 'tools' module:
>>> import plotly.tools as tls
>>> tls.set_credentials_file(username='username', api_key='api-key')

For more help, see https://plot.ly/python.

In [ ]: