有没有可能使用plotly库在python中创建图表,而不需要在线的plotly帐户?我认为代码是开源的https://github.com/plotly/plotly.py。我想知道我们是否可以在没有在线帐户的情况下使用它。
发布于 2016-06-10 18:36:13
是的,这是可以做到的。拥有plotly帐户的唯一目的是在您的plotly帐户中托管图形。
Plotly Offline允许您离线创建图形并将其保存在本地。您的数据和图表将保留在本地系统中,而不是将图表保存到服务器。
发布于 2017-10-23 15:07:17
你可以离线工作,而不需要一个plotly帐户。plotly版本应为1.9.x系列或更高版本。
import numpy as np
from plotly import __version__
from plotly.offline import download_plotlyjs, init_notebook_mode, plot,iplot
print (__version__) # requires version >= 1.9.0
#Always run this the command before at the start of notebook
init_notebook_mode(connected=True)
import plotly.graph_objs as go
x=np.array([2,5,8,0,2,-8,4,3,1])
y=np.array([2,5,8,0,2,-8,4,3,1])
data = [go.Scatter(x=x,y=y)]
fig = go.Figure(data = data,layout = go.Layout(title='Offline Plotly Testing',width = 800,height = 500,
xaxis = dict(title = 'X-axis'), yaxis = dict(title = 'Y-axis')))
plot(fig,show_link = False)您的脱机绘图库已设置好。参考:Plotly Offline Tutorial
发布于 2019-05-29 04:07:43
您可以使用:
import plotly
plotly.offline.init_notebook_mode(connected=True)若要脱机使用Plotly,请执行以下操作。
https://stackoverflow.com/questions/37745917
复制相似问题