Bar chart via load_static doesn't respect width/height arguments

I am using load_static to plot a bar chart:

plot = Bar(df, label=x, values=y, title=‘some title’, color=‘green’, width=40, height=40)

script_path = os.path.join(‘static’, ‘js’, ‘bokeh.js’)

js, tag = autoload_static(plot, CDN, script_path)

The chart is successfully embedded but the size doesn’t change when I alter the “width” and “height” attributes to say 400, 400. The embedded JS sits inside of a class-less

tag.

Hi,

What version are you using? Width and Height have been deprecated in favor of the more consistent plot_width and plot_height since 0.11 and will be removed soon. I’m not entirely sure but IIRC width and height may have been broken … As a quick try (not knowing your version) you could try either:

  1. Use plot_width=40, plot_height

  2. Set plot.width and plot.height after you have initialized your plot

Hope this helps

Best

Fabio

···

On Wed, Apr 27, 2016 at 1:39 PM, [email protected] wrote:

I am using load_static to plot a bar chart:

plot = Bar(df, label=x, values=y, title=‘some title’, color=‘green’, width=40, height=40)

script_path = os.path.join(‘static’, ‘js’, ‘bokeh.js’)

js, tag = autoload_static(plot, CDN, script_path)

The chart is successfully embedded but the size doesn’t change when I alter the “width” and “height” attributes to say 400, 400. The embedded JS sits inside of a class-less

tag.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/42a85ecc-47ac-461d-90c8-8882452d58a7%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Fabio Pliger

Senior Software Engineer, Bokeh

I am using v0.11. Using plot_width solved the problem. Thanks!

···

On Wednesday, April 27, 2016 at 2:56:15 PM UTC-4, Fabio Pliger wrote:

Hi,

What version are you using? Width and Height have been deprecated in favor of the more consistent plot_width and plot_height since 0.11 and will be removed soon. I’m not entirely sure but IIRC width and height may have been broken … As a quick try (not knowing your version) you could try either:

  1. Use plot_width=40, plot_height
  1. Set plot.width and plot.height after you have initialized your plot

Hope this helps

Best

Fabio

On Wed, Apr 27, 2016 at 1:39 PM, [email protected] wrote:

I am using load_static to plot a bar chart:

plot = Bar(df, label=x, values=y, title=‘some title’, color=‘green’, width=40, height=40)

script_path = os.path.join(‘static’, ‘js’, ‘bokeh.js’)

js, tag = autoload_static(plot, CDN, script_path)

The chart is successfully embedded but the size doesn’t change when I alter the “width” and “height” attributes to say 400, 400. The embedded JS sits inside of a class-less

tag.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/42a85ecc-47ac-461d-90c8-8882452d58a7%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.


Fabio Pliger

Senior Software Engineer, Bokeh