0% found this document useful (0 votes)
42 views2 pages

Case Study Assignment 4

The document contains two Python code snippets using Matplotlib for 3D visualizations. The first snippet creates a 3D scatter plot of height and weight data, while the second snippet generates a 3D line graph of a mathematical function. Both visualizations include labeled axes and display the plots using plt.show().

Uploaded by

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

Case Study Assignment 4

The document contains two Python code snippets using Matplotlib for 3D visualizations. The first snippet creates a 3D scatter plot of height and weight data, while the second snippet generates a 3D line graph of a mathematical function. Both visualizations include labeled axes and display the plots using plt.show().

Uploaded by

Manasa P M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Scatterplot 3D

import numpy as np
import [Link] as plt
height = [Link]([100, 110, 87, 95, 65, 80, 90])
weight = [Link]([106, 123, 84, 85, 75, 88, 92])
fig = [Link]()
ax = fig.add_subplot(111, projection='3d')
[Link](height, weight, np.zeros_like(height))
ax.set_xlabel('Length')
ax.set_ylabel('Width')
ax.set_zlabel('Height')
[Link]()
Line Graph 3D
import numpy as np
import [Link] as plt
fig = [Link]()
ax = fig.add_subplot(111, projection='3d')
x = [Link](-5, 5, 100)
y = [Link](-5, 5, 100)
z = [Link](x) * [Link](y)
[Link](x, y, z, color='red')
ax.set_xlabel('X Axis')
ax.set_ylabel('Y Axis')
ax.set_zlabel('Z Axis')
[Link]()

You might also like