Skip to content

Instantly share code, notes, and snippets.

@nandor
Last active November 19, 2015 19:35
Show Gist options
  • Save nandor/02f2b55f5ef9b06b6d3f to your computer and use it in GitHub Desktop.
Save nandor/02f2b55f5ef9b06b6d3f to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
with open('points.csv') as f:
a = np.loadtxt(f)
p3d = a[:,0:3]
p2d = a[:,3:5]
p2d = p2d / np.amax(p2d, 0)
p3c = np.c_[p2d, np.zeros(p2d.shape[0])]
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(p3d[:,0], p3d[:,1], p3d[:,2], color=p3c, s=1, depthshade=False)
plt.show()
plt.plot(p2d[:,1], p2d[:,0], 'ro')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment