Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in calcCurveGrob(x, x$debug) : 端点两头的值是不能相等的 #7

Open
AITCM opened this issue Nov 17, 2022 · 5 comments
Open
Labels
question Further information is requested

Comments

@AITCM
Copy link

AITCM commented Nov 17, 2022

为什么demo的数据可以跑出图,但是用自己的数据会出现这个问题

@Hy4m Hy4m added the question Further information is requested label Nov 20, 2022
@Hy4m
Copy link
Owner

Hy4m commented Nov 20, 2022

这个问题之前有人报告过,但是在我的电脑一直没有重复出来。大概原因是因为标签文本太长了,手动把标签处理的更短一点能解决。

@Cogito7460
Copy link

为什么demo的数据可以跑出图,但是用自己的数据会出现这个问题

把显示plot的那个区域拉大一点就不会报错了

@Hy4m
Copy link
Owner

Hy4m commented Nov 26, 2023

为什么demo的数据可以跑出图,但是用自己的数据会出现这个问题

这个我也没太搞明白,不知道是底层grid的问题,还是linkET内部的代码有问题。直接原因就是标签太长了,手动截短一点应该就正常。

@susheelbhanu
Copy link

susheelbhanu commented Aug 9, 2024

Hi,

I'm running into possibly a similar issue here, see below

> qcorrplot(correlate(amr_class), type = "upper", diag = FALSE) +
+   geom_square() +
+   geom_couple(aes(colour = pd, size = rd), 
+               data = class_mantel, 
+               curvature = nice_curvature()) +
+   scale_fill_gradientn(colours = RColorBrewer::brewer.pal(11, "RdBu")) +
+   scale_size_manual(values = c(0.5, 1, 2)) +
+   scale_colour_manual(values = color_pal(3)) +
+   guides(size = guide_legend(title = "Mantel's r",
+                              override.aes = list(colour = "grey35"), 
+                              order = 2),
+          colour = guide_legend(title = "Mantel's p", 
+                                override.aes = list(size = 3), 
+                                order = 1),
+          fill = guide_colorbar(title = "Pearson's r", order = 3))
Error in calcCurveGrob(x, x$debug) : end points must not be identical

However, can't understand the above text so could you please explain how this was fixed?

class_mantel was generated as follows:

class_mantel <- linkET::mantel_test(filtered_meta, amr_class, 
                         spec_select = list(bac_chao1 = "bac_chao1", 
                                              euk_chao1 = "euk_chao1",
                                              Alkyl_pH = "Alky pH 4.5")) %>% 
  mutate(rd = cut(r, breaks = c(-Inf, 0.2, 0.4, Inf),
                  labels = c("< 0.2", "0.2 - 0.4", ">= 0.4")),
         pd = cut(p, breaks = c(-Inf, 0.01, 0.05, Inf),
                  labels = c("< 0.01", "0.01 - 0.05", ">= 0.05")))

Thanks!

@Hy4m
Copy link
Owner

Hy4m commented Aug 10, 2024

Hi,

I'm running into possibly a similar issue here, see below

> qcorrplot(correlate(amr_class), type = "upper", diag = FALSE) +
+   geom_square() +
+   geom_couple(aes(colour = pd, size = rd), 
+               data = class_mantel, 
+               curvature = nice_curvature()) +
+   scale_fill_gradientn(colours = RColorBrewer::brewer.pal(11, "RdBu")) +
+   scale_size_manual(values = c(0.5, 1, 2)) +
+   scale_colour_manual(values = color_pal(3)) +
+   guides(size = guide_legend(title = "Mantel's r",
+                              override.aes = list(colour = "grey35"), 
+                              order = 2),
+          colour = guide_legend(title = "Mantel's p", 
+                                override.aes = list(size = 3), 
+                                order = 1),
+          fill = guide_colorbar(title = "Pearson's r", order = 3))
Error in calcCurveGrob(x, x$debug) : end points must not be identical

However, can't understand the above text so could you please explain how this was fixed?

class_mantel was generated as follows:

class_mantel <- linkET::mantel_test(filtered_meta, amr_class, 
                         spec_select = list(bac_chao1 = "bac_chao1", 
                                              euk_chao1 = "euk_chao1",
                                              Alkyl_pH = "Alky pH 4.5")) %>% 
  mutate(rd = cut(r, breaks = c(-Inf, 0.2, 0.4, Inf),
                  labels = c("< 0.2", "0.2 - 0.4", ">= 0.4")),
         pd = cut(p, breaks = c(-Inf, 0.01, 0.05, Inf),
                  labels = c("< 0.01", "0.01 - 0.05", ">= 0.05")))

Thanks!

I don’t know what happened, but it maybe work fine with shorter labels (variable name of correlation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants