如何更改图例文本颜色单张的R?

问题描述 投票:1回答:1

我创建R中闪亮的单张地图。问题是,传说中的文字颜色很鲜艳。我需要改变文字颜色,但没有找到在单张传奇任何选项更改图例文本color.enter image description here

r shiny leaflet legend
1个回答
0
投票

龚如心!

你可以从?addLegend()看到,有可能会适合你的几个参数:

PAL:调色板功能,从colorNumeric(),colorBin(),colorQuantile(),或colorFactor()生成

颜色:在图例中使用的(HTML)的色彩向量,如果不设置PAL

不透明度:颜色的不透明

例如(从这里开始:https://rstudio.github.io/leaflet/legends.html):

qpal <- colorQuantile("RdYlBu", your_dataset$your_variable, n = 5)

addLegend(pal = qpal, values = ~your_variable, opacity = 1)

最好!

© www.soinside.com 2019 - 2024. All rights reserved.