How do I generate a mapping from numbers to colors in R?

后端 未结 4 692
刺人心
刺人心 2021-02-15 13:45

In R, I can easily generate a color ramp, for example colorRampPalette. The following produces a sequence of five colors, from blue to red:

> mypal <- colo         


        
4条回答
  •  南旧
    南旧 (楼主)
    2021-02-15 14:30

    My colourscheme package on R-Forge does that:

    https://r-forge.r-project.org/projects/colourscheme/

    its primary purpose is to create functions that map numeric values (not just integer colour numbers) to colours. The vignette is the best documentation once you've got it installed.

提交回复
热议问题