r - 将情节编织成文字,情节的大小被压扁
问题描述
我正在尝试创建 4 个条形图,这些条形图仅显示按各种人口统计数据划分的响应数量。
因此我有以下代码块
{r, echo = FALSE, fig.height=20, fig.width=40} <-this is has the proper start but stackoverflow wont let me post it
a <- ggplot(data=Data, aes(x=Gender, fill=Gender))+
geom_bar(stat="count")+
scale_x_discrete(labels = wrap_format(10))+
ylab("Number of respondents")
b <- ggplot(data=Data, aes(x=Condition, fill=Condition))+
geom_bar(stat="count")+
scale_x_discrete(labels = wrap_format(10))+
ylab("Number of respondents")+
xlab("Employment type")
c <- ggplot(data=Data, aes(x=Schedule, fill=Schedule))+
geom_bar(stat="count")+
scale_x_discrete(labels = wrap_format(10))+
ylab("Number of respondents")
d <- ggplot(data=Data, aes(x=Region, fill=Region))+
geom_bar(stat="count")+
scale_x_discrete(labels = wrap_format(10))+
ylab("Number of respondents")
plot_grid(a,b,c,d)
这以一个漂亮的网格呈现了这些图。然而,除非放大很多,否则这些图表非常小。
然而,弄乱 fig.height 和 fig.width 要么使图变得非常小或大,但是每个图中的所有数据都被压扁了。
如何在保持可读性的同时简单地调整图形的大小?
解决方案
推荐阅读
- java - RestClientBuilder 给出 IO 异常
- apache-spark - 从执行程序返回结果给驱动程序
- javascript - 在Javascript中检测联合数组的顺序
- python-3.x - 不能替换美元符号
- javascript - 如何让代码执行等到在 Sweetalert 提示符中输入值?
- python - 是否可以在 QLabel 中为其分配键盘快捷键或助记符?
- vb.net - 使用 datagridview 组合框显示数据并从数据库中提供选择
- google-cloud-platform - 如何以编程方式从 Google Cloud Platform 获取帐单信息?那里有任何API吗?
- python - 您如何将文件读入字典,其键为单词长度,值作为具有该长度的单词
- jquery-ui - jquery-ui - 范围滑块 - 输入提交后保存滑块句柄上的值