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