Resetting plots does not respect specified plot dimensions.

I made a bunch of BoxPlots, and specified their height and width. Code below.


b1 = BoxPlot(data=source, label='Cover_Type', values='Elevation', color='Cover_Type', height=250, width=300, legend=False)

b2 = BoxPlot(data=source, label='Cover_Type', values='Aspect', color='Cover_Type', height=250, width=300, legend=False)

b3 = BoxPlot(data=source, label='Cover_Type', values='Slope', color='Cover_Type', height=250, width=300, legend=False)

layout = row(b1, b2, b3)

show(layout)

They display just fine. However, when I click on the “Reset” tool, the plots dimensions change to something larger than the specified height and width, disrupting the plot arrangement.

This is reproducible using the autompg dataset:


from bokeh.charts import BoxPlot, output_file, show, hplot

box = BoxPlot(df, values='mpg', label='cyl', title="Auto MPG Box Plot", width=400)

box2 = BoxPlot(df, values='mpg', label='cyl', color='cyl',

title="MPG Box Plot by Cylinder Count", width=400)

output_file('box.html')

show(hplot(box, box2))

I am using the latest (non-dev) version of Bokeh, in the Jupyter notebook.

I think this is a bug, but I wasn’t sure if this was an intentional design?

shouldn’t it be plot_height and plot_width instead of height and width?

Not sure for BoxPlot but for Figure objects the reset tool resets the plot size to the default plot_height and plot_width, which are set to 600, and not to “height” and “width”.

···

Le mercredi 11 janvier 2017 21:12:00 UTC-5, EM a écrit :

I made a bunch of BoxPlots, and specified their height and width. Code below.

b1 = BoxPlot(data=source, label=‘Cover_Type’, values=‘Elevation’, color=‘Cover_Type’, height=250, width=300, legend=False)

b2 = BoxPlot(data=source, label=‘Cover_Type’, values=‘Aspect’, color=‘Cover_Type’, height=250, width=300, legend=False)

b3 = BoxPlot(data=source, label=‘Cover_Type’, values=‘Slope’, color=‘Cover_Type’, height=250, width=300, legend=False)

layout = row(b1, b2, b3)

show(layout)

They display just fine. However, when I click on the “Reset” tool, the plots dimensions change to something larger than the specified height and width, disrupting the plot arrangement.

This is reproducible using the autompg dataset:

from bokeh.charts import BoxPlot, output_file, show, hplot

box = BoxPlot(df, values=‘mpg’, label=‘cyl’, title=“Auto MPG Box Plot”, width=400)

box2 = BoxPlot(df, values=‘mpg’, label=‘cyl’, color=‘cyl’,

title=“MPG Box Plot by Cylinder Count”, width=400)

output_file(‘box.html’)

show(hplot(box, box2))

I am using the latest (non-dev) version of Bokeh, in the Jupyter notebook.

I think this is a bug, but I wasn’t sure if this was an intentional design?

Many thanks, Sebastian! You were right, I should be setting “plot_width” and “plot_height”.

···

On Wednesday, January 11, 2017 at 10:30:43 PM UTC-5, [email protected] wrote:

shouldn’t it be plot_height and plot_width instead of height and width?

Not sure for BoxPlot but for Figure objects the reset tool resets the plot size to the default plot_height and plot_width, which are set to 600, and not to “height” and “width”.

Le mercredi 11 janvier 2017 21:12:00 UTC-5, EM a écrit :

I made a bunch of BoxPlots, and specified their height and width. Code below.

b1 = BoxPlot(data=source, label=‘Cover_Type’, values=‘Elevation’, color=‘Cover_Type’, height=250, width=300, legend=False)

b2 = BoxPlot(data=source, label=‘Cover_Type’, values=‘Aspect’, color=‘Cover_Type’, height=250, width=300, legend=False)

b3 = BoxPlot(data=source, label=‘Cover_Type’, values=‘Slope’, color=‘Cover_Type’, height=250, width=300, legend=False)

layout = row(b1, b2, b3)

show(layout)

They display just fine. However, when I click on the “Reset” tool, the plots dimensions change to something larger than the specified height and width, disrupting the plot arrangement.

This is reproducible using the autompg dataset:

from bokeh.charts import BoxPlot, output_file, show, hplot

box = BoxPlot(df, values=‘mpg’, label=‘cyl’, title=“Auto MPG Box Plot”, width=400)

box2 = BoxPlot(df, values=‘mpg’, label=‘cyl’, color=‘cyl’,

title=“MPG Box Plot by Cylinder Count”, width=400)

output_file(‘box.html’)

show(hplot(box, box2))

I am using the latest (non-dev) version of Bokeh, in the Jupyter notebook.

I think this is a bug, but I wasn’t sure if this was an intentional design?