[英]How to change legend text color in leaflet for R?
Nina! 妮娜!
As you can see from ?addLegend()
, there are several parameters that may suit you: 从
?addLegend()
可以看到,有几个参数可能适合您:
pal: the color palette function, generated from colorNumeric(), colorBin(), colorQuantile(), or colorFactor()
pal:调色板函数,由colorNumeric(),colorBin(),colorQuantile()或colorFactor()生成
colors: a vector of (HTML) colors to be used in the legend if pal is not provided
colors:如果未提供pal,则图例中将使用(HTML)颜色的向量
opacity: the opacity of colors
不透明度:颜色的不透明度
For example (from here: https://rstudio.github.io/leaflet/legends.html ): 例如(从此处: https : //rstudio.github.io/leaflet/legends.html ):
qpal <- colorQuantile("RdYlBu", your_dataset$your_variable, n = 5)
addLegend(pal = qpal, values = ~your_variable, opacity = 1)
Best! 最好!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.