R color palettes for many data classes

后端 未结 7 1462
广开言路
广开言路 2020-12-02 19:17

Are there any good packages for colour palettes in R that can handle many data classes? I have 16 sequential data classes. I tried RColorBrewer but it has a max of 9 data cl

7条回答
  •  日久生厌
    2020-12-02 19:48

    The Polychrome package allows to create palettes with many distinct colors. Some examples:

    # install.packages("Polychrome")
    library(Polychrome)
    
    # build-in color palette
    Glasbey = glasbey.colors(32)
    swatch(Glasbey)
    

    
    # create your own color palette (36 colors) based on `seedcolors`
    P36 = createPalette(36,  c("#ff0000", "#00ff00", "#0000ff"))
    swatch(P36)
    

    
    # create your own color palette (50 colors) based on `seedcolors`
    P50 = createPalette(50,  c("#ff0000", "#00ff00", "#0000ff"))
    swatch(P50)
    

提交回复
热议问题