代码能运行,说明Blues
这个属性肯定是存在的。但是它可以被动态添加(编辑器只能找到静态属性),比如下面的例子:
# 动态添加变量s,相当于 s = 'Hello world'
globals()['s'] = 'Hello world'
# 输出
print(s)
这里的print(s)
,编辑器也会报错说不存在变量,但实际上这段代码是可以运行的。
另外,回到问题,Blues
属性的数据定义在隐藏的依赖_cm.py
:
# 34 colormaps based on color specifications and designs
# developed by Cynthia Brewer (https://colorbrewer2.org/).
# The ColorBrewer palettes have been included under the terms
# of an Apache-stype license (for details, see the file
# LICENSE_COLORBREWER in the license directory of the matplotlib
# source distribution).
# RGB values taken from Brewer's Excel sheet, divided by 255
_Blues_data = (
(0.96862745098039216, 0.98431372549019602, 1.0 ),
(0.87058823529411766, 0.92156862745098034, 0.96862745098039216),
(0.77647058823529413, 0.85882352941176465, 0.93725490196078431),
(0.61960784313725492, 0.792156862745098 , 0.88235294117647056),
(0.41960784313725491, 0.68235294117647061, 0.83921568627450982),
(0.25882352941176473, 0.5725490196078431 , 0.77647058823529413),
(0.12941176470588237, 0.44313725490196076, 0.70980392156862748),
(0.03137254901960784, 0.31764705882352939, 0.61176470588235299),
(0.03137254901960784, 0.18823529411764706, 0.41960784313725491)
)
望采纳,谢谢。