r 情节拉伸传奇
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了r 情节拉伸传奇相关的知识,希望对你有一定的参考价值。
PlotStretchLegend <- function(r, breaks, pal, ...){
plot(r, col=pal(length(breaks) - 1), breaks=breaks, xaxt="n", yaxt="n", legend=F, ...)
# add a reasonable legend
legend_at <- round(seq(breaks[2], breaks[length(breaks) - 1], len=7))
# legend_at_date <- as.Date(legend_at, origin="1970-1-1")
# legend_labels <- c(paste("<", legend_at_date[1]), as.character(legend_at_date[2:(length(legend_at_date) - 1)]), paste(">", legend_at_date[length(legend_at_date)]))
legend_labels <- c(paste("<", legend_at[1]), as.character(legend_at[2:(length(legend_at) - 1)]), paste(">", legend_at[length(legend_at)]))
plot(raster(matrix(legend_at[1]:legend_at[length(legend_at)])), legend.only=T, col=pal(length(breaks)-1), axis.args=list(at=legend_at, labels=legend_labels))
}
以上是关于r 情节拉伸传奇的主要内容,如果未能解决你的问题,请参考以下文章
当我将传奇移出情节时,传奇失去了第二位艺术家
你如何在 Seaborn 中为 kde 情节创造传奇?
Plotly (R) Legend 不会出现?
Matplotlib 传奇不会出现
传奇熊猫python中的“无”
Matplotlib 扩大情节