I am working in a Jupyter Notebook trying to display a line chart being animated. (Seeing it being plotted from left to right.)
However, the chart doesn't show up while the chart container and all controls do show up. It is like the line is invisible.
This is my code:
import pandas as pd
import plotly.express as px
import plotly.io as pio
data = [['Year', 'Country', 'Output', 'Investment', 'Depreciation'], ['2020', 'Netherlands', 1, 2, 1], ['2021', 'Netherlands', 2, 2, 1], ['2022', 'Netherlands', 3, 2, 1], ['2023', 'Netherlands', 4, 2, 1]]
df = pd.DataFrame(data[1:], columns=data[0])
pio.renderers.default = 'notebook'
px.line(df,
x='Year',
y='Output',
color='Country',
title='Macroeconomic variables over time',
range_x=[df['Year'].iloc[0], df['Year'].iloc[-1]],
range_y=[0, max(df['Output']) * 1.25],
animation_frame='Year')
Giving the following chart (in both VSCode and Jupyter Notebooks):

Any ideas on why this happens?
