颜色的三种模式

连续型 sequential, 颜色渐变,可以用于定量数据从低到高的变化
在这里插入图片描述

极端型Diverging,生成深色强调两端、浅色表示中部的颜色,可用来标注数据中的离群点。
在这里插入图片描述

离散型Qualitative,生成彼此差异明显的颜色,通常用来标记分类数据和离散数据。
在这里插入图片描述

matplotlib中camp参数的设置

对于颜色的三种模式,我们在使用colormap时,可以使用camp参数设置相应颜色的图,关于camp参数的的设置如下:
视觉上均匀的连续型:
在这里插入图片描述

连续型的:
在这里插入图片描述
在这里插入图片描述

极端型的:
在这里插入图片描述
离散型的:
在这里插入图片描述
混合型的:
在这里插入图片描述

另外对于camp参数,也可以自定义,关于这部分可参考:https://www.jianshu.com/p/2961bc740614

参考:
https://blog.csdn.net/qq_30934313/article/details/85249831
https://matplotlib.org/2.0.2/examples/color/colormaps_reference.html

关于该部分内容的其他相关博文:
https://matplotlib.org/2.0.2/users/colormaps.html
https://blog.csdn.net/weixin_39580795/article/details/102622004
https://bluebird.blog.csdn.net/article/details/102474190
https://www.jianshu.com/p/2961bc740614
https://blog.csdn.net/lishangyin88/article/details/60476527

关于camp参数设置的,官方给的一些示例:
https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html#matplotlib.pyplot.imshow

https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.Colormap.html#matplotlib.colors.Colormap

matplotlib中的color参数

我们经常在画图时会用到color参数,关于颜色的可选项如下:
在这里插入图片描述
参考:
https://matplotlib.org/2.0.2/examples/color/named_colors.html

附:
matplotlib的官方用户手册网址:https://matplotlib.org/2.0.2/users/index.html

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐