这是我的GitHub 存储库
我使用带有 GRASS 7.0.3 的 QGIS Desktop 2.14.0 将数据添加到 USA shapefile 以创建它,但是当我运行以下代码时
setwd("C:/GIS/US_Governor")
library(ggmap)
library(rgdal)
library(rgeos)
library(maptools)
library(dplyr)
library(tidyr)
library(tmap)
gov <- readOGR(dsn = ".", layer = "Age_of_US_Governor_Mar_2016")
qtm(gov, fill = "Age_of_G_1", fill.title = "Age of US Governor", fill.style="fixed",
fill.palette = "Blues",
fill.breaks=c(40,50,60,70)) +
tm_layout(legend.position = c("right", "bottom"), bg.color="lightgreen")
我得到一张带有大图例的小美国地图....如何增加地图的大小?谢谢!
更新
我添加了+ bb(xlim=150)
,我得到了错误,Error: could not find function "bb"
我包括 library tmap
,因此排除故障....
setwd("C:/GIS/US_Governor")
library(ggmap)
library(rgdal)
library(rgeos)
library(maptools)
library(dplyr)
library(tidyr)
library(tmap)
gov <- readOGR(dsn = ".", layer = "Age_of_US_Governor_Mar_2016")
qtm(gov, fill = "Age_of_G_1", fill.title = "Age of US Governor", fill.style="fixed",
fill.palette = "Blues",
fill.breaks=c(40,50,60,70)) +
tm_layout(legend.position = c("right", "bottom"), bg.color="lightgreen") +
bb(xlim=150)