http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#
使用Palettes
Palettes储存了一系列RGBA值来设置颜色地图。
>>> from bokeh.palettes import Spectral6
>>> Spectral6
['#3288bd', '#99d594', '#e6f598', '#fee08b', '#fc8d59', '#d53e4f']
可视化调色板
- line properties line color, width, etc.
- fill properties fill color, alpha, etc.
- text properties font styles, colors, etc.
Line Properties
- line_color
- line_width
- line_alpha
- line_join
- line_cap
- line_dash
- line_dash_offset
Fill Properties
- fill_color
- fill_alpha
Text Properties
- text_font
- text_font_size
- text_font_style
- text_color
- text_alpha
- text_align
- text_baseline
Visible Property
Specifying Colors
Styling Arrow Annotations
Selecting Plot Objects(选择做图对象)
Plots
Plot objects themselves have many visual characteristics that can be styled: the dimensions of the plot, backgrounds, borders, outlines, etc.
Dimensions
Responsive Dimensions
Title
from bokeh.plotting import figure, output_file, show
output_file("title.html")
p = figure(plot_width=400, plot_height=400, title="Some Title")
p.title.text_color = "olive"
p.title.text_font = "times"
p.title.text_font_style = "italic"
p.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=10)
show(p)
Background
from bokeh.plotting import figure, output_file, show
output_file("background.html")
p = figure(plot_width=400, plot_height=400)
p.background_fill_color = "beige"
p.background_fill_alpha = 0.5
p.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=10)
show(p)