Search code examples
pythonplotlydata-analysis

plotly.graph_objs.Line deprecated


I'm getting this message:

plotly.graph_objs.Line is deprecated. Please replace it with one of the following more specific types

  • plotly.graph_objs.scatter.Line
  • plotly.graph_objs.layout.shape.Line

Any suggestion on how could I fix it? Code:

mortalidade_covid = round((covid_mortes/covid_casos)*100,2)

datas = mortalidade_covid.index

fig = go.Figure(data=[
    go.Line(name='Mortalidade em %', x=datas, y=mortalidade_covid, mode="lines+markers")    
])

fig['layout'].update(title="Taxa de Mortalidade", title_x=0.5, xaxis_title='Meses', yaxis_title='Taxa de Mortalidade')

fig.show()

Solution

  • Simply replace go.Line with go.Scatter.