I am working locally(in my pc) just testing and learning PLOTLY 3.7.5. with anaconda env active. The code example is given by plotly
Code:
import plotly.plotly as py # Here all begins (Look)
# import chart_studio.plotly as py # inted of the line bellow (optional to try)
import plotly.graph_objs as go
import pandas as pd
from datetime import datetime
if __name__ == '__main__':
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
trace = go.Ohlc(x=df['Date'],
open=df['AAPL.Open'],
high=df['AAPL.High'],
low=df['AAPL.Low'],
close=df['AAPL.Close'])
data = [trace]
py.iplot(data, filename='simple_ohlc')
note (Look): I got the warning error:
'please install the chart-studio package and use the chart_studio.plotly module instead.'
Remember to replace "your-company.com" with the URL of your Chart Studio Enterprise server. If your company has a Chart Studio Enterprise server, change the Python API endpoint so that it points to your company's Plotly server instead of Plotly's cloud.
New to Plotly? To install Chart Studio's python package, use the package manager pip inside your terminal. If you don't have pip installed on your machine, click here for pip's installation instructions. Plotly's Python package is installed alongside the Chart Studio package and it is updated frequently!
To upgrade, run: Chart Studio provides a web-service for hosting graphs! Create a free account to get started. Graphs are saved inside your online Chart Studio account and you control the privacy. Public hosting is free, for private hosting, check out our paid plans .
You can privately share this graph with other Chart Studio users in your online Chart Studio account and they will need to be logged in to view this plot. secret: Anyone with this secret link can view this chart. It will not appear in the Chart Studio feed, your profile, or search engines.
You need plotly's offline mode to obviate authentication - following https://stackoverflow.com/a/44694854/1021819, rather do:
from plotly.offline import iplot
use below line of code before hitting pilot
cf.go_offline() #will make cufflinks offline
cf.set_config_file(offline=False, world_readable=True)
import pandas as pd
import numpy as np
%matplotlib inline
import plotly.graph_objs as go
from plotly.offline import plot
import chart_studio.plotly as py
import cufflinks as cf
cf.go_offline()
from plotly.offline import download_plotlyjs, init_notebook_mode, plot,iplot
init_notebook_mode(connected='true')
df = pd.DataFrame(np.random.randn(100,4),columns='A B C D'.split())
df.head()
df.iplot(kind='box')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With