I am using the Choroplethr package to generate some maps for a forthcoming publication. Does anyone know how to adjust the graphical parameters of the outputted graphics? (Specifically, I am hoping to change the font to the journal-required font.)
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")
So in this particular example, I'm hoping to change the font displayed in the legend ("test", "0.25," "0.50," "0.75").
Many thanks!
Adding and editing the theme() argument from ggplot2 worked. Although I imagine there are alternative ways to set the font, I am pasting the code I used and corresponding output below in case helpful to others.
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"))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.