Python 博克标题间距

Python 博克标题间距,python,heatmap,bokeh,spacing,Python,Heatmap,Bokeh,Spacing,我正在寻找一种减少Bokeh图中间距的方法,这是我在Bokeh中制作的热图: 我希望标题更接近情节,但我还没有找到这样做的方法。有什么办法解决这个问题吗 这是我的密码: from bokeh.io import output_file from bokeh.io import show from bokeh.models import ( ColumnDataSource, HoverTool, LinearColorMapper ) from bokeh.plotti

我正在寻找一种减少
Bokeh
图中间距的方法,这是我在
Bokeh
中制作的
热图:

我希望标题更接近情节,但我还没有找到这样做的方法。有什么办法解决这个问题吗

这是我的密码:

from bokeh.io import output_file
from bokeh.io import show
from bokeh.models import (
    ColumnDataSource,
    HoverTool,
    LinearColorMapper
)
from bokeh.plotting import figure

output_file('test.html', mode='inline')

source = ColumnDataSource(RandomData)
TOOLS = "hover,save"

# Creating the Figure
HM = figure(title="HeatMap", 
       x_range=[str(i) for i in range(1,32)], 
       y_range=[str(i) for i in range(1643,1600,-1)]+[str(i) for i in range(6043,6000,-1)],
       x_axis_location="above", plot_width=500, plot_height=970,
       tools=TOOLS, toolbar_location='right')

# Figure Styling
HM.grid.grid_line_color = None

HM.axis.axis_line_color = None
HM.axis.major_tick_line_color = None
HM.axis.major_label_text_font_size = "7pt"
HM.axis.major_label_text_alpha = 0.5
HM.axis.major_label_standoff = 0

HM.toolbar.logo = None

HM.title.text_font = 'century gothic'
HM.title.text_font_size = '14pt'
HM.title.text_font_style = 'normal'
HM.title.text_color = '#6a94d8'
HM.title_location = 'below'
HM.title.align = 'center'

# Color Mapping
mapper = LinearColorMapper(palette='Blues9', low=RandomData.Total.max(),
         high=RandomData.Total.min())

# Creating the Glyphs
HM.rect(x='XData', y="YData", width=1, height=1,source=source,
         fill_color={'field': 'Total','transform': mapper},line_alpha=0.05)

show(HM)

到目前为止你试过什么?展示你的作品。只是为了确保@Soviut的IMO合理评论没有被误解(我第一眼就这么做了):这不是一个代码审查网站,所以你查找的概念或最接近你目标的内容(不是一些源代码)。bokeh有一个非常好的、易于导航的参考指南,只需从绘制图形开始,然后向上移动到general
Plot
类,找到属性
title\u location
,然后自己写一个答案或修改问题。