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

An strange error while use ggplotly #1675

Closed
Gerde opened this issue Dec 27, 2019 · 1 comment
Closed

An strange error while use ggplotly #1675

Gerde opened this issue Dec 27, 2019 · 1 comment

Comments

@Gerde
Copy link

Gerde commented Dec 27, 2019

Hi,

I came across an error while use ggplotly:
The code:

library(ggplot2)
library(plotly)

df <- data.frame(x = rep(c('A','B','C'),3), y = 1:9, group = rep(c('x','y','z'),each = 3))
p <- ggplot(df, aes(x = x, y = y, group = group)) + geom_line()

ggplotly(p)

errors:

loading:‘plotly’

The following object is masked from ‘package:ggplot2’:

    last_plot

The following object is masked from ‘package:stats’:

    filter

The following object is masked from ‘package:graphics’:

    layout


 *** caught segfault ***
address 0xb7, cause 'memory not mapped'

Traceback:
 1: .External("cairo_create_new_device", as.character(ctype), file,     width, height, pointsize, bg, canvas, umpl, dpi, ..., PACKAGE = "Cairo")
 2: dev_fun(file = tempfile(), width = width %||% 640, height = height %||%     480)
 3: gg2list(p, width = width, height = height, tooltip = tooltip,     dynamicTicks = dynamicTicks, layerData = layerData, originalData = originalData,     source = source, ...)
 4: ggplotly.ggplot(p)
 5: ggplotly(p)
An irrecoverable exception occurred. R is aborting now ...
Segment error (core dumped)

sessionInfos:

R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
 [1] LC_CTYPE=zh_CN.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=zh_CN.UTF-8        LC_COLLATE=zh_CN.UTF-8
 [5] LC_MONETARY=zh_CN.UTF-8    LC_MESSAGES=zh_CN.UTF-8
 [7] LC_PAPER=zh_CN.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] plotly_4.9.1  ggplot2_3.1.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3        magrittr_1.5      tidyselect_0.2.5  munsell_0.4.3
 [5] viridisLite_0.2.0 colorspace_1.3-1  R6_2.2.2          rlang_0.4.2
 [9] httr_1.2.1        plyr_1.8.4        dplyr_0.8.3       tools_3.4.4
[13] grid_3.4.4        data.table_1.10.0 gtable_0.2.0      withr_2.1.2
[17] htmltools_0.4.0   lazyeval_0.2.0    assertthat_0.2.0  digest_0.6.12
[21] tibble_2.1.3      crayon_1.3.4      purrr_0.2.5       tidyr_0.8.2
[25] htmlwidgets_1.5.1 glue_1.3.0        compiler_3.4.4    pillar_1.4.3
[29] scales_0.5.0      jsonlite_1.6      pkgconfig_2.0.2

Any problem about my code?

Best,
Gerde

@cpsievert
Copy link
Collaborator

This code runs ok for me...there is likely an issue with your Cairo device...does this run ok for you?

library(Cairo)
Cairo(600, 600, file="plot.png", type="png", bg="white")
plot(rnorm(4000),rnorm(4000),col="#ff000018",pch=19,cex=2) # semi-transparent red
dev.off() 

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

2 participants