2

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?

P-Gn
  • 23,115
  • 9
  • 87
  • 104
helloB
  • 3,472
  • 10
  • 40
  • 87

3 Answers3

3

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'
DougR
  • 3,196
  • 1
  • 28
  • 29
1

Have you tried the parameters min_width and min_height?

Drew
  • 361
  • 2
  • 14
  • My plots are too big so I didn't see the point of those parameters in solving my problem, but you're right, I'll give that try. – helloB May 17 '16 at 18:53
  • It should work, since if you want a large figure, just set the min_height (the minimum height of the Figure) – Drew May 17 '16 at 21:00
0

You can also adjust the margins using fig_margin, ie:

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

Dustin Michels
  • 2,951
  • 2
  • 19
  • 31