Python Matplotlib 颜色名 与默认color_list获取

绘制图像的时候需要选择美化的曲线,网上的图有很多,但是不少颜色的关键字并不支持。
所以还是多参考官方的颜色名表
在这里插入图片描述
参考
https://matplotlib.org/3.1.0/gallery/color/named_colors.html

matplotlib colormaps

类别颜色获取

color_list = plt.cm.tab10(np.linspace(0, 1, 12))

在这里插入图片描述

https://matplotlib.org/stable/tutorials/colors/colormaps.html?highlight=tab10

seaborn palette

类似seaborn可以通过如下代码获得color_list

color_list = sns.color_palette("hls", 8)

http://seaborn.pydata.org/tutorial/color_palettes.html?highlight=color

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Matplotlib提供了多种色板供用户选择使用。引用中给出了使用Matplotlib绘图所需的常用库和模块。如果想要选择默认的色板,可以使用plt.cm模块,其中包含了很多默认色板。引用展示了一部分默认色板的示例,如Accent、Blues、hot等等。用户可以根据需要选择合适的色板来进行绘图。此外,还可以使用seaborn模块中的色板来进行绘图,如示例中使用的deep、muted、bright、dark色板。绘图时可以通过指定色板参数来改变图表的颜色。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [python可视化(4)色板(mpl.colors, colormap, plt.cm, palette)](https://blog.csdn.net/weixin_43636051/article/details/108604602)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* [matplotlib和seaborn中的颜色图(colormap)和调色板(color palette)](https://blog.csdn.net/qiu_xingye/article/details/121914314)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值