Created
October 22, 2010 18:09
-
-
Save pearcemc/641067 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def vis3d(ds): | |
"""Visualise a 3d MultiClassDS""" | |
fig = plt.figure() #start pyplot | |
fig.suptitle('3d vis') #add a title | |
cols = ['g', 'b', 'r', 'y'] #colour options | |
ax = fig.add_subplot(111, projection="3d") #initialise 3d | |
ax.set_xlabel('X') #set axis labels | |
ax.set_ylabel('Y') | |
ax.set_zlabel('Z') | |
for i, clas in enumerate(ds.get_vectors()): #loop through the vectorised classes | |
x, y, z = clas | |
ax.scatter(x,y,z, c=cols[i]) #scatter plot 3d each | |
plt.show() #show us the money |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment