0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

RColorBrewer 16進数コードまとめ

Posted at

色の16進数表記をいちいち出すのがめんどうなので、メモ

の前に

RColor Brewerでよく使うコマンド

library(RColorBrewer)

#全てのカラーパレットの表示
display.brewer.all(n = NULL, 
                   type = "all", 
                   select = NULL,
                   colorblindFriendly = FALSE)
##これだけでも良い
display.brewer.all()

#1つのカラーパレットの表示
display.brewer.pal(n = 8, name = 'Dark2')

#色の16進数表記を抽出
##nは3以上でないと(なぜか)エラーが出る
brewer.pal(n = 4, name = "Dark2")

##output
##[1] "#1B9E77" "#D95F02" "#7570B3" "#E7298A"

image.png

16進数表記一覧

色分けでよく使うセットのみとなっています。

Set1

> brewer.pal(n = 8, name = "Set1")
[1] "#E41A1C" "#377EB8" "#4DAF4A" "#984EA3" "#FF7F00" "#FFFF33"
[7] "#A65628" "#F781BF"

image.png

Set2

> brewer.pal(n = 8, name = "Set2")
[1] "#66C2A5" "#FC8D62" "#8DA0CB" "#E78AC3" "#A6D854" "#FFD92F"
[7] "#E5C494" "#B3B3B3"

image.png

Set3

> brewer.pal(n = 12, name = "Set3")
 [1] "#8DD3C7" "#FFFFB3" "#BEBADA" "#FB8072" "#80B1D3" "#FDB462"
 [7] "#B3DE69" "#FCCDE5" "#D9D9D9" "#BC80BD" "#CCEBC5" "#FFED6F"

image.png

Pastel1

> brewer.pal(n = 9, name = "Pastel1")
[1] "#FBB4AE" "#B3CDE3" "#CCEBC5" "#DECBE4" "#FED9A6" "#FFFFCC"
[7] "#E5D8BD" "#FDDAEC" "#F2F2F2"

image.png

Pastel2

> brewer.pal(n = 8, name = "Pastel2")
[1] "#B3E2CD" "#FDCDAC" "#CBD5E8" "#F4CAE4" "#E6F5C9" "#FFF2AE"
[7] "#F1E2CC" "#CCCCCC"

image.png

Paired

> brewer.pal(n = 12, name = "Paired")
 [1] "#A6CEE3" "#1F78B4" "#B2DF8A" "#33A02C" "#FB9A99" "#E31A1C"
 [7] "#FDBF6F" "#FF7F00" "#CAB2D6" "#6A3D9A" "#FFFF99" "#B15928"

image.png

Dark2

> brewer.pal(n = 8, name = "Dark2")
[1] "#1B9E77" "#D95F02" "#7570B3" "#E7298A" "#66A61E" "#E6AB02"
[7] "#A6761D" "#666666"

image.png

Accent

[1] "#7FC97F" "#BEAED4" "#FDC086" "#FFFF99" "#386CB0" "#F0027F"
[7] "#BF5B17" "#666666"

image.png

Spectral

> brewer.pal(n = 11, name = "Spectral")
 [1] "#9E0142" "#D53E4F" "#F46D43" "#FDAE61" "#FEE08B" "#FFFFBF"
 [7] "#E6F598" "#ABDDA4" "#66C2A5" "#3288BD" "#5E4FA2"

image.png

RColorBrewer以外の色が欲しい場合

また、googleでColor code pickerと検索すると選んだ色のコードが取得できるようです!

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?