bokeh/rbokeh

arranging plot side by side in knitr html

mattaws opened this issue · 2 comments

I am struggling to arrange plots side by side. Online research suggests par(mfrow = c(1, 2)) or grid.arrange. grid.arrange seems to only work with "globs" which are outputs of ggplot. par does not seem to work for me

NOTE1: The cude has two identical figures but i ultimately want to put two completely diffetent figures (imagine line chart and bar chart from two different data frames) side by side
NOTE2: I am not looking for grid plot because I am trying to have 2 different figures from two different data frames.


#df= devplot

par(mfrow = c(1, 2))

s1 <- figure() %>%
  ly_bar(
  devplot$assigneeidentity,
  devplot$total_issues,
  color = status,
  data = devplot,
  position = "fill",
  hover = TRUE
  ) %>%
  x_axis(label = "owner") %>%
  y_axis(label = "% of issues open / closed")

s2 <- figure() %>%
  ly_bar(
  devplot$assigneeidentity,
  devplot$total_issues,
  color = status,
  data = devplot,
  position = "fill",
  hover = TRUE
  ) %>%
  x_axis(label = "owner") %>%
  y_axis(label = "% of issues open / closed")

s1
s2

Why not grid_plot, as mentioned in your note2? It looks like you can combine different figures from different data.frames.

library(rbokeh)

bk1 <- figure() %>%
  ly_bar(variety, data = lattice::barley) %>%
  theme_axis("x", major_label_orientation = 90)

bk2 <- figure() %>%
  ly_points(Sepal.Length, Sepal.Width, data = iris,
            color = Species, glyph = Species,
            hover = list(Sepal.Length, Sepal.Width))

grid_plot(list(bk1, bk2))

yes, that worked. thanks :)