Presentation 2
Presentation 2
822223104021
THREE
DIMENSIONAL
PLOTTING
I INNTTRROODDUUCCTTI IOONN
From mpl_toolkits.mplot3d
import Axes3D
x = np.random.rand(100)
y = np.random.rand(100)
z = np.random.rand(100)
# Create 3D plot
EXAMPLE:
fig = plt.figure()
3 D S C AT T E R ax = fig.add_subplot(111, projection='3d')
# Labels
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
O U T P U T:
2 . S E A B O R N A N D P L O T LY
x = np.random.rand(100)
y = np.random.rand(100)
z = np.random.rand(100)
fig = go.Figure(data=[go.Scatter3d(x=x,
y=y, z=z, mode='markers')])
EXAMPLE: # Set plot labels
P L O T LY 3 D fig.update_layout(scene = dict(
xaxis_title='X AXIS',
S C AT T E R yaxis_title='Y AXIS',
fig.show()
O U T P U T:
33..AAPPPPLLI ICCAATTI IOONNSS I INN DDAATTAA
SSCCI IEENNCCEE
1. Clustering: 3D scatter plots help in visualizing clusters in
three dimensions.