2016-06-10 4 views
9

Ist es möglich, die Plotly-Bibliothek zu verwenden, um Diagramme in Python zu erstellen, ohne ein Online-Ploty-Konto zu haben? Ich denke, der Code ist Opensource https://github.com/plotly/plotly.py. Ich würde gerne wissen, ob wir das ohne ein Online-Konto nutzen können.Verwendung von Plotly ohne Online Plotly Konto

+0

Ja, es ist möglich, offline plotly Bibliothek. Sie können auch dieses Tutorial verweisen: https://github.com/SayaliSonawane/Plotly_Offline_Python –

Antwort

11

Ja, es kann getan werden. Der einzige Zweck eines plotly-Kontos besteht darin, die Grafiken in Ihrem Konto unter plotly zu hosten.

Plotly Offline können Sie Grafiken offline erstellen und lokal speichern. Anstatt die Grafiken auf einem Server zu speichern, bleiben Ihre Daten und Grafiken in Ihrem lokalen System erhalten.

+1

Alles in Ordnung. Vielen Dank. – Harnish

+0

Wie erstellt man 3D-Plots? Nicht erklärt ... – Alex

0

Sie können offline arbeiten, ohne ein plotly-Konto zu haben. Die plotly-Version sollte 1.9.x-Serie oder höher sein.

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) 

Ihre offline plotly Bibliothek ist Setup. Referenz: Plotly Offline Tutorial

This the offline graph that is created and you check the there is no online url because the graph is stored in local directory

+0

Scheint überhaupt nicht zu funktionieren! Derselbe Fehler erscheint erneut ... – Alex

+0

@Alex Überprüfen Sie die Aktualisierung der Antwort und es wird ein lokales Diagramm in der HTML-Datei erstellt, wie im Bild gezeigt –