来自HTML颜色的seaborn分歧cmap调色板

时间:2020-06-04 11:39:42

标签: python seaborn

Seaborn可以选择a pallet from any HTML color,如下所示:

cmap = sns.light_palette("royalblue", as_cmap=True)

是否可以使用HTML颜色选择/创建不同的cmap?像这样:

cmap = sns.diverging_palette("color_a","color_b", as_cmap=True)

2 个答案:

答案 0 :(得分:1)

否,因为diverging_colormap的要点是端点仅在色调上不同,并且具有相同的饱和度和亮度值。这对于两种任意的html颜色都是不正确的。

您可以将端点和中间值传递给blend_palette

sns.palplot(sns.blend_palette(["dodgerblue", ".95", "crimson"], 9))

enter image description here

但是请注意,这种颜色图的感知特性会不太好。

答案 1 :(得分:0)

您可以使用ALTER TRIGGER [dbo].[RM_Est_Email_Trigger] ON [dbo].[K3_BriefHeader] AFTER UPDATE AS BEGIN SET NOCOUNT ON; DECLARE @estimate int, @Email_Date datetime, @status int, @emailstudio bit SET @estimate = (SELECT Estimate from inserted) set @Email_Date = GETDATE() SET @status = (SELECT Status from inserted) SET @emailstudio = (SELECT EmailStudio from inserted) IF UPDATE (EmailStudio) BEGIN INSERT INTO [dbo].[K3_EstimateEmailDate] ([Estimate], [Email_Date],[Status], [EmailStudio]) VALUES (@estimate, @Email_Date, @status, @emailstudio) END END https://seaborn.pydata.org/generated/seaborn.diverging_palette.html),方法是将HSLuv system中的颜色值设置为前两个参数,并设置sns.diverging_palette,例如

hue

enter image description here enter image description here