matplotlib中cmap与color参数的设置

颜色的三种模式

连续型 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

  • 32
    点赞
  • 178
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱学习的贝塔

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值