我在本地工作(在我的电脑上)只是测试和学习 PLOTLY 3.7.5。anaconda env 处于活动状态。代码示例由 plotly 给出
代码:
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')
注意(看):我收到警告错误:
'请安装 chart-studio 包并改用 chart_studio.plotly 模块。'