YuLab-SMU / aplot

Decorate a plot with associated information
https://yulab-smu.top/aplot
99 stars 15 forks source link

aplot not working #38

Open CongLiu37 opened 5 months ago

CongLiu37 commented 5 months ago

Hello,

I am using aplot 0.2.2 and ggplot2 3.5.1. I tried the examples, but got error:

library(ggplot2)
library(aplot)

p <- ggplot(mtcars, aes(mpg, disp)) + geom_point()
p2 <- ggplot(mtcars, aes(mpg)) +
    geom_density(fill='steelblue', alpha=.5) +
        ggfun::theme_noxaxis()
p3 <- ggplot(mtcars, aes(x=1, y=disp)) +
    geom_boxplot(fill='firebrick', alpha=.5) +
    theme_void()
ap <- p %>%
    insert_top(p2, height=.3) %>%
    insert_right(p3, width=.1)
ap
Error in Ops.data.frame(guide_loc, panel_loc): '==' only defined for equally-sized data frames

Looks like they are not compatible?

Sincerely,

Cong

ningzhilin commented 4 months ago

I also have this problem recently. And when I build a new conda environment and just install these two packages ggplot2 and aplot, this code could run. But more installation, it could not.

CongLiu37 commented 4 months ago

It seems related with ggplot version. Ggplot 3.4.4 works, but 3.5 does not.

Sincerely,

Cong From: Zhilin Ning @.> Date: Friday, 21 June 2024 at 10:35 To: YuLab-SMU/aplot @.> Cc: Cong Liu @.>, Author @.> Subject: Re: [YuLab-SMU/aplot] aplot not working (Issue #38)

I also have this problem recently. And when I build a new conda environment and just install these two packages ggplot2 and aplot, this code could run. But more installation, it could not.

— Reply to this email directly, view it on GitHubhttps://github.com/YuLab-SMU/aplot/issues/38#issuecomment-2181823480, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARJR45SFP3GGKFZQHCOXLZ3ZIN7NFAVCNFSM6AAAAABJBZ7AH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBRHAZDGNBYGA. You are receiving this because you authored the thread.Message ID: @.***>

ningzhilin commented 4 months ago

image I try it again. And this works.

ningzhilin commented 4 months ago

image It solved when update the "patchwork" package. You can have a try