advacned go scatter plot code example
Example: advacned go scatter plot
import plotly.graph_objs as go
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/wind_speed_laurel_nebraska.csv')
fig = go.Figure([
go.Scatter(
name='Measurement',
x=df['Time'],
y=df['10 Min Sampled Avg'],
mode='markers',
marker=dict(color='red', size=2),
showlegend=True
),
go.Scatter(
name='Upper Bound',
x=df['Time'],
y=df['10 Min Sampled Avg']+df['10 Min Std Dev'],
mode='lines',
marker=dict(color="#444"),
line=dict(width=1),
showlegend=False
),
go.Scatter(
name='Lower Bound',
x=df['Time'],
y=df['10 Min Sampled Avg']-df['10 Min Std Dev'],
marker=dict(color="#444"),
line=dict(width=1),
mode='lines',
fillcolor='rgba(68, 68, 68, 0.3)',
fill='tonexty',
showlegend=False
)
])
fig.update_layout(
yaxis_title='Wind speed (m/s)',
title='Continuous, variable value error bars',
hovermode="x"
)
fig.show()