☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Does BokehJS support gridplot ?

Community Support
zhihui
zhihui

I’m looking for ways to arrange multiple sub-plots using gridplot, not sure if anyone knows how to do that via BokehJS in a webpage. Can you please kindly give an example ?

⌁   Link to post
zhihui
zhihui

I managed to figure out one way to do that, below is the code snippet which works for me.

…

p1 = $.fn.bokeh(“figure”, {

options: _.extend({title: ‘Example (1)’}, options)

glyphs: [glyph]

guides: [xaxis, yaxis]

tools: [“Pan”, “WheelZoom” ,“Resize”, “Resize”, “PreviewSave”]

})

p2 = $.fn.bokeh(“figure”, {

options: _.extend({title: ‘Example (2)’}, options)

glyphs: [glyph]

guides: [xaxis, yaxis]

tools: [“Pan”, “WheelZoom” ,“Resize”, “Resize”, “PreviewSave”]

})

pgrid = Bokeh.Collections(‘GridPlot’).create({

children: [[p1, p2]],

toolbar_location : ‘above’,

})

show = (target, plot) →

myrender = () →

view = new plot.default_view(model: plot)

target.append(view.$el)

_.defer(myrender)

show($(“#bkplot”), pgrid)

在 2015年4月11日星期六 UTC+8下午11:47:13,zhihui写道:

···

I’m looking for ways to arrange multiple sub-plots using gridplot, not sure if anyone knows how to do that via BokehJS in a webpage. Can you please kindly give an example ?

⌁   Link to post
Bryan
Bryan

zhihui,

I had started a response to this mentioning looking at python-generated JSON as a way to construct gridplots, but of course the way you discovered (which seems obvious in retrospect) is much better. Thank you for taking the time to share your solution.

Bryan

···

On Apr 15, 2015, at 4:44 AM, zhihui <zhihui.liu.0608@gmail.com> wrote:

I managed to figure out one way to do that, below is the code snippet which works for me.

....

p1 = $.fn.bokeh("figure", {
  options: _.extend({title: 'Example (1)'}, options)
  glyphs: [glyph]
  guides: [xaxis, yaxis]
  tools: ["Pan", "WheelZoom" ,"Resize", "Resize", "PreviewSave"]
})

p2 = $.fn.bokeh("figure", {
  options: _.extend({title: 'Example (2)'}, options)
  glyphs: [glyph]
  guides: [xaxis, yaxis]
  tools: ["Pan", "WheelZoom" ,"Resize", "Resize", "PreviewSave"]
})

pgrid = Bokeh.Collections('GridPlot').create({
                   children: [[p1, p2]],
                   toolbar_location : 'above',
})

show = (target, plot) ->
    myrender = () ->
      view = new plot.default_view(model: plot)
      target.append(view.$el)
    _.defer(myrender)

show($("#bkplot"), pgrid)

在 2015年4月11日星期六 UTC+8下午11:47:13,zhihui写道:
I'm looking for ways to arrange multiple sub-plots using gridplot, not sure if anyone knows how to do that via BokehJS in a webpage. Can you please kindly give an example ?

--
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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/593dacc7-cfb1-46da-8413-3b4ecfe22040%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post

End of archived discussion · Replies are disabled