Skip to content Skip to sidebar Skip to footer

Center Embedded Bokeh Plot

How can I center an embedded Bokeh plot? My css seems to have no effect on Bokeh's
. In the minimal example below, I want the plot to be at the center of

Solution 1:

With Bokeh 0.11.1 changing to the following works for me:

.bk-plot-wrapper table {
    margin: 0 auto;
}

The issue is the the div.bk-plot-wrapper takes up all the space of the enclosing <div>. But the internal <table> that lays out the plot doesn't. I'm not a CSS expert, but maybe someone else can add more information

Two notes: I'm not sure what version of Bokeh you have, .plotdiv has not been in use for some time. Also please note that some foundational improvements to layout will be landing in 0.12 to make Bokeh much more respponsive and "webby" by default, and so the above code will probably not work with 0.12 (in particular, the <table> is going away).


Solution 2:

<div align="center">put the bokeh plot here</div>

Post a Comment for "Center Embedded Bokeh Plot"