frombokeh.core.enumsimportSizingModefrombokeh.layoutsimportcolumn,rowfrombokeh.modelsimportDiv,Selectfrombokeh.plottingimportfigure,showfrombokeh.sampledata.penguinsimportdatafrombokeh.transformimportfactor_cmapp=figure(sizing_mode="fixed")p.scatter("flipper_length_mm","body_mass_g",source=data,fill_alpha=0.4,size=12,color=factor_cmap('species','Category10_3',data.species.unique()))div=Div(text="Select a sizing mode to see how a plot resizes inside a parent container.")select=Select(title="Sizing mode",value="fixed",options=list(SizingMode),width=300)select.js_link('value',p,'sizing_mode')container=row(p,height=800,sizing_mode="stretch_width")container.stylesheets.append(":host { border: 10px solid grey; }")layout=column(div,select,container)layout.sizing_mode="stretch_both"# set separately to avoid also setting childrenshow(layout)