15

I just discovered plotly and like it so far. I have this code provided by the main website

import plotly.plotly as py
from plotly.graph_objs import *

trace0 = Scatter(
    x=[1,2,3,4],
    y=[10,15,13,17]
)
trace1 = Scatter(
    x=[1,2,3,4],
    y=[16,5,11,9]
)
data = Data([trace0, trace1])

unique_url = py.plot(data, filename='basic-line')

I am curious about two things:

1) When I run this code, my browser automatically pops up and shows me the graph. All I want is the url so that I can later embed it in an html file. Is there a way to turn off the feature that opens my browser and shows me the graph?

2) Is there a way to get rid of the 'Play with this data' link?

I have combed through the documentation provided, but have come up empty-handed on these two issues.

4

3 に答える 3

23

ポップアップを無効にするにauto_open=FALSEは、次を使用して試してください

py.plot(data, filename='basic_line', auto_open=False)
于 2015-04-08T19:22:02.623 に答える
0

py.plot(data, show_link=False)そのリンクを外します ( というリンクを参照している場合Export to plot.ly)。少なくともそれは使用します: import plotly.offline as py. 上部のリンク (グラフの上にマウスを置いたとき) については、削除しようとしてSave and edit plot in cloudいますが、java スクリプト バージョンの下にあるオプションしか見つけられません...その上の便利なアイテム (javascript オプションは: {displayModeBar: false})。明らかに、「このデータで遊ぶ」という言及があいまいです。私がここに書いた回避策を見ることができます: Plotly.Py オフラインへの構成モードの追加 - モードバー

于 2016-04-08T15:22:25.750 に答える