Figure Friday 2025 - week 15

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

What car model has the highest electric range? How do they differ over the last 15 years?

Try to answer these and several other questions by using Plotly and Dash to visualize the Washington State Electric Vehicle dataset.

This dataset shows the Battery Electric Vehicles (BEVs) and Plug-in Hybrid Electric Vehicles (PHEVs) that are currently registered through Washington State Department of Licensing (DOL).

Things to consider:

  • what can you improve in the app or sample figure below (sunburst chart)?
  • 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


# Download CSV sheet at: https://drive.google.com/file/d/1lgEHD5n4_xqIhzCCFBq0V72OJV51e8Xz/view?usp=sharing
df = pd.read_csv('Electric_Vehicle_Population_Data.csv')
df_filtered = df[df['Model Year'].isin(range(2019,2022))]

fig = px.sunburst(
    df_filtered,
    path=['Model Year', 'Make', 'Model'],
    values='Electric Range',
    color='Electric Range',
    color_continuous_scale='Greens',
    height=750
)

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=True)

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 Data.gov for the data.

1 Like