<jupyter_start><jupyter_text>Simple Candlestick with Pandas<jupyter_code>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']
)

layout = go.Layout(
    title = 'The Great Recession',
    # X轴是否显示Rangeslider，默认为True
    xaxis = dict(rangeslider = dict(visible=False)),
    yaxis = dict(title='AAPL Stock'),
    # 添加一条线
    shapes = [{
        'x0': '2016-12-09', 'x1': '2016-12-09',
        'y0': 0, 'y1': 1, 
        'xref': 'x', 'yref': 'paper',
        'line': {'color': 'rgb(30,30,30)', 'width': 1}
    }],
    annotations = [{
        'x': '2016-12-09', 'y': 0.05, 
        'xref': 'x', 'yref': 'paper',
        'showarrow': False, 
        'xanchor': 'left',
        'text': 'Increase Period Begins'
    }]
)
fig = go.Figure(data=[trace],layout=layout)
plotly.offline.iplot(fig, filename='simple_candlestick')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2063953488372093, 'fraction_numerical': 0.03875968992248062, 'mean_word_length': 3.251028806584362, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '276600', 'license': 'MIT', 'n_tokens_mistral': 448, 'n_tokens_neox': 423, 'n_words': 65, 'path': 'PythonPracticalCases/Plotly/candlestick.ipynb', 'repo_name': 'BigTear/WebRoad', 'size': '1032'}