'Trying to bold y axis in ggplot
I am trying to bold my y-axis. The title for the axis is bold, but I can't seem to figure out how to bold the number themselves. Here is my code so far,
combine.df %>% filter(site== "indian_creek") %>%
ggplot(aes(x = percent_corn, y = flow_concentration)) +
geom_smooth(method = "lm", color="black") +
geom_point(color=dark_umber, size=5) +
scale_y_continuous(label=scientific_10, bold) +
scale_x_continuous(breaks = seq(46, 58, by=2)) +
theme(plot.subtitle = element_text(vjust = 1),
plot.caption = element_text(vjust = 1)) +labs(title = "Indian Creek",
face="bold", x = "Cultivated Crop as Corn (%)",
y = expression(bold(Weighted~Flow~NO[3]-N~(kg/m^{3})))) +
theme(
# LABLES APPEARANCE
plot.title = element_text(size=14, face= "bold", colour= "black" ),
axis.title.x = element_text(size=14, face="bold", colour = "black"),
axis.title.y = element_text(size=14, face="bold", colour = "black"),
axis.text.x = element_text(size=12, face="bold", colour = "black"),
axis.text.y = element_text(size=12, face="bold", colour = "black"),
strip.text.x = element_text(size = 10, face="bold", colour = "black" ),
strip.text.y = element_text(size = 10, face="bold", colour = "black"),
axis.line.x = element_line(color="black", size = 0.3),
axis.line.y = element_line(color="black", size = 0.3),
panel.border = element_rect(colour = "black", fill=NA, size=0.3)
)
I have seen similar questions but haven't figured out the right answer for my problem. Thanks
Solution 1:[1]
Looks like they are bold. Maybe hard to see with your font or with everything bolded already?
mtcars %>% # Replaced with reproducible data
ggplot(aes(x = wt, y = mpg)) +
geom_smooth(method = "lm", color="black") +
geom_point(color="brown", size=5) +
scale_y_continuous() +
scale_x_continuous(breaks = seq(0, 58, by=2)) +
theme(plot.subtitle = element_text(vjust = 1),
plot.caption = element_text(vjust = 1)) +
labs(title = "Indian Creek",face="bold", x = "Cultivated Crop as Corn (%)",
y = expression(bold(Weighted~Flow~NO[3]-N~(kg/m^{3})))) +
theme(
# LABELS APPEARANCE
plot.title = element_text(size=14, face= "bold", colour= "black" ),
axis.title.x = element_text(size=14, face="bold", colour = "black"),
axis.title.y = element_text(size=14, face="bold", colour = "black"),
axis.text.x = element_text(size=12, face="bold", colour = "black"),
# axis.text.y = element_text(size=12, colour = "black"), # unbold
axis.text.y = element_text(size=12, face="bold", colour = "black"), # bold
strip.text.x = element_text(size = 10, face="bold", colour = "black" ),
strip.text.y = element_text(size = 10, face="bold", colour = "black"),
axis.line.x = element_line(color="black", size = 0.3),
axis.line.y = element_line(color="black", size = 0.3),
panel.border = element_rect(colour = "black", fill=NA, size=0.3)
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |