In this Plotly tutorial, you will learn how to plot a treemap chart in Python. You can use px.treemap()
function to plot a treemap chart.
# Import Plotly Module import plotly.express as px # Import Dataset dataset = px.data.gapminder().query("continent=='Oceania'") # Treemap Chart plot = px.treemap(dataset, path=['country', 'year'], values='pop') # Show the Plot plot.show()
Output:
![Plotly Treemap Chart](https://aihints.com/wp-content/uploads/2022/10/Plotly-Treemap-Chart.png)