I have read most of the documentation on bokeh and many of the examples. All of them contain the default square window. The only example I have seen that is the slightly different is here which has subplots and sets height and width in the creation of a Plot object.
5 Answers
If you've already created the plot, then you can use the bokeh.plotting.curplot()
function to return the "current" plot, and then set its height
and width
attributes. If you are building up a Plot
object using the lower-level interfaces (e.g. the examples in bokeh/examples/glyph/
, then you can just set those attributes directly as well on the plot object or in the Plot()
constructor.
Alternatively, if you are using any of the glyph generation functions in bokeh.plotting
, you can pass the plot_width
and plot_height
keyword arguments, e.g.:
line(x,y, color="#0000FF", tools="pan,wheel_zoom,box_zoom,reset",
name="line_example", plot_width=800, plot_height=300)

- 1,640
- 10
- 14
-
6Just FYI, in bokeh 0.12 i believe you can set this as a keyword in bokeh.plotting.figure() as mentioned below. **However**, the correct keywords are 'width' and 'height', not 'plot_width' and 'plot_height'. Moreover, I believe the value must be an integer, not a float. Since my figure is embedded, and I was tinkering on the server, this took me a while to figure. I could not find this information in their documentation of 'figure()', only an example. Hope it helps. To clarify by way of example: exampleFig = bokeh.plotting.figure(width=200, height=200) – Mackie Messer Jul 21 '16 at 01:33
-
1**module 'bokeh.plotting' has no attribute 'curplot'** I cant find anything about curplot() any help? thank you – mlk Jun 01 '17 at 01:36
You can add the plot_width/plot_height commands to the figure command itself. Notice you can also add the resize tool to the set of tools via resize in the tools keyword var, which can be helpful.
bokeh.plotting.figure(x_axis_type = "datetime",
tools="pan,wheel_zoom,box_zoom,reset,resize,previewsave",plot_width=1000,
name="myplot")

- 7,155
- 8
- 41
- 40
-
This raises `ValueError: unexpected tool name 'resize', similar tools are reset` on bokeh 1.0.1 – kbrose Nov 24 '18 at 16:54
-
Looks like the resize tool was deprecated then removed: https://github.com/bokeh/bokeh/issues/4944. In the .11 series it is found in the default tools : https://github.com/bokeh/bokeh/blob/0.11.1/bokeh/plotting/figure.py Subsequently removed by 1 series – Paul Nov 26 '18 at 20:46
Sorry to answer my own question, this was actually easy.
bokeh.plotting.curplot().plot_height=400
bokeh.plotting.curplot().plot_width=800

- 2,267
- 2
- 19
- 22

- 1,278
- 1
- 9
- 16
-
**module 'bokeh.plotting' has no attribute 'curplot'** I cant find anything about curplot() any help? thank you – mlk Jun 01 '17 at 01:34
-
6curplot() has been deprecated for some time. You can see more information here: http://continuum.io/blog/bokeh-0.7#api-deprecations The API is more explicit now. Basically you keep track of plots (which is much better) you want to act on: p = figure(...); p.circle(...); p.plot_height=400; show(p) – Peter Wang Jun 14 '17 at 21:20
-
1
If you have a figure with name p
you can simply do the following.
p.plot_height=400
p.plot_width=800
(Bokeh version 2.4.3)

- 53
- 6
In version 2.4.2:
An argument named figsize
is there to set the size of the plot.
e.g.
count_df.plot_bokeh(
title="Replenishment Count",
xlabel="Date",
ylabel="Number of Replenishment",
figsize=(1000, 800),
)
NOTE: Only applicable on plot_bokeh
method in dataframes.

- 406
- 5
- 16