Figure Friday 2025 - week 21

join the Figure Friday session on May 30, at noon Eastern Time, to showcase your creation and receive feedback from the community.

Gas, liquid, solid… Where do carbon emissions come from?

Answer this question and many others by using Plotly and Dash on the Global CO2 emissions dataset. If you prefer to analyze emissions per country, see the nation.1751_2021.xlsx file on the second row of the table.

Things to consider:

  • what can you improve in the app or sample figure below (area plot)?
  • would you like to tell a different data story using a different graph?
  • can you create a different Dash app?

Sample figure:

Code for sample figure:
from dash import Dash, dcc
import dash_ag_grid as dag
import plotly.express as px
import pandas as pd


df = pd.read_csv("https://raw.githubusercontent.com/plotly/Figure-Friday/refs/heads/main/2025/week-21/global.1751_2021.csv")
# rename the columns to 'Gas', 'Liquid', 'Solid'
df.rename(columns={'Carbon emissions from solid fuel consumption': 'Solid', 'Carbon emissions from liquid fuel consumption': 'Liquid', 'Carbon emissions from gas fuel consumption': 'Gas'}, inplace=True)

fig = px.area(df, x='Year', y=['Solid', 'Liquid', 'Gas'], title='Global CO2 Emissions')

grid = dag.AgGrid(
    rowData=df.to_dict("records"),
    columnDefs=[{"field": i, 'filter': True, 'sortable': True} for i in df.columns],
    dashGridOptions={"pagination": True},
    columnSize="sizeToFit"
)

app = Dash()
app.layout = [
    grid,
    dcc.Graph(figure=fig)
]


if __name__ == "__main__":
    app.run(debug=False)

Participation Instructions:

  • Create - use the weekly data set to build your own Plotly visualization or Dash app. Or, enhance the sample figure provided in this post, using Plotly or Dash.
  • Submit - post your creation to LinkedIn or Twitter with the hashtags #FigureFriday and #plotly by midnight Thursday, your time zone. Please also submit your visualization as a new post in this thread.
  • Celebrate - join the Figure Friday sessions to showcase your creation and receive feedback from the community.

:point_right: If you prefer to collaborate with others on Discord, join the Plotly Discord channel.

Data Source:

Thank you to the IREEE and to community member, Matt H, for the data.

3 Likes