绘制每个轴上有变量的4轴图

发布于 2025-01-25 17:07:32 字数 496 浏览 3 评论 0原文

我希望制作一个看起来像这样的图:

“特定因素模型”

R

。每个轴上的变量并绘制这些变量之间的相互作用,是否有任何方法可以连接不同曲线的轴,或者像这样做单个图表?

如果有任何用途,这些是我要绘制的函数:

fq11 <- function(q21){3.42-0.75*q21}
fq21 <- function(q11){3.33-0.67*q11}

gq12 <- function(q22){2.08-1.75*q22}
gq22 <- function(q12){1.67-1.33*q12}

hq11 <- function(q12){4-q12}

jq21 <- function(q22){3-q22}

对于上下文,每个字母代表函数相互作用的象限,仅在F和G 2函数中相互作用。

I´m looking to make a graph that looks like this:

specific factors model

in R.

The basic idea is to have a variable on each axis and graph the interactions between those variables, is there any way to connect the axis of different plots, or to do a single graph like this?

If there is of any use, these are the functions I want to plot:

fq11 <- function(q21){3.42-0.75*q21}
fq21 <- function(q11){3.33-0.67*q11}

gq12 <- function(q22){2.08-1.75*q22}
gq22 <- function(q12){1.67-1.33*q12}

hq11 <- function(q12){4-q12}

jq21 <- function(q22){3-q22}

For context, each letter represents the quadrant where the functions interact, only in f and g 2 functions interact.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海拔太高太耀眼 2025-02-01 17:07:32

您可以将它们全部放在一个图上,但是我不知道您要使用提供的功能要做什么。您想要什么限制在轴上?您想要四个象限中的哪个功能中的四个?

我绘制了所有这些,看看您是否可能想制作某种模式,但对我来说并没有震惊。它们都是直线...

代替未知数,我提供了一个可以做到这一点的示例知道进一步帮助。

在此示例中,我已经遮蔽了II和III。我绘制了四个功能,四个象限中的每一个。我在这里使用了基本图,但这也可以使用ggplot来完成。

circ1 = function(x){
  sqrt(10^2 - x^2)
}
circ2 = function(x){
  -sqrt(10^2 - x^2)
}
circ3 = function(x){
  sqrt(9^2 - x^2)
}
circ4 = function(x){
  -sqrt(9^2 - x^2)
}

plot(x = NULL, y = NULL, xlim = c(-10, 10), ylim = c(-10, 10))
curve(circ1, from = 0, to = 10, add = TRUE)
curve(circ2, from = -10, to = 0, add = TRUE)
curve(circ3, from = -10, to = 0, add = TRUE)
curve(circ4, from = 0, to = 10, add = TRUE)
polygon(c(0, -10, -10, 0), c(0, 0, -10, -10), 
        col = scales::alpha('darkgreen', 0.2))
polygon(c(0, 10, 10, 0), c(0, 0, 10, 10), col = scales::alpha('darkgreen', 0.2))

You can put them all on one graph, but I don't know what you want to do with the functions you've provided. What limits do you want on the axes? Which four of the 6 functions do you want in which of the four quadrants?

I plotted them all to see if there might be some pattern you were trying to make, but nothing stuck out to me. They're all straight lines...

In lieu of the unknowns, I've provided an example of how you could do this so that perhaps you'll either be able to run with this or you'll understand what else I might need to know to help further.

In this example, I've shaded II and III. I've plotted four functions, one in each of the four quadrants. I used base R plots here, but this can be done with ggplot, as well.

circ1 = function(x){
  sqrt(10^2 - x^2)
}
circ2 = function(x){
  -sqrt(10^2 - x^2)
}
circ3 = function(x){
  sqrt(9^2 - x^2)
}
circ4 = function(x){
  -sqrt(9^2 - x^2)
}

plot(x = NULL, y = NULL, xlim = c(-10, 10), ylim = c(-10, 10))
curve(circ1, from = 0, to = 10, add = TRUE)
curve(circ2, from = -10, to = 0, add = TRUE)
curve(circ3, from = -10, to = 0, add = TRUE)
curve(circ4, from = 0, to = 10, add = TRUE)
polygon(c(0, -10, -10, 0), c(0, 0, -10, -10), 
        col = scales::alpha('darkgreen', 0.2))
polygon(c(0, 10, 10, 0), c(0, 0, 10, 10), col = scales::alpha('darkgreen', 0.2))

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文