# リスト7.6.1:図のサイズの設定
from bokeh.plotting import figure, output_notebook, show
output_notebook()
p = figure(plot_width=400, plot_height=200)
show(p)
# リスト7.6.2:図の背景色の設定
p = figure(
plot_width=200,
plot_height=200,
background_fill_color="red",
background_fill_alpha=0.5,
)
show(p)
# リスト7.6.3:余白の設定
p = figure(
plot_width=200, plot_height=200, border_fill_color="red", border_fill_alpha=0.5
)
p.min_border = 10
show(p)
# リスト7.6.4:個別に余白を変更
p = figure(plot_width=200, plot_height=200)
p.border_fill_color = "red"
p.min_border_left = 20
p.min_border_right = 60
p.min_border_top = 30
p.min_border_bottom = 50
show(p)
# リスト7.6.5:図の外枠の設定
p = figure(plot_width=200, plot_height=200)
p.outline_line_width = 10
p.outline_line_color = "red"
p.outline_line_alpha = 0.5
p.outline_line_dash = (5, 20)
p.outline_line_cap = "round"
show(p)
# リスト7.6.6:タイトルの設定 (その1)
p = figure(plot_width=200, plot_height=200, title="Title")
show(p)
# リスト7.6.7:タイトルの設定 (その2)
p = figure(plot_width=200, plot_height=200)
p.title.text = "Title"
show(p)
# リスト7.6.8:タイトルの水平位置の設定
p = figure(plot_width=200, plot_height=200, title="Title")
p.title.align = "center"
show(p)
# リスト7.6.9:タイトルの書式
p = figure(plot_width=200, plot_height=200, title="Title")
p.title.text_font = "times"
p.title.text_font_size = "20pt"
p.title.text_font_style = "bold"
p.title.text_color = "red"
p.title.text_alpha = 0.5
show(p)