-
Notifications
You must be signed in to change notification settings - Fork 22
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
Axis labels no longer showing up #41
Comments
I've verified that this is occurs with ggplot2 3.3 and not with ggplot2 3.2.1. The axis ticks and tick labels appear correctly when I downgrade to 3.2.1. |
Hi! I'm the guy who broke your plot by rewriting the ggplot2 scales. We tried to identify all the position scale subclasses before the release, but somehow missed yours! Here's the note that I worked up at the time describing how to fix: Position scales now use the if (utils::packageVersion("ggplot2") >= "3.2.1.9000") {
default_guide <- ggplot2::waiver()
} else {
default_guide <- "none"
}
ggplot2::continuous_scale(
...,
guide = default_guide
) Feel free to let me know if you have any questions! I'd be happy to PR a fix if I didn't describe it well enough for you to feel confident. fixing it yourself. |
I think that code needs to go here: https://github.com/haleyjeppson/ggmosaic/blob/master/R/scale-product.R#L64 and here: https://github.com/haleyjeppson/ggmosaic/blob/master/R/scale-product.R#L91 |
This should be fixed by pr #42. Thanks to @paleolimbot. |
I have just tried it, and I still see no axis labels. I am using: Did I get something wrong?! |
@francescomontinaro The pull request with the fix has not been accepted yet so installing 0.2.2/master won't work. Try this: devtools::install_github('rmcd1024/ggmosaic', ref="ggplot_3.3.0-scales/fix") |
Hi,
Sorry I didn't know that. I have now installed the fix and it's working.
Thank you very much,
…On Fri, 20 Mar 2020, 20:59 Robert McDonald, ***@***.***> wrote:
@francescomontinaro <https://github.com/francescomontinaro> The pull
request with the fix has not been accepted yet so installing 0.2.2/master
won't work. Try this:
devtools::install_github('rmcd1024/ggmosaic', ref="ggplot_3.3.0-scales/fix")
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADZQPMDOD2DSEYZDSUFD3ODRIPKK7ANCNFSM4LGBC7EQ>
.
|
It's not obvious at all. I'm glad to hear it's working.
On Sun, Mar 22, 2020 at 10:25 AM Francesco Montinaro <
[email protected]> wrote:
… Hi,
Sorry I didn't know that. I have now installed the fix and it's working.
Thank you very much,
On Fri, 20 Mar 2020, 20:59 Robert McDonald, ***@***.***>
wrote:
> @francescomontinaro <https://github.com/francescomontinaro> The pull
> request with the fix has not been accepted yet so installing 0.2.2/master
> won't work. Try this:
>
> devtools::install_github('rmcd1024/ggmosaic',
ref="ggplot_3.3.0-scales/fix")
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#41 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ADZQPMDOD2DSEYZDSUFD3ODRIPKK7ANCNFSM4LGBC7EQ
>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBGHVL3OLC434APVPKJWY3RIYUX7ANCNFSM4LGBC7EQ>
.
|
The hotfix works for me as well as far as restoring labels on tick marks. However, perhaps related or perhaps separate issue that I can't seem to change the library(ggplot2)
library(ggmosaic)
ggplot(data = titanic) +
geom_mosaic(aes(x = product(Class), fill = Survived)) +
ggplot2::labs(x = "Passenger class",
title = "Survival rate by passenger class") Created on 2020-03-24 by the reprex package (v0.3.0) |
We have three versions of |
Leaving
library(ggplot2)
library(ggmosaic)
packageDescription("ggmosaic")$Version
#> [1] "0.2.0"
packageDescription("ggplot2")$Version
#> [1] "3.3.0"
data(Titanic)
titanic <- as.data.frame(Titanic)
titanic$Survived <- factor(titanic$Survived,
levels = c("Yes", "No"))
ggplot(data = titanic) +
geom_mosaic(aes(weight = Freq, x = product(Class), fill = Survived)) +
# good practice: use the 'dependent' variable (or most important variable)
# as fill variable
labs(x = "Passenger class",
y = "Survived sinking",
title = "Survival rate by passenger class") Created on 2020-03-24 by the reprex package (v0.3.0)
library(ggplot2)
library(ggmosaic)
packageDescription("ggmosaic")$Version
#> [1] "0.2.2"
packageDescription("ggplot2")$Version
#> [1] "3.3.0"
data(Titanic)
titanic <- as.data.frame(Titanic)
titanic$Survived <- factor(titanic$Survived,
levels = c("Yes", "No"))
ggplot(data = titanic) +
geom_mosaic(aes(weight = Freq, x = product(Class), fill = Survived)) +
# good practice: use the 'dependent' variable (or most important variable)
# as fill variable
labs(x = "Passenger class",
y = "Survived sinking",
title = "Survival rate by passenger class") Created on 2020-03-24 by the reprex package (v0.3.0)
library(ggplot2)
library(ggmosaic)
# devtools::install_github('rmcd1024/ggmosaic', ref="ggplot_3.3.0-scales/fix")
packageDescription("ggmosaic")$Version
#> [1] "0.2.2"
packageDescription("ggmosaic")$RemoteRef
#> [1] "ggplot_3.3.0-scales/fix"
packageDescription("ggplot2")$Version
#> [1] "3.3.0"
data(Titanic)
titanic <- as.data.frame(Titanic)
titanic$Survived <- factor(titanic$Survived,
levels = c("Yes", "No"))
ggplot(data = titanic) +
geom_mosaic(aes(weight = Freq, x = product(Class), fill = Survived)) +
# good practice: use the 'dependent' variable (or most important variable)
# as fill variable
labs(x = "Passenger class",
y = "Survived sinking",
title = "Survival rate by passenger class") Created on 2020-03-24 by the reprex package (v0.3.0) |
Hey! I tried this and I'm still having trouble having the tick marks appear. I think I am just not properly understanding how to install the separate versions of each package? Or has the patch changed? Thanks so much! |
Thank you all for the valuable input (and patience while I finished up the semester). I believe this is fixed now and I've created the table below to summarise the compatibility issues.
|
Hi there! I hope the end of the semester went well for you. I have just tried this and I'm still having trouble with re-labeling my axis. I am using ggplot2 version 3.3.0 and ggmosaic version 0.3.0. I have tried using xlab() and ylab() separately as well as labs() with each specified with no luck. I am able to change my main title and legend title using labs(title="", fill="") etc. Thanks so much for your help! |
@reblin perhaps I can help. What happens when you run this code? library(ggplot2)
library(ggmosaic)
packageDescription("ggmosaic")$Version
packageDescription("ggplot2")$Version
data(Titanic)
titanic <- as.data.frame(Titanic)
titanic$Survived <- factor(titanic$Survived,
levels = c("Yes", "No"))
ggplot(data = titanic) +
geom_mosaic(aes(weight = Freq, x = product(Class), fill = Survived)) +
labs(x = "Passenger class",
y = "Survived sinking",
title = "Survival rate by passenger class") |
@ibecav Hi! Thanks so much. This worked, so it must be something with the way I have my data frame formatted. I'll try playing around with it to get it to work. |
You're welcome to email me at that user name on gmail if I can be helpful... |
data(Titanic) ggplot(data = titanic) + R version 3.6.3. Still unable to have tick marks appear. Any assistance is appreciated. |
@sjmalacho: Try installing the development version (0.3.0) from this repository:
|
@rmcd1024 |
I cannot understand why this is closed, the issue persist. R version 4.0.2
It is a shame, I'll have to keep using mosaciplot from graphics. |
After running: devtools::install_github('haleyjeppson/ggmosaic') I created this reprex. See my session info. Does it match yours, @nmolanog? library(ggmosaic)
#> Loading required package: ggplot2
data(Titanic)
titanic <- as.data.frame(Titanic)
titanic$Survived <- factor(titanic$Survived,
levels = c("Yes", "No"))
ggplot(data = titanic) +
geom_mosaic(aes(weight = Freq, x = product(Class), fill = Survived)) +
labs(x = "Passenger class",
y = "Survived sinking",
title = "Survival rate by passenger class") Created on 2020-07-26 by the reprex package (v0.3.0) Session infodevtools::session_info()
#> - Session info ---------------------------------------------------------------
#> setting value
#> version R version 4.0.2 (2020-06-22)
#> os Windows 10 x64
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_United States.1252
#> ctype English_United States.1252
#> tz Europe/Helsinki
#> date 2020-07-26
#>
#> - Packages -------------------------------------------------------------------
#> package * version date lib source
#> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
#> backports 1.1.8 2020-06-17 [1] CRAN (R 4.0.1)
#> callr 3.4.3 2020-03-28 [1] CRAN (R 4.0.0)
#> cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.0)
#> colorspace 1.4-1 2019-03-18 [1] CRAN (R 4.0.0)
#> crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0)
#> curl 4.3 2019-12-02 [1] CRAN (R 4.0.0)
#> data.table 1.13.0 2020-07-24 [1] CRAN (R 4.0.2)
#> desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.0)
#> devtools 2.3.1 2020-07-21 [1] CRAN (R 4.0.2)
#> digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.0)
#> dplyr 1.0.0 2020-05-29 [1] CRAN (R 4.0.0)
#> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.0)
#> evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0)
#> fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0)
#> farver 2.0.3 2020-01-16 [1] CRAN (R 4.0.0)
#> fs 1.4.2 2020-06-30 [1] CRAN (R 4.0.2)
#> generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.0)
#> ggmosaic * 0.3.0 2020-07-26 [1] Github (haleyjeppson/ggmosaic@9dd8eb6)
#> ggplot2 * 3.3.2 2020-06-19 [1] CRAN (R 4.0.1)
#> glue 1.4.1 2020-05-13 [1] CRAN (R 4.0.0)
#> gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.0)
#> highr 0.8 2019-03-20 [1] CRAN (R 4.0.0)
#> htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.1)
#> htmlwidgets 1.5.1 2019-10-08 [1] CRAN (R 4.0.0)
#> httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.2)
#> jsonlite 1.7.0 2020-06-25 [1] CRAN (R 4.0.2)
#> knitr 1.29 2020-06-23 [1] CRAN (R 4.0.2)
#> lazyeval 0.2.2 2019-03-15 [1] CRAN (R 4.0.0)
#> lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.0)
#> magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.0)
#> memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.0)
#> mime 0.9 2020-02-04 [1] CRAN (R 4.0.0)
#> munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.0)
#> pillar 1.4.6 2020-07-10 [1] CRAN (R 4.0.2)
#> pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 4.0.2)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0)
#> pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.0)
#> plotly 4.9.2.1 2020-04-04 [1] CRAN (R 4.0.0)
#> plyr 1.8.6 2020-03-03 [1] CRAN (R 4.0.0)
#> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.0)
#> processx 3.4.3 2020-07-05 [1] CRAN (R 4.0.2)
#> productplots 0.1.1 2016-07-02 [1] CRAN (R 4.0.0)
#> ps 1.3.3 2020-05-08 [1] CRAN (R 4.0.0)
#> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.0)
#> R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.0)
#> Rcpp 1.0.5 2020-07-06 [1] CRAN (R 4.0.2)
#> remotes 2.2.0 2020-07-21 [1] CRAN (R 4.0.2)
#> rlang 0.4.7 2020-07-09 [1] CRAN (R 4.0.2)
#> rmarkdown 2.3.2 2020-07-20 [1] Github (rstudio/rmarkdown@ff1b279)
#> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.0)
#> scales 1.1.1 2020-05-11 [1] CRAN (R 4.0.0)
#> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0)
#> stringi 1.4.6 2020-02-17 [1] CRAN (R 4.0.0)
#> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.0)
#> testthat 2.3.2 2020-03-02 [1] CRAN (R 4.0.0)
#> tibble 3.0.3 2020-07-10 [1] CRAN (R 4.0.2)
#> tidyr 1.1.0 2020-05-20 [1] CRAN (R 4.0.0)
#> tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.0)
#> usethis 1.6.1 2020-04-29 [1] CRAN (R 4.0.0)
#> vctrs 0.3.2 2020-07-15 [1] CRAN (R 4.0.2)
#> viridisLite 0.3.0 2018-02-01 [1] CRAN (R 4.0.0)
#> withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.0)
#> xfun 0.16 2020-07-24 [1] CRAN (R 4.0.2)
#> xml2 1.3.2 2020-04-23 [1] CRAN (R 4.0.0)
#> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.0)
#> |
This is mine
It is strange that runing
ggmosaic version here is different from that obtained from devtools::session_info() |
|
Maybe you should update the package and restart RStudio or even your computer. Is it possible, that the same package is installed in several libraries on your computer? |
@GegznaV restart fixed the issue, thanks for your kind help |
Hi, unfortunately I have the same issue, I don't see the axis label. I have tried to install the ggmosaic development from
Can anyone help please? |
Hi there.. this is my first time sending an inquiry like this, but I seem to be having this problem also -- no axis labels or tick marks. I am using ggmosaic 0.2.0 with ggplot2 3.3.2 in R 4.0.3. I tried to install that devtools code to test that version, but I couldn't get it to install. Any guidance is appreciated. |
Hello.You should be using `ggmosaic` 0.3.0 or higher. If you install the
master branch from github you'll get 0.3.1. That's what I'm running and
everything seems to be working.
Try this:
remotes::install_github('haleyjeppson/ggmosaic' )
This will give you 0.3.1. I think the issue is that the author hasn't
updated the package on CRAN, just on github.
…On Tue, Dec 22, 2020 at 5:00 PM wshorton3 ***@***.***> wrote:
Hi there.. this is my first time sending an inquiry like this, but I seem
to be having this problem also -- no axis labels or tick marks. I am using
ggmosaic 0.2.0 with ggplot2 3.3.2 in R 4.0.3. I tried to install that
devtools code to test that version, but it didn't work for me. Any guidance
is appreciated.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBGHVICWMLFZHDMUWQHOQLSWEQHXANCNFSM4LGBC7EQ>
.
|
@rmcd1024 thank you that method of installing the new version worked! |
I'm wondering if ggplot2 3.3 has broken something. I now can't get axis labels (i.e., tick marks and tick mark labels) to appear, with or without
scale_?_productlist
:The text was updated successfully, but these errors were encountered: