1import plotly.graph_objects as go
2import pandas as pd
34# Load and filter Apple stock data for 20165apple_df = pd.read_csv(6"https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv",7 parse_dates=["Date"],8 index_col="Date"9)1011apple_df_2016 = apple_df["2016"]1213# Create figure and add line14fig = go.Figure()15fig.add_trace(go.Scatter(16 x=apple_df_2016.index,17 y=apple_df_2016["AAPL.High"],18 mode="lines"19))2021# Set custom x-axis labels22fig.update_xaxes(23 ticktext=["End of Q1","End of Q2","End of Q3","End of Q4"],24 tickvals=["2016-04-01","2016-07-01","2016-10-01", apple_df_2016.index.max()],25)2627fig.update_xaxes(showgrid=False,showticklabels=False)28fig.update_yaxes(showgrid=False,showticklabels=False)29fig.show()
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/12/29 08:08
2020/12/29 08:13