Samuele Carcagno
2020-Apr-30 01:05 UTC
[R-sig-Debian] problem with `viridis` on Ubuntu 20.04
Il 30/04/20 01:39, Dirk Eddelbuettel ha scritto:> > On 30 April 2020 at 01:24, Samuele Carcagno wrote: > | I've hit a bug on Ubuntu 20.04. The issue occurred both with the R > | version that shipped with Ubuntu last week, and it is occurring now with > | the CRAN packages from one of the mirros (deb > | http://cran.mirror.garr.it/mirrors/CRAN/bin/linux/ubuntu/ > | focal-cran40/). The issue occurs whether I use the deb package for > | viridis in the Ubuntu repos, or I install it with `install.packages()` in R. > | > | The issue is that when I call a function from the 'viridis' package > | (e.g. running the first example in the `viridis` vignette: > | https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html) > | R gets stuck indefinitely; the system monitor shows the R process using > | CPU resources but nothing happens at the terminal and I'm also unable to > | stop the function with Ctrl-C. > | > | I did a little digging and simply calling the function `viridis` from > | the `viridisLite` package causes the same problem, execution gets stuck > | at the line: > | > | cols <- fn_cols(seq(begin, end, length.out = n)) / 255 > | > | which is line 177 here: > | https://github.com/sjmgarnier/viridisLite/blob/master/R/viridis.R#L177 > | > | I'm dual booting Debian Buster on the same machine and no such issue > | occurs with R 4.0.0 and the same versions of the `viridis` and > | `viridisLite` packages. Also no such issue occurs on Windows 10 or on a > | Mac both with R 4.0.0 and the latest versions of `viridis` and > | `viridisLite`. > | > | I was not sure where should I report the bug, so I thought of asking for > | advice here first. > > Can we make it reproducible, please? Can you provide a minimal script with > values for begin, end, n, ... etc pp or a concrete call? > > I got lost in your description above between what version of R from where you > ran with which package or function. > > Keep. It. Simple. And. Concise. > > And reproducible.I've attached a script that triggers the bug on my system. It's just two lines, one to load `viridisLite`, and one to call the `viridis` function. I've also attached the output of `sessionInfo`. To sum up all the additional info in my previous e-mail: the bug occurs on Ubuntu 20.04 with R 4.0.0, but does not occur on Debian, Windows, or Mac using the same version of R (R 4.0.0), and the same version of viridisLite. Best, Sam> > For what it is worth, it _works for me with R 4.0.0 on Ubuntu 19.10_ with the > binary .deb from my PPA (as blogged about, but should be identical to what > Michael built and ships via CRAN). Log of a fresh Emacs session below. I > double Ubuntu 20.04 is different but "one never knows". > > Thank you! > > Dirk > > Log below > > R version 4.0.0 (2020-04-24) -- "Arbor Day" > Copyright (C) 2020 The R Foundation for Statistical Computing > Platform: x86_64-pc-linux-gnu (64-bit) > > R is free software and comes with ABSOLUTELY NO WARRANTY. > You are welcome to redistribute it under certain conditions. > Type 'license()' or 'licence()' for distribution details. > > Natural language support but running in an English locale > > R is a collaborative project with many contributors. > Type 'contributors()' for more information and > 'citation()' on how to cite R or R packages in publications. > > Type 'demo()' for some demos, 'help()' for on-line help, or > 'help.start()' for an HTML browser interface to help. > Type 'q()' to quit R. > > > There's an informal tradition that those announcements [about R releases] contain at least one mistake, but apparently I forgot this time, so users have to make up their own.... > -- Peter Dalgaard (about an apparent non-bug report in his former R-announce message) > R-help (December 2009) > > R> setwd('/home/edd/') > R> > R> library(viridisLite) > R> example(viridis) > > viridsR> library(ggplot2) > > viridsR> library(hexbin) > > viridsR> dat <- data.frame(x = rnorm(10000), y = rnorm(10000)) > > viridsR> ggplot(dat, aes(x = x, y = y)) + > virids+ geom_hex() + coord_fixed() + > virids+ scale_fill_gradientn(colours = viridis(256, option = "D")) > Hit <Return> to see next plot: > > viridsR> # using code from RColorBrewer to demo the palette > viridsR> n = 200 > > viridsR> image( > virids+ 1:n, 1, as.matrix(1:n), > virids+ col = viridis(n, option = "D"), > virids+ xlab = "viridis n", ylab = "", xaxt = "n", yaxt = "n", bty = "n" > virids+ ) > Hit <Return> to see next plot: > R> >-------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: viridis_bug_example.R URL: <https://stat.ethz.ch/pipermail/r-sig-debian/attachments/20200430/76ca7904/attachment-0001.ksh> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: sessionInfo.txt URL: <https://stat.ethz.ch/pipermail/r-sig-debian/attachments/20200430/76ca7904/attachment-0001.txt>
Dirk Eddelbuettel
2020-Apr-30 01:14 UTC
[R-sig-Debian] problem with `viridis` on Ubuntu 20.04
On 30 April 2020 at 03:05, Samuele Carcagno wrote: | Il 30/04/20 01:39, Dirk Eddelbuettel ha scritto: | > Keep. It. Simple. And. Concise. | > | > And reproducible. | | I've attached a script that triggers the bug on my system. It's just two | lines, one to load `viridisLite`, and one to call the `viridis` | function. I've also attached the output of `sessionInfo`. | | To sum up all the additional info in my previous e-mail: the bug occurs | on Ubuntu 20.04 with R 4.0.0, but does not occur on Debian, Windows, or | Mac using the same version of R (R 4.0.0), and the same version of | viridisLite. Can you decompose it to see if the data generation is the problem (likely R) or the drawing (maybe a change in graphics ?) What does capabilities() say? Anything missing? On 19.10 I have R> capabilities() jpeg png tiff tcltk X11 TRUE TRUE TRUE TRUE TRUE aqua http/ftp sockets libxml fifo FALSE TRUE TRUE TRUE TRUE cledit iconv NLS profmem cairo FALSE TRUE TRUE TRUE TRUE ICU long.double libcurl TRUE TRUE TRUE R> Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
Samuele Carcagno
2020-Apr-30 01:26 UTC
[R-sig-Debian] problem with `viridis` on Ubuntu 20.04
Il 30/04/20 03:14, Dirk Eddelbuettel ha scritto:> > On 30 April 2020 at 03:05, Samuele Carcagno wrote: > | Il 30/04/20 01:39, Dirk Eddelbuettel ha scritto: > | > Keep. It. Simple. And. Concise. > | > > | > And reproducible. > | > | I've attached a script that triggers the bug on my system. It's just two > | lines, one to load `viridisLite`, and one to call the `viridis` > | function. I've also attached the output of `sessionInfo`. > | > | To sum up all the additional info in my previous e-mail: the bug occurs > | on Ubuntu 20.04 with R 4.0.0, but does not occur on Debian, Windows, or > | Mac using the same version of R (R 4.0.0), and the same version of > | viridisLite. > > Can you decompose it to see if the data generation is the problem (likely R) > or the drawing (maybe a change in graphics ?)I'm not familiar with the internals of `viridisLite`, so I'm not sure I'd be able to help there. I could open a bug report on the `viridisLite` repo and see if the author has suggestions on how to narrow down the issue.> > What does capabilities() say? Anything missing? On 19.10 I havebelow is the output of `capabilities()` from my system: > capabilities() jpeg png tiff tcltk X11 aqua TRUE TRUE TRUE TRUE TRUE FALSE http/ftp sockets libxml fifo cledit iconv TRUE TRUE TRUE TRUE TRUE TRUE NLS profmem cairo ICU long.double libcurl TRUE TRUE TRUE TRUE TRUE TRUE> > R> capabilities() > jpeg png tiff tcltk X11 > TRUE TRUE TRUE TRUE TRUE > aqua http/ftp sockets libxml fifo > FALSE TRUE TRUE TRUE TRUE > cledit iconv NLS profmem cairo > FALSE TRUE TRUE TRUE TRUE > ICU long.double libcurl > TRUE TRUE TRUE > R> > > Dirk >