散景标题间距

时间:2017-05-13 05:52:54

标签: python heatmap bokeh spacing

我正在寻找一种方法来缩小Bokeh图中的间距,这是我在HeatMap中制作的Bokeh

enter image description here

我希望标题更接近情节,但我还没有找到这样做的方法。 ¿有关如何解决这个问题的想法吗?

这是我的代码:

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)

0 个答案:

没有答案