Bokeh 风格属性设置

xiaoxiao2021-02-28  114

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_colorline_widthline_alphaline_joinline_capline_dashline_dash_offset

Fill Properties

fill_colorfill_alpha

Text Properties

text_fonttext_font_sizetext_font_styletext_colortext_alphatext_aligntext_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)

Border

Outline

Glyphs

Selected and Unselected Glyphs

Hover Inspections

Tool Overlays

Axes

Labels

Bounds

Tick Locations

Tick Lines

Tick Label Formats

Tick Label Orientation

Grids

Lines

Minor Lines

Bands

Bounds

Legends

Location

Orientation

Label Text

Border

Background

Dimensions

转载请注明原文地址: https://www.6miu.com/read-60940.html

最新回复(0)