In this Plotly tutorial, you will learn how to plot 3D scatter plot with color scaling in Python. You can use the following code for this task.
# Import Plotly Module import plotly.express as px # Import Dataset dataset = px.data.gapminder().query("continent=='Oceania'") # 3D Scatter Plot with Color Scaling plot = px.scatter_3d(dataset, x="gdpPercap", y="lifeExp", z="pop", color="pop") # Show the Plot plot.show()
Output:
![Plotly 3D scatter plot with color scaling](https://aihints.com/wp-content/uploads/2022/10/Plotly-3D-scatter-plot-with-color-scaling.png)