does anyone knows why this happens? Seens that my frist and my last point are connected …
Plot img
the code:
df = pd.read_csv(‘data.csv’, index_col=0, parse_dates=True)
def plot_var_prev(dff):
fig = make_subplots(specs=[[{"secondary_y": True}]])
fig.add_trace(
go.Scatter(x=dff.index,
y=dff['mag_vento'].values,
name="Magnitude"),
secondary_y=False,
)
fig.add_trace(
go.Scatter(x=dff.index,
y=dff['direcao_vento'].values,
name="Direção"),
secondary_y=True,
)
fig.update_xaxes(title_text="<b>Data</b>")
fig.update_layout(hovermode="x", hoverlabel=dict(font_size=16, font_family="Poppins"))
fig.update_layout(plot_bgcolor='rgba(0, 0, 0, 0)', paper_bgcolor='rgba(0, 0, 0, 0)',)
fig.update_layout(
legend=dict(orientation="v"),
yaxis=dict(
title=dict(text='<b>Magnitude do vento [m/s]</b>'),
side="left",
type='linear'
),
yaxis2=dict(
title=dict(text="<b>Direção do vento [°]</b>"),
side="right",
type='linear',
overlaying="y",
tickmode="sync",
rangemode='tozero'
),
)
return fig
the data:
https://raw.githubusercontent.com/josepaulo1233/plotly-wind-graphs/main/data.csv
I trying not use some parameters but nothing is happen