How to create an Interactive 3D Graph in Python

Viewed 117

I am trying to create a 3D graph in python where you can freely move the points on the graph in any of the 3 axis. while moving this points on the graph ,the point that were plotted are also updated. I tried using matplot but I couldn't freely move the points on the graph.

2 Answers

Use plotly-express

# Python env: pip install plotly-express
# Anaconda env: conda install -c plotly plotly_express 

import plotly.express as px
df = px.data.iris()
fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',
              color='species')
fig.show()

plotly-express

plotly-express2

I use plotly for creating 3d graphs. They provide an interactive interface to play with chart along with different types of charts.

Related