Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Bokeh绘图未拉伸以填充剩余空间_Python_Bokeh - Fatal编程技术网

Python Bokeh绘图未拉伸以填充剩余空间

Python Bokeh绘图未拉伸以填充剩余空间,python,bokeh,Python,Bokeh,我试着在bokeh选项卡中展开中间的绘图。 中间的图形构造为: p = figure(tools=['xpan', 'reset', 'save','xwheel_zoom'],x_axis_type='datetime', plot_height=650, plot_width=950, toolbar_location='left', title= "Monthly cashflows roll out") l = layout([ [column(

我试着在bokeh选项卡中展开中间的绘图。 中间的图形构造为:

p = figure(tools=['xpan', 'reset', 'save','xwheel_zoom'],x_axis_type='datetime', plot_height=650, plot_width=950,
            toolbar_location='left', title= "Monthly cashflows roll out")

l = layout([
        [column([inputs, pie]), p, column(cardsVarColumn,cardsStatColumn)]
    ])
我尝试添加
size\u mode='stretch\u both'
但中间的情节仍然没有延伸,以填补剩余的空间,如图所示:


您应该将尺寸调整模式拉伸添加到包含要拉伸以填充剩余空间的绘图的列中

from bokeh.plotting import figure, show
from bokeh.models.widgets import Select, RangeSlider, PreText
from bokeh.layouts import column, row

p1 = figure(plot_width=400, plot_height=400)
p1.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color="navy", alpha=0.5)

p2 = figure(plot_width=400, plot_height=400)
p2.square([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color="olive", alpha=0.5)

select1 = Select(title="Select Variable:", value="Linear equal principal", options=["Linear equal principal", "foo", "bar"])
select2 = Select(title="Currency:", value="EUR", options=["EUR", "USD"])
range_slider = RangeSlider(start=0, end=10, value=(1,9), step=.1, title="Date Range")

pre1 = PreText(text="Total interests CF in a date range", width=300, height=50)
pre2 = PreText(text="Outstanding Principal", width=300, height=50)
pre3 = PreText(text="Number of Loans", width=300, height=50)

show(row(column(select1, select2, range_slider, p1), column(children=[p2], sizing_mode='stretch_both'), column(pre1, pre2, pre3)))

因此,在我的例子中,我应该将
p
plot放入列中,然后使用大小调整模式,还是直接应用大小调整模式?您应该将plot p放入列中,并将大小调整模式设置为拉伸列和拉伸列。我尝试过这样做,但似乎没有改变绘图中的任何内容:
l=layout([[column([inputs,pie])),column(p,sizing_mode='stretch'u both'),column(cardsVarColumn,cardsStatColumn)])
能否将完整的脚本和一些示例数据添加到您的问题中,以便我可以用您的代码进行尝试?请务必提供版本信息。特别是布局在过去几年中经历了多次迭代。如果不知道1.2.0版的bokeh是什么版本,就不可能说出任何有意义的话