我正在使用Choroplethr包为即将发布的出版物生成一些地图。有人知道如何调整输出图形的图形参数吗?(具体地说,我希望将字体更改为journal所需的字体。)
library(choroplethr)
library(choroplethrMaps)
library(ggplot2)
data(county.regions)
texas.counties<-county.regions[county.regions$state.name=="texas",]
fakedata<-as.data.frame(texas.counties$region)
fakedata$value<-runif(n=254, min=0, max=1)
colnames(fakedata)[1]<-"region"
county_choropleth(fakedata,
state_zoom = c("texas"),
num_colors=1,
legend = "test") 所以在这个特殊的例子中,我希望改变图例中显示的字体("test","0.25“,"0.50”,"0.75")。
非常感谢!
发布于 2020-08-26 02:46:27
在ggplot2中添加和编辑theme()参数起作用。虽然我想象有其他方法来设置字体,但我粘贴了我使用的代码和下面相应的输出,以防对其他人有帮助。
library(choroplethr)
library(choroplethrMaps)
library(ggplot2)
data(county.regions)
texas.counties<-county.regions[county.regions$state.name=="texas",]
fakedata<-as.data.frame(texas.counties$region)
fakedata$value<-runif(n=254, min=0, max=1)
colnames(fakedata)[1]<-"region"
county_choropleth(fakedata,
state_zoom = c("texas"),
num_colors=1,
legend = "test") + theme(text = element_text(family = "Times New Roman")) https://stackoverflow.com/questions/63584782
复制相似问题