Commit 5ea59557 authored by Sanchit's avatar Sanchit

uploading solution of q3

parent 247cc558
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
import pandas as pd
from pylab import *
fig=plt.figure(figsize=(12,12))
ax=plt.axes(projection='3d')
x_axis=pd.read_csv("csv_file",names=['x','y','z'],usecols=['x'])
x_points=x_axis.to_numpy()
y_axis=pd.read_csv("csv_file",names=['x','y','z'],usecols=['y'])
y_points=y_axis.to_numpy()
z_axis=pd.read_csv("csv_file",names=['x','y','z'],usecols=['z'])
z_points=z_axis.to_numpy()
graph=ax.scatter3D(x_points, y_points, z_points, c=z_points, cmap='coolwarm')
colorbar(graph,shrink=0.5)
ax.set_xlabel('X axis', fontweight='bold')
ax.set_ylabel('Y axis', fontweight='bold')
ax.set_zlabel('Z axis', fontweight='bold')
ax.grid(False)
ax.w_xaxis.set_pane_color((0.0, 0.0, 0.0, 0.0))
ax.w_yaxis.set_pane_color((0.0, 0.0, 0.0, 0.0))
ax.w_zaxis.set_pane_color((0.0, 0.0, 0.0, 0.0))
fig.savefig('q3plot.jpg',bbox_inches='tight')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment