How to create an area plot in plotly python

Can somebody tell me how can we create area charts with smooth lines (I am sorry I dont know what these are called) like this:

He @ghulam_shabbir_khan welcome to the forums.

This should get you started:

I think you can use line_shape = 'spline' to make it look smoother. Something as below:

import pandas as pd
import as px

df =
df = df.drop('AMZN', axis = 1)
colors = px.colors.qualitative.T10

fig = px.area(df, 
                 x = 'date',
                 y = [c for c in df.columns if c != 'date'],
                 template = 'plotly_dark',
                 color_discrete_sequence = colors,
                 title = 'Stocks', line_shape='spline'


Thank you @hoatran and @AIMPED for your answers. I have tried your suggestions and have achieved the desired functionality.

1 Like