首页 > 其他分享 >【小睿的ML之路】Seaborn调色板更多颜色设置

【小睿的ML之路】Seaborn调色板更多颜色设置

时间:2023-09-20 23:46:36浏览次数:33  
标签:palette plt Seaborn ML 调色板 sns import palplot xkcd

import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline


使用xkcd颜色来命名颜色

绘制三条线,分别设定颜色
绘制一条从 (0, 0) 到 (1, 1) 的线

plt.plot([0,1],[0,1], sns.xkcd_rgb["pale red"], lw=3)
plt.plot([0,1],[0,2], sns.xkcd_rgb["medium green"], lw=3)
plt.plot([0,1],[0,3], sns.xkcd_rgb["denim blue"], lw=3)

plt.show()

colors = ["windows blue","amber","greyish","faded green","dusty purple"]
sns.palplot(sns.xkcd_palette(colors))

连续色板

色彩随数据变化,比如数据越来越重要则颜色越来越深

sns.palplot(sns.color_palette("Blues"))

如果想要翻转渐变,可以在面板名称中添加一个_r后缀

sns.palplot(sns.color_palette("Blues_r"))

cubehelix_palette()调色板

色调线性变换

sns.palplot(sns.color_palette("cubehelix",8))

sns.palplot(sns.cubehelix_palette(8,start=.5,rot=-.75))

sns.palplot(sns.cubehelix_palette(8,start=.5,rot=-.150))

light_palette() 和 dark_palette()调用定制连续调色板

sns.palplot(sns.light_palette('green'))

sns.palplot(sns.dark_palette('green'))

sns.palplot(sns.light_palette((210,90,60),input="husl"))

标签:palette,plt,Seaborn,ML,调色板,sns,import,palplot,xkcd
From: https://www.cnblogs.com/guowenrui/p/17718838.html

相关文章

  • 关于Dubbo使用XML配置方式启动时卡住的问题
    最近参照Dubbo官网“快速开始”的案例写一个Demo,没想到差点被劝退。主程序如下:packagecom.example.dubbo.main;importorg.springframework.context.support.ClassPathXmlApplicationContext;publicclassProvider{publicstaticvoidmain(String[]args)throwsExce......
  • HTML
    HTML笔记1、前端:主要职责,负责网页。2、通过网页展示数据。3、网页的组成:(1)网页的结构内容-HTML(2)网页的样式-CSS(3)网页的行为-JavaScript4、HTML(1)简介:超文本标记语言(英语:HyperTextMarkupLanguage,简称:HTML)是一种用于创建网页的标准标记语言。开发工具:VSCode、HBuilderX、HBuilderHTML......
  • XML Schema All In One
    XMLSchemaAllInOneXSDAnXMLSchemadescribesthestructureofanXMLdocument.TheXMLSchemalanguageisalsoreferredtoasXMLSchemaDefinition(XSD).https://en.wikipedia.org/wiki/XML_schemahttps://www.w3.org/XML/Schemahttps://www.w3.org/TR/......
  • 使用dom4j解析xml文件及selectNodes取不到值问题解决
    参考文档:https://blog.csdn.net/PARADDD/article/details/131307189https://blog.csdn.net/weixin_37703598/article/details/81273199......
  • Clone fail unable to access 'httpsgithub.comLovi-githubmyUserCenter.git' OpenSSL
    bug:unabletoaccess'https://github.com/xxx':OpenSSLSSL_read:SSL_ERROR_SYSCALL,errno10054关于git提交github出现errno10054、port443:Timedout等问题解决_git提交10054_husishuai的博客-CSDN博客按照上边的解决方法即可......
  • class path resource [.xml] cannot be opened because it does not exist
    classpathresource[bean1.xml]cannotbeopenedbecauseitdoesnotexist错误重现bug:Exceptioninthread"main"org.springframework.beans.factory.BeanDefinitionStoreException:IOExceptionparsingXMLdocumentfromclasspathresource[bean1.xml]......
  • html小结002
    html基本标签brhr文字标签strong/b加粗ins/u下划线del/s删除线em/i斜体img图片标签src=""图片路径相对/绝对a超链接1.跳转2.#回到顶部3.锚点4.下载文件(不用)只能压缩文件格式列表标签......
  • Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: com.fa
    报错:Handlerdispatchfailed;nestedexceptionisjava.lang.NoSuchMethodError:com.fasterxml.jackson.databind.ObjectMapper.canSerialize(Ljava/lang/Class;Ljava/util/concurrent/atomic/AtomicReference;)Zjar包冲突,找到对应的jar包删除......
  • html与css小知识
    html入门学习参考资料:https://www.cnblogs.com/gh110/p/15153664.html参考视频:https://www.bilibili.com/video/BV1x4411V75C扩展:qq邮箱扩展(点击联系我)可以打开qq推广弄iframe可以作为a标签的目标,然后一键点击跳转!点文字就可以锁定文字对应的框表单......
  • java dom4j操作xml
    SAXReaderreader=newSAXReader();Documentdoc=reader.read(...);ListchildNodes=doc.selectNodes("//Config/Child/ChildNode");for(Objectobj:childNodes){NodechildNode=(Node)obj;Stringname=childNode.......