[R] ggplot2 font size and bold

arun smartpink111 at yahoo.com
Thu Dec 5 00:03:57 CET 2013



Try: theme(axis.title=element_text(face="bold",size="14",color="brown"),axis.text=element_text(size=14,face="bold")) 

A.K.


How can I increase the size and make bold of the items named under 
outcome in the example data set? I can make changes to label outcome, 
but not to individual components(alcohol, coffee etc.. ).  Likewise, I 
 want to make similar changes in the vertical y axis numbers. 

ggplot(df2, aes(x = exp, y = pinc, ymin = lcinc, ymax = ucinc)) + 
  geom_linerange(position=position_dodge(width=0.70)) + geom_point( size = 4.5)  + 
  ylab("Percent Increase in Mortality") +   geom_hline(aes(yintercept = 0)) + xlab("Outcome") + 
  theme(axis.title=element_text(face="bold",size="14", color="brown")) 



structure(list(pinc = c(0.456634704861525, -0.0917186505511203, 
0.0521212509666302, 0.123917574729071, -0.0152774251113263, 0.414372936947638 
), lcinc = c(0.0652757441790275, -0.51362763597802, -0.365701941999952, 
-0.293047384315104, -0.430895718383173, -0.00366607270897434), 
    ucinc = c(0.849524284781999, 0.331979596940069, 0.471696613858441, 
    0.542626241433619, 0.402075729259721, 0.83415957680959), 
    exp = c("smoke", "diabetes", "hyper", "coffee", "alcohol", 
    "stress")), .Names = c("pinc", "lcinc", "ucinc", "exp"), class = "data.frame", row.names = c("1", 
"2", "3", "4", "5", "6"))



More information about the R-help mailing list