gpt4 book ai didi

r - 我可以告诉 ggpairs 使用对数刻度吗?

转载 作者:行者123 更新时间:2023-12-04 03:30:27 25 4
gpt4 key购买 nike

我可以给 ggpairs 提供一个参数吗? GGally 包中的函数来对一些变量使用对数刻度,而不是所有变量?

最佳答案

您不能提供这样的参数(一个原因是创建散点图的函数是预定义的,没有比例,请参阅 ggally_points ),但您可以在之后使用 getPlot 更改比例和 putPlot .例如:

custom_scale <- ggpairs(data.frame(x=exp(rnorm(1000)), y=rnorm(1000)),
upper=list(continuous='points'), lower=list(continuous='points'))
subplot <- getPlot(custom_scale, 1, 2) # retrieve the top left chart
subplotNew <- subplot + scale_y_log10() # change the scale to log
subplotNew$type <- 'logcontinuous' # otherwise ggpairs comes back to a fixed scale
subplotNew$subType <- 'logpoints'
custom_scale <- putPlot(custom_fill, subplotNew, 1, 2)

关于r - 我可以告诉 ggpairs 使用对数刻度吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6934698/

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