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

ggmosaic::geom_mosaic breaks with version 3.3.0 #3899

Closed
rmcd1024 opened this issue Mar 17, 2020 · 6 comments
Closed

ggmosaic::geom_mosaic breaks with version 3.3.0 #3899

rmcd1024 opened this issue Mar 17, 2020 · 6 comments

Comments

@rmcd1024
Copy link

rmcd1024 commented Mar 17, 2020

Axis tick marks and tick-mark labels appear with ggplot2 3.2.1 but not with ggplot2 3.3.0. Examples below created using ggomosaic 0.2.2, but this happened also with 0.2.0.

library(ggplot2 )  ## 3.2.1
library(ggmosaic)  ## 0.2.2 (dev version)
ggplot(data = titanic) + geom_mosaic(aes(x = product(Class), fill = Survived))

ggmosaic_ggplot3 2 1-1

library(ggplot2 )  ## 3.3.0
library(ggmosaic)  ## 0.2.2 (dev version)
ggplot(data = titanic) + geom_mosaic(aes(x = product(Class), fill = Survived))

ggmosaic_ggplot3 3 0-1

@clauswilke
Copy link
Member

I suspect this is a problem with the ggmosaic code. From looking at geom_mosaic(), I see a lot of strange manipulations of the aesthetic mapping. I wonder whether this code made assumptions about how mappings are stored internally in ggplot2 that aren't true anymore.

https://github.com/haleyjeppson/ggmosaic/blob/master/R/geom-mosaic.r

Maybe @yutannihilation has more insight here.

@yutannihilation
Copy link
Member

yutannihilation commented Mar 18, 2020

Not sure whether the tweaks ggmosaic adds are valid or not, but probably this is due to the change around axis guide (e.g. #3398).

@clauswilke
Copy link
Member

Yeah, I was wondering about this.

@paleolimbot If you've got free time, would you be able to look into this and maybe suggest a fix to the ggmosaic authors?

@paleolimbot
Copy link
Member

Of course! I'll give it a shot this evening.

@paleolimbot
Copy link
Member

This is an issue with the scale_(x|y)_productlist() in ggmosaic...a position scale subclasss that I didn't know about. I've updated the issue in ggmosaic and offered to PR a fix!

@yutannihilation
Copy link
Member

Wow, so quick! Thanks @paleolimbot and @rmcd1024. I added a minor comment on your PR, but maybe you can ignore.

haleyjeppson/ggmosaic#42

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

No branches or pull requests

4 participants