首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调整Choroplethr中的字体和其他图形参数

调整Choroplethr中的字体和其他图形参数
EN

Stack Overflow用户
提问于 2020-08-26 02:09:29
回答 1查看 64关注 0票数 0

我正在使用Choroplethr包为即将发布的出版物生成一些地图。有人知道如何调整输出图形的图形参数吗?(具体地说,我希望将字体更改为journal所需的字体。)

代码语言:javascript
复制
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") 

Example Output

所以在这个特殊的例子中,我希望改变图例中显示的字体("test","0.25“,"0.50”,"0.75")。

非常感谢!

EN

回答 1

Stack Overflow用户

发布于 2020-08-26 02:46:27

在ggplot2中添加和编辑theme()参数起作用。虽然我想象有其他方法来设置字体,但我粘贴了我使用的代码和下面相应的输出,以防对其他人有帮助。

代码语言:javascript
复制
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")) 

Updated Example Output

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63584782

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档