rbokeh: overlay points on a boxplot

Hi,

Is it possible to do this in rbokeh (overlay observations on a boxplot)

http://www.zijdeman.nl/files/r_examples/boxplot_example.html

data(iris)

figure() %>% ly_boxplot(x=as.character(iris$Species), y=iris$Sepal.Width) %>%

	ly_points(x=as.character(iris$Species), y=iris$Sepal.Width)

is easy, but then when I tried to think of a way to jitter the points I ran into conceptual problems. ly_boxplots forces a categorical x-axis and jittering is a numeric x-axis.

Any ideas?

Thanks,

Jeremiah

Here’s an example:

dd ← lattice::make.groups(

a = rnorm(100),

b = rnorm(100, mean = 2),

c = rnorm(100, mean = 5)

)

dd$jitwhich ← paste0(dd$which, “:”, runif(min = 0.2, max = 0.8, nrow(dd)))

figure() %>%

ly_boxplot(data, which, data = dd) %>%

ly_points(jitwhich, data, data = dd, color = “black”)

In Bokeh, you can offset categorical values by appending a “:” followed by a number between 0 and 1. 0.5 is center. It would be nice to have a “catjitter" function - if you file an issue, this should be an easy addition.

Ryan

···

On Oct 22, 2015, at 10:04 AM, jeremiah rounds [email protected] wrote:

Hi,

Is it possible to do this in rbokeh (overlay observations on a boxplot)

http://www.zijdeman.nl/files/r_examples/boxplot_example.html

data(iris)

figure() %>% ly_boxplot(x=as.character(iris$Species), y=iris$Sepal.Width) %>%

  ly_points(x=as.character(iris$Species), y=iris$Sepal.Width)

is easy, but then when I tried to think of a way to jitter the points I ran into conceptual problems. ly_boxplots forces a categorical x-axis and jittering is a numeric x-axis.

Any ideas?

Thanks,

Jeremiah

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f7f0805f-adf0-44ec-a466-406b4934158c%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.