daattali / ggExtra

📊 Add marginal histograms to ggplot2, and more ggplot2 enhancements
http://daattali.com/shiny/ggExtra-ggMarginal-demo/
Other
383 stars 45 forks source link

Marginal plot not mapped correctly after coord_flip() #37

Closed AhabTheJudge closed 7 years ago

AhabTheJudge commented 7 years ago

I have a geom_boxplot() + coord_flip(). Adding a marginal histogram to the y axis places it on the true x axis. Trying to add it to the x axis throws an error.

daattali commented 7 years ago

You're right, coode_flip() doesn't work. I'll try to take a look when I find some time, but it's unlikely in the near future as I have a bit too much on my plate at the moment. I'd be happy to accept a PR :)

AhabTheJudge commented 7 years ago

No worries. I totally get it. Just wanted to let you know. Thanks!

On Thu, Feb 16, 2017 at 6:15 PM Dean Attali notifications@github.com wrote:

You're right, coode_flip() doesn't work. I'll try to take a look when I find some time, but it's unlikely in the near future as I have a bit too much on my plate at the moment. I'd be happy to accept a PR :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/daattali/ggExtra/issues/37#issuecomment-280508474, or mute the thread https://github.com/notifications/unsubscribe-auth/AYoJLMpx76kFg6KYZgmTqyBWGo310O22ks5rdOaLgaJpZM4MDI1u .

-- Justin DeVault

crew102 commented 7 years ago

Can u post reprod ex?

daattali commented 7 years ago
set.seed(30)
df <- data.frame(x = rnorm(500, 50, 10), y = runif(500, 0, 50))
p <- ggplot2::ggplot(df, ggplot2::aes(x, y)) + ggplot2::geom_point()

Compare ggMarginal(p) to ggMarginal(p + coord_flip())

crew102 commented 7 years ago

Thanks. I think we can close this in the next version.

AhabTheJudge commented 7 years ago

Sorry for not being able to reply. Thank you all!

On Fri, Mar 3, 2017 at 10:23 AM Chris Baker notifications@github.com wrote:

Thanks. I think we can close this in the next version.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/daattali/ggExtra/issues/37#issuecomment-283999191, or mute the thread https://github.com/notifications/unsubscribe-auth/AYoJLASfSfXRJWaRfagzMYJybdTEdOk-ks5riD5-gaJpZM4MDI1u .

-- Justin DeVault

daattali commented 7 years ago

After the refactor of #40 I get an error when flipping and using boxplots:

p <- ggplot(mtcars, aes(mpg,wt)) + geom_point() + coord_flip()
ggMarginal(p, type="boxplot")
crew102 commented 7 years ago

Should this be closed by the refactor? Also issue #43?

daattali commented 7 years ago

I was going to ask you - when running the tests for the package, the tests for this are not run on previous ggplot2 versions , resulting in

Skipped -----------------------------------------

messages. I assume that's on purpose - this feature should only be tested on latest version. Do you have any idea if CRAN gives any problems for skipped tests?

crew102 commented 7 years ago

Looks like the reference figure that is used in that test never made into into the figs folder. I'll fix.