我觉得我在这里遗漏了一些非常明显的东西,但是我无法在 pylab 中获得散点图以黑白打印。任何和所有的帮助将不胜感激。这是我的代码:
from pylab import *
from random import random
ioff()
r = range(10)
x = [3 + i + random() for i in r]
y = [50*i + random() for i in r]
x2 = [5 + i + random() for i in r]
y2 = [5*i + random() for i in r]
scatter(x,y, marker = 'o', hold = True, label = 'collected underwear',cmap=cm.Greys)
scatter(x2,y2, marker = 's', hold = True, label = 'Profit!',cmap=cm.Greys)
legend(loc='upper left')
show()
谢谢,
亚当