Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用网格包绘制色阶。像 heat.plot (10) 这样的东西。
我正在尝试这样的事情:
require(grid) legendViewport <- viewport(height=0.3, width=0.8) pushViewport(legendViewport) grid.rect(gp = gpar(col = "gray90"))
假设我想将 0 划分为 1,分成 10 并填充 heat.colors (10)。有没有简单的方法来做到这一点。
如果你只想要颜色,
grid.raster(t(heat.colors (10)), width=unit(1,"npc"), height=unit(1,"npc"), int=FALSE)