Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarning: Legend does not support <mpl_toolkits.mplot3d.art3d.Patch3DCollection object at 0x3bf46d0>
- Use proxy artist instead."
- import matplotlib.pyplot as plt
- from mpl_toolkits.mplot3d import Axes3D
- import random
- import csv
- from os import listdir
- from os.path import isfile, join
- fig = plt.figure()
- ax = fig.add_subplot(111, projection='3d')
- handles = []
- colors = ['blue', 'red']
- X1 = range(0,10)
- Y1 = range(0,10)
- Z1 = range(0,10)
- random.shuffle(X1)
- random.shuffle(Y1)
- random.shuffle(Z1)
- scatter1 = ax.scatter(X1, Y1, Z1, c = colors[0], marker = 'o')
- random.shuffle(X1)
- random.shuffle(Y1)
- random.shuffle(Z1)
- scatter2 = ax.scatter(X1, Y1, Z1, c = colors[1], marker = 'v')
- ax.set_xlabel('X', fontsize = 10)
- ax.set_ylabel('Y', fontsize = 10)
- ax.set_zlabel('Z', fontsize = 10)
- ax.legend([scatter1, scatter2], ['label1', 'label2'])
- plt.show()
- scatter1_proxy = matplotlib.lines.Line2D([0],[0], linestyle="none", c=colors[0], marker = 'o')
- scatter2_proxy = matplotlib.lines.Line2D([0],[0], linestyle="none", c=colors[1], marker = 'v')
- ax.legend([scatter1_proxy, scatter2_proxy], ['label1', 'label2'], numpoints = 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement