gpt4 book ai didi

leaflet - 图例中的颜色与 map 中的颜色不匹配

转载 作者:行者123 更新时间:2023-12-05 06:27:07 24 4
gpt4 key购买 nike

基本上,我尝试使用颜色来显示值,但是,当我添加图例时,图例中的颜色与 map 中的颜色不匹配。

enter image description here
output$map <- renderLeaflet({
temp<-data[data$coralType==input$type,]
temp<- aggregate(temp,by=list(temp$location),FUN=mean)
#print(temp)
qpal <- colorQuantile("YlOrRd", temp$value,n=6)
leaflet(temp) %>% addProviderTiles("Esri.WorldImagery") %>%
addCircleMarkers(~longitude,~latitude,radius
=~value*35,color=~qpal(value),
label=paste(paste(temp$Group.1,":"),temp$value),fillOpacity
=0.8) %>%
addLegend("topright", pal = qpal, values = ~value,
title = "Average Rate", opacity = 1)
})

最佳答案

不确定这是否有帮助,但在您发布此问题前不久,git 上出现了一个类似的问题:https://github.com/r-spatial/mapview/issues/219我遇到了类似的问题,但图例使用标称数据(不是斜坡梯度)。

关于leaflet - 图例中的颜色与 map 中的颜色不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55546222/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com