import palettable
cmap = palettable.colorbrewer.sequential.PuRd_9.mpl_colormap
cmap(0) = (.5, .5, .5, 1.0) # force the first color entry to be grey
*** SyntaxError: can't assign to function call
我试图将matplotlib colormap的第一种颜色设置为灰色,但是上面有错误。如何修复?在
Tags:
不安装模块选项板, 我认为错误是您用()而不是作为python语法(!)的[]为向量编制索引。 这样python就认为您在给函数调用赋值,这是没有意义的,例如:
相关问题 更多 >
编程相关推荐