Change size of Fig in bqplot?

2k Views Asked by At

I'm new to bqplot. Trying to figure out how to resize a figure. I tried both of the following, lightly modifying example code:

fig = Figure(marks=[line], axes=[ax_x, ax_y], title='Security 1')
fig.height = 100

and

fig = Figure(marks=[line], axes=[ax_x, ax_y], title='Security 1', height = 100)

Neither of these is showing any effect. Is there a way to change the size of a bqplot?

3

There are 3 best solutions below

2
On BEST ANSWER

Have you tried the parameters min_width and min_height?

0
On

You can also adjust the margins using fig_margin, ie:

Figure(marks=[graph], fig_margin={'top':30, 'bottom':30, 'left':0, 'right':0})

0
On

Use the layout object. Height must be expressed as a str with either 'px' or '%'. See example below.

fig = Figure(marks=[line], axes=[ax_x, ax_y], title='Security 1')
fig.layout.height = '100px'