R 编织图到字,图的大小被压扁

R 编织图到字,图的大小被压扁,r,r-markdown,R,R Markdown,我试着创建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"

我试着创建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)

{r,echo=FALSE,fig.height=20,fig.width=40}您必须使用20/40(高度/宽度)吗?你能用5/7还是5/10?在我看来,这两个图都很好,并且保持了可读性。不幸的是,这使得这些图无法阅读。我无法复制你的结果。您在
knitr::opts\u chunk$set()
中是否有一些可能会影响它的设置?像
fig.asp
out.width
out.heigh