Search code examples
pythonbokehfigure

Removing padding or margins from Bokeh Figures


is it possible to get rid of the padding (or margin) on the sides of bokeh figures? I've been looking at various figures and they all seem to have this blank area to their left. I also tried changing the borders for example: s1.min_border_left = 0 or change it to s1.min_border_left = 40

but it doesn't seem to do the job, it changes the border but somehow it seems that there is a padding that is fixed and not changable, an example of the area i'd like to get rid of: Image example so is it possible to get rid of that and just have the figure stick to the left side of the browser?

Bokeh Figures and Borders


Solution

  • If using the bokeh server, you can add an external css sheet with something like this to modify the margins.

    html, body {
        display: block;
        margin: 0 auto;
        width: 99%;
    }