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

plotly doesn't render in notebook #2774

Closed
ChristelSwift opened this issue May 14, 2018 · 2 comments
Closed

plotly doesn't render in notebook #2774

ChristelSwift opened this issue May 14, 2018 · 2 comments

Comments

@ChristelSwift
Copy link

ChristelSwift commented May 14, 2018

I have an issue when using plotly in markdown:

  • When i run a plotly command, the plot appears in the viewer rather than in the markdown document. How can i force it to render inline?
  • When i knit to html, the markdown version works as expected but in the notebook version, there is no plot.

System details

RStudio Edition : Desktop
RStudio Version : 1.1.447
OS Version      :  macOS Sierra 10.12.3
R Version       :   3.5.0

Steps to reproduce the problem

here's an example code: the normal plot works fine but the plotly plot displays in viewer rather than inline and doesn't display when knitting to notebook:

`
title: "R Notebook"
output:
html_notebook: default
html_document: default

plot(cars)
library(plotly)
plot_ly(cars, 
        x=~speed, y=~dist, type = 'scatter', mode = 'markers')

`
sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

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

other attached packages:
[1] knitr_1.20 lubridate_1.7.4 bindrcpp_0.2.2 plotly_4.7.1.9000 readxl_1.1.0
[6] forcats_0.3.0 stringr_1.3.1 dplyr_0.7.4 purrr_0.2.4 readr_1.1.1
[11] tidyr_0.8.0 tibble_1.4.2 ggplot2_2.2.1.9000 tidyverse_1.2.1

loaded via a namespace (and not attached):
[1] Rcpp_0.12.16 lattice_0.20-35 assertthat_0.2.0 rprojroot_1.3-2 digest_0.6.15
[6] psych_1.8.4 mime_0.5 R6_2.2.2 cellranger_1.1.0 plyr_1.8.4
[11] backports_1.1.2 evaluate_0.10.1 highr_0.6 httr_1.3.1 pillar_1.2.2
[16] rlang_0.2.0.9001 lazyeval_0.2.1 rstudioapi_0.7 data.table_1.11.2 rmarkdown_1.9
[21] foreign_0.8-70 htmlwidgets_1.2 munsell_0.4.3 shiny_1.0.5 broom_0.4.4
[26] compiler_3.5.0 httpuv_1.4.3 modelr_0.1.2 pkgconfig_2.0.1 base64enc_0.1-3
[31] mnormt_1.5-5 htmltools_0.3.6 viridisLite_0.3.0 crayon_1.3.4 withr_2.1.2
[36] later_0.7.2 grid_3.5.0 nlme_3.1-137 jsonlite_1.5 xtable_1.8-2
[41] gtable_0.2.0 magrittr_1.5 scales_0.5.0.9000 cli_1.0.0 stringi_1.2.2
[46] reshape2_1.4.3 promises_1.0.1 xml2_1.2.0 RColorBrewer_1.1-2 tools_3.5.0
[51] glue_1.2.0 hms_0.4.2 crosstalk_1.0.0 parallel_3.5.0 yaml_2.1.19
[56] colorspace_1.3-2 rvest_0.3.2 bindr_0.1.1 haven_1.1.1

@jmcphers
Copy link
Member

jmcphers commented May 15, 2018

This is the same issue as #2748; R 3.5 made some changes which cause HTML widgets to fail to display properly in notebook chunks. We have a fix and hope to have a patched build out by the end of the week. If you can't wait, you can try one of our daily builds:

https://dailies.rstudio.com/

@ronblum
Copy link
Contributor

ronblum commented Aug 23, 2018

Verified on MacOS 10.14 Mojave and Windows 10.

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

3 participants