为什么Python线条图显示:没有帐户?情节 [英] Why Python line plot shows : Don't have an account? plot.ly
问题描述
实际上我是python的新手.
Actually I am new in python.
当我尝试编译以下代码时:
When I am trying to compile the following code:
import matplotlib.pyplot as plt
import plotly.plotly as py
# Learn about API authentication here: https://plot.ly/python/getting-started
# Find your api_key here: https://plot.ly/settings/api
x = [1,2,3,4]
y = [3,4,8,6]
plt.plot(x, 'o')
plt.plot(y)
fig = plt.gcf()
plot_url = py.plot_mpl(fig, filename='mpl-line-scatter')
它显示以下消息,但不提供任何输出. :
It shows the following message and don't give any output. :
mks@mks-H81M-S:~/Desktop/pythonPrograms$ python plot.py
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
xdg-open - opens a file or URL in the user's preferred application
Synopsis
xdg-open { file | URL }
xdg-open { --help | --manual | --version }
Use 'man xdg-open' or 'xdg-open --manual' for additional info.
mks@mks-H81M-S:~/Desktop/pythonPrograms$
我不知道这是什么以及如何解决它.帮助.
I don't know what is this and how to fix it. Help.
推荐答案
就python方面而言,我还是很新的.但是,在我看来,问题在于您正在导入plotly.plotly.
I'm also pretty new as far as plotly on python is concerned. However, it seems to me that the problem is the fact that you are importing plotly.plotly.
引用文档
plotly.plotly中的所有方法都将与Plotly Cloud或 阴谋的企业. get_figure从plot.ly下载图形或 阴谋的企业.您需要提供凭据才能下载 数字: https://plot.ly/python/getting-started/
All methods in plotly.plotly will communicate with a Plotly Cloud or Plotly Enterprise. get_figure downloads a figure from plot.ly or Plotly Enterprise. You need to provide credentials to download figures: https://plot.ly/python/getting-started/
据我所知,您需要先导入图,然后使用此链接 希望这会有所帮助
To the best of my understanding, you need to import plotly and then use functions as explained in the latter half of the introduction on this link Hope this helps
这篇关于为什么Python线条图显示:没有帐户?情节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!