我在matplotlib的sentdex教程中看到了fill\u between的用法。 密码就像
import matplotlib.pyplot as plt
axis=plt.subplot2grid((1,1),(0,0)) #a and b are lists of equal sizes
axis.plot(a,b)
axis.fill_between(a,b,34,where=(b>34),facecolor='r',alpha=.5)
现在他的代码运行良好,他在输出中得到的是b中的值大于34的部分的彩色面。 但我也有同样的错误:
TypeError: '>' not supported between instances of 'list' and 'int'
我找不到如何使用where功能
目前没有回答
相关问题 更多 >
编程相关推荐