rbokeh icon indicating copy to clipboard operation
rbokeh copied to clipboard

Printing Rbokeh graphs in Jupyter Notebook.

Open stevemiller79 opened this issue 9 years ago • 2 comments

All that I've been able to use is rbokeh2html. Is there something like embed_notebook() for plotly?

Steve M

stevemiller79 avatar May 12 '16 15:05 stevemiller79

I've been wanting to be able to do this for a while and wasn't aware of embed_notebook(). ll take a look at it.

hafen avatar May 18 '16 16:05 hafen

Hafen --

Here's an abstracted script with data enclosed. The first 3 sections work, while the 4th fails.

Regards, Steve

######################################################################### library(rbokeh) library(data.table) library(lubridate) library(dplyr)

######################################################################### setwd("d:/data/russell/2016") slug <- fread("russellgraph.csv") slug$pdate <- as.Date(slug$pdate) str(slug)

######################################################################### ALLTOOLS <- c("pan","wheel_zoom", "box_zoom", "resize", "reset", "save", "help") nslug <- slug[portfolio %in% c("3000", "3000V", "3000G")] tit <- paste("Russell Portfolios -- ", min(nslug$pdate), " to ", max(nslug$pdate)) p <- figure( width = 1200, height = 800, legend_location ='top_left', title = tit , xlab = "Date", ylab = "Growth of $1", tools = ALLTOOLS) %>% ly_lines(as.integer(pdate), grdollar, width = 3,color=portfolio, data = nslug, hover = c(pdate,grdollar)) %>% ly_abline(a=1,b=0, width=2)

ly_lines(pdate, grdollar, width = 3,color=portfolio, data = nslug) %>%

ly_abline(a=1,b=0, width=2)

rbokeh2html(p)

######################################################################### ALLTOOLS <- c("pan","wheel_zoom", "box_zoom", "resize", "reset", "save", "help") nslug <- slug[portfolio %in% c("3000", "3000V", "3000G")] tit <- paste("Russell Portfolios -- ", min(nslug$pdate), " to ", max(nslug$pdate)) p <- figure( width = 1200, height = 800, legend_location ='top_left', title = tit , xlab = "Date", ylab = "Growth of $1", tools = ALLTOOLS) %>%

ly_lines(as.integer(pdate), grdollar, width = 3,color=portfolio, data =

nslug, hover = c(pdate,grdollar)) %>%

ly_abline(a=1,b=0, width=2)

ly_lines(pdate, grdollar, width = 3,color=portfolio, data = nslug) %>% ly_abline(a=1,b=0, width=2) rbokeh2html(p)

On Wed, May 18, 2016 at 11:48 AM, hafen [email protected] wrote:

I've been wanting to be able to do this for a while and wasn't aware of embed_notebook(). ll take a look at it.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/bokeh/rbokeh/issues/154#issuecomment-220088300


This transmission is confidential and intended solely for the use of the recipient named above. It may contain confidential, proprietary, or legally privileged information. If you are not the intended recipient, you are hereby notified that any unauthorized review, use, disclosure or distribution is strictly prohibited. If you have received this transmission in error, please contact the sender by reply e-mail and delete the original transmission and all copies from your system.

stevemiller79 avatar May 18 '16 19:05 stevemiller79