简体   繁体   English

更改马赛克 function、R 中标签的大小

[英]Change the size of labels in mosaic function, R

I have a mosaic, and I want to change the size of the character of the labels.我有一个马赛克,我想改变标签字符的大小。 What can I do?我能做些什么?

library(vcd)
tbl<-structable(GWage~Gender,data=dat)

mosaic(tbl,shade=TRUE, legend=TRUE)

Updated for Mosaic()更新了马赛克()

mosaic(UCBAdmissions, sort = 3:1, 
       gp_varnames = gpar(fontsize = 14, fontface = 1),
       gp_labels = gpar(fontsize = 10),
       main = "Student admissions at UC Berkeley")
?labelings

See?labelings & play around with the font sizes till you get what you want.看?标签和玩弄字体大小,直到你得到你想要的。 You should probably post a tibble /mini-extract of your data to make it easily reproducible.您可能应该发布数据的 tibble /mini-extract 以使其易于重现。

you may be able to do more with mosaicplot()?你也许可以用马赛克图()做更多的事情? Did you try你试过了吗

cex.axis = 0.7   # or whatever size works for your plot?
#Example:
table1 <- table(airquality$Temp[1:7], airquality$Month[1:7])
mosaicplot(table1,
           main = "Example",
           xlab = "Y",
           ylab = "X",
           las = 2,
           border = "chocolate",
           cex.axis = 0.7,
           shade = TRUE)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM