I have an R code in the following:
x = c("一名","網民","議員")
y = c(506,526,527)
df <- data.frame(x = x , y = y)
library("ggplot2")
#ggplot(data=df,aes(x=x,y=y)) + geom_bar(stat="identity")
df$x <- factor(df$x,levels=c("一名","網民","議員"))
#p <- ggplot(data=df,aes(x=x,y=y)) + geom_bar(stat="identity",fill='#79FF79', alpha=.6, width =.7) + scale_y_continuous("Count")+scale_x_discrete('Channel') + theme(text = element_text(size=25))
p <- ggplot(data=df,aes(x=x,y=y)) + geom_bar(stat="identity",fill='#79FF79', alpha=.6, width =.7) + scale_y_continuous("Amount")+scale_x_discrete('Words') + theme(text = element_text(size=25))
p <- p + coord_flip()
p <- p+ggtitle("Topics per each channel")
p <- p + labs(title="Top3", x="Amount", y="Words")+ theme(plot.title = element_text(hjust = 0.5),title=element_text(family="myFont",size=35,color="black"))
#theme(plot.title = element_text(hjust=0.5),title=element_text(family="myFont",size=20,color="black"))
ggsave('test.png', plot = p, width = 18, height=13,dpi=300,limitsize = FALSE)
When I need to output the graph, I got the following result.
Then, I hope to adjust the font size of "一名", "網民", and "議員". I got some problems. I don't what to make the font size of "一名", "網民", and "議員" larger in the graph. Can anyone help me? Thanks.