【发布时间】:2022-01-02 11:39:37
【问题描述】:
这是我使用rasterImage 创建的渐变色图例:
colfunc <- colorRampPalette(c("red", "blue"))
legend_image <- as.raster(matrix(colfunc(20), ncol=1))
plot.new()
rasterImage(legend_image, 0.9, 0, 1, 1)
lbsq <- seq.int(0, 1, l=5)
axis(4, at=lbsq, pos=1, labels=F, col=0, col.ticks=1, tck=-.05)
mtext(lbsq, 4, -.2, at=lbsq, las=2, cex=.6)
我希望在颜色图例周围添加一个细黑色边框。我尝试在rasterImage 中添加lty = 1,但没有成功。我的问题是如何为生成的图像添加黑色边框并调整其颜色和宽度。
【问题讨论】:
标签: r graphics raster r-raster