gpt4 book ai didi

r - facet_grid 只有一个边距

转载 作者:行者123 更新时间:2023-12-04 11:50:28 26 4
gpt4 key购买 nike

我想使用分面网格只显示右边距而不是底部边距。

示例代码

library(ggplot2)
qplot(mpg, wt, data=mtcars) + facet_grid(cyl ~ vs, margins=TRUE)

当前结果
enter image description here

预期结果
enter image description here

最佳答案

qplot(mpg, wt, data=mtcars) + facet_grid(cyl ~ vs, margins="vs") 

enter image description here

编写此答案时,未记录此行为。现在,它在 facet_grid文件

margins either a logical value or a character vector. Margins are additional facets which contain all the data for each of the possible values of the faceting variables. If FALSE, no additional facets are included (the default). If TRUE, margins are included for all faceting variables. If specified as a character vector, it is the names of variables for which margins are to be created.



(感谢 @Harry 指出这一点。)

关于r - facet_grid 只有一个边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9693193/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com