0% found this document useful (0 votes)
6 views9 pages

Presentation 2

Uploaded by

m.dnithi1728
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

Presentation 2

Uploaded by

m.dnithi1728
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

BY S A N J AY R

822223104021

THREE
DIMENSIONAL
PLOTTING
I INNTTRROODDUUCCTTI IOONN

• Three-dimensional (3D) plotting is a fundamental


technique in data visualization used to represent data with
three variables. In the foundation of data science, 3D
plotting helps to better understand relationships and
patterns in multivariate data. It's widely used in
exploratory data analysis, machine learning, and other
domains where spatial relationships or complex
interactions between variables are critical.
1 . M AT P LO T L I B F O R 3 D P LO T T I N G

• Matplotlib's mpl_toolkits.mplot3d provides tools for 3D


plotting in Python. Below is an example of how to create
a simple 3D scatter plot using matplotlib.
• Installation

• If matplotlib is not already installed, you can install it


using:

pip install matplotlib


import numpy as np

import matplotlib.pyplot as plt

From mpl_toolkits.mplot3d

import Axes3D

# Create random data

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')

PLOT # Scatter plot

ax.scatter(x, y, z, c='r', marker='o')

# 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

• While matplotlib is widely used, more advanced and


interactive visualizations can be achieved using
libraries like Plotly. Plotly allows for dynamic and
interactive 3D visualizations.
import plotly.graph_objects as go

import numpy as np# Create random data

x = np.random.rand(100)

y = np.random.rand(100)

z = np.random.rand(100)

# Create 3D scatter plot

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',

PLOT zaxis_title='Z AXIS'),

title="3D Scatter Plot")

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.

2. Regression Analysis: You can use 3D surface plots to


visualize regression lines for datasets with three variables.

3. PCA: In dimensionality reduction, 3D plotting is useful


when projecting higher-dimensional data into 3D space
using techniques like PCA.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy