在R中创建地图时,如何避免图例断裂重叠?

时间:2019-07-01 23:36:57

标签: r maps legend

我是R语言中的映射新手,我无法使图例中的中断与重叠类别保持一致。例如:我想创建一个带有这样的休息时间的图例:     (0)     (1.0-4.5)     (4.6-9.0)     (9.1-14.6)     (14.7-20.3)

However, this is what I keep getting in R:
(0-1.0)
(1.0-4.5)
(4.5-9.0)
(9.0-14.6)
(14.6-20.3)


I've tried playing with the different styles of classIntervals and I feel like "fixed" with the fixedBreaks is getting me closer to what I want but I'm still having the same problem.

## Link colors to variable ranges
    class <- classIntervals(plotvar1, nclr, style="fixed", 
    fixedBreaks=c(0, 1.0, 4.5, 9.0, 14.6, 20.3))
    colcode <- findColours(class, plotclr)

## Plotting Filled Colors
    plot(GeorgiaMap,col=colcode)
    title(main = "Rates")
    legend("bottomleft", legend=names(attr(colcode,"table")),
       fill=attr(colcode,"palette"))

## Add Scale Bar
    map.scale(x=c(-81.5),y=c(30.6),relwidth=0.2,
    ratio=FALSE,metric=TRUE,cex=1)  

0 个答案:

没有答案