bokeh / rbokeh

R interface to Bokeh http://hafen.github.io/rbokeh/
Other
313 stars 66 forks source link

Rbokeh -- "Strip Plot" #155

Closed stevemiller79 closed 8 years ago

stevemiller79 commented 8 years ago

I've developed a strip plot using rbokeh. A strip plot is simply a scatter where one of the axes (in this case the Y) is categorical. ly_points() almost gives me what I want, but I've been unable to jitter the numeric points like a true strip plot. Is there a way to do this?

Steve M

bryevdv commented 8 years ago

(@hafen please correct me if I am wrong about something RBokeh specific)

Probably not automatically yet. But this recently merged PR https://github.com/bokeh/bokeh/pull/3959 added support for "computed transforms" on column data source columns, including normal and uniform jitter. And this in-flight PR https://github.com/bokeh/bokeh/pull/4243 will add support for integrating those computed columns transparently into the standard machinery. So, hopefully this will all be very easy to do in the near future.

hafen commented 8 years ago

Sorry I missed this. If I understand correctly, you should be able to use R's built-in jitter(), (e.g. ly_points(jitter(x), y) correct? Or do you mean that you also want to jitter the categorical y-axis? In that case, see ?catjitter (reference here).

As @bryevdb mentioned, there is now jitter functionality directly embedded in bokeh, but I haven't quite got the latest version plugged in to expose that. However, it seems natural to just R's jitter functions as that's the R-like thing to do.