bokeh.models.axes¶
Guide renderers for various kinds of axes that can be added to Bokeh plots
-
class
Axis
(**kwargs)[source]¶ Bases:
bokeh.models.renderers.GuideRenderer
A base class that defines common properties for all axis types.
Note
This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.
-
axis_label
¶ property type:
String
A text label for the axis, displayed parallel to the axis rule.
Note
LaTeX notation is not currently supported; please see #647 to track progress or contribute.
-
axis_label_standoff
¶ property type:
Int
The distance in pixels that the axis labels should be offset from the tick labels.
-
axis_label_text_alpha
¶ property type:
NumberSpec
The text alpha of the axis label.
-
axis_label_text_baseline
¶ property type:
Enum
(TextBaseline
)The text baseline of the axis label.
-
axis_label_text_font_size
¶ property type:
FontSizeSpec
The text font size of the axis label.
-
axis_label_text_font_style
¶ property type:
Enum
(FontStyle
)The text font style of the axis label.
-
axis_line_alpha
¶ property type:
NumberSpec
The line alpha of the axis line.
-
axis_line_dash
¶ property type:
DashPattern
The line dash of the axis line.
-
axis_line_width
¶ property type:
NumberSpec
The line width of the axis line.
-
bounds
¶ property type:
Either
(Auto
,Tuple
(Float
,Float
),Tuple
(Datetime
,Datetime
) )Bounds for the rendered axis. If unset, the axis will span the entire plot in the given dimension.
-
fixed_location
¶ property type:
Either
(Float
,String
,Tuple
(String
,String
),Tuple
(String
,String
,String
) )Set to specify a fixed coordinate location to draw the axis. The direction of ticks and major labels is determined by the side panel that the axis belongs to.
Note
Axes labels are suppressed when axes are positioned at fixed locations inside the central plot area.
-
formatter
¶ property type:
Instance
(TickFormatter
)A
TickFormatter
to use for formatting the visual appearance of ticks.
-
major_label_orientation
¶ property type:
Either
(Enum
( Enumeration(horizontal, vertical) ),Float
)What direction the major label text should be oriented. If a number is supplied, the angle of the text is measured from horizontal.
-
major_label_overrides
¶ property type:
Dict
(Either
(Float
,String
),String
)Provide explicit tick label values for specific tick locations that override normal formatting.
-
major_label_standoff
¶ property type:
Int
The distance in pixels that the major tick labels should be offset from the associated ticks.
-
major_label_text_alpha
¶ property type:
NumberSpec
The text alpha of the major tick labels.
-
major_label_text_baseline
¶ property type:
Enum
(TextBaseline
)The text baseline of the major tick labels.
-
major_label_text_font_size
¶ property type:
FontSizeSpec
The text font size of the major tick labels.
-
major_label_text_font_style
¶ property type:
Enum
(FontStyle
)The text font style of the major tick labels.
-
major_tick_in
¶ property type:
Int
The distance in pixels that major ticks should extend into the main plot area.
-
major_tick_line_alpha
¶ property type:
NumberSpec
The line alpha of the major ticks.
-
major_tick_line_dash
¶ property type:
DashPattern
The line dash of the major ticks.
-
major_tick_line_width
¶ property type:
NumberSpec
The line width of the major ticks.
-
major_tick_out
¶ property type:
Int
The distance in pixels that major ticks should extend out of the main plot area.
-
minor_tick_in
¶ property type:
Int
The distance in pixels that minor ticks should extend into the main plot area.
-
minor_tick_line_alpha
¶ property type:
NumberSpec
The line alpha of the minor ticks.
-
minor_tick_line_dash
¶ property type:
DashPattern
The line dash of the minor ticks.
-
minor_tick_line_width
¶ property type:
NumberSpec
The line width of the minor ticks.
-
minor_tick_out
¶ property type:
Int
The distance in pixels that major ticks should extend out of the main plot area.
-
ticker
¶ property type:
Instance
(Ticker
)A Ticker to use for computing locations of axis components.
The property may also be passed a sequence of floating point numbers as a shorthand for creating and configuring a
FixedTicker
, e.g. the following codefrom bokeh.plotting import figure p = figure() p.xaxis.ticker = [10, 20, 37.4]
is equivalent to:
from bokeh.plotting import figure from bokeh.models.tickers import FixedTicker p = figure() p.xaxis.ticker = FixedTicker(ticks=[10, 20, 37.4])
-
-
class
CategoricalAxis
(**kwargs)[source]¶ Bases:
bokeh.models.axes.Axis
An axis that displays ticks and labels for categorical ranges.
The
CategoricalAxis
can handle factor ranges with up to two levels of nesting, including drawing a separator line between top-level groups of factors.-
group_label_orientation
¶ property type:
Either
(Enum
(TickLabelOrientation
),Float
)What direction the group label text should be oriented.
If a number is supplied, the angle of the text is measured from horizontal.
This property always applies to factors in the outermost level of nesting. If the list of categorical factors is flat (i.e. no nesting) then this property has no effect.
-
group_text_align
¶ property type:
Enum
(TextAlign
)The text align of the group categorical labels.
This property always applies to factors in the outermost level of nesting. If the list of categorical factors is flat (i.e. no nesting) then this property has no effect.
-
group_text_alpha
¶ property type:
NumberSpec
The text alpha of the group categorical labels.
This property always applies to factors in the outermost level of nesting. If the list of categorical factors is flat (i.e. no nesting) then this property has no effect.
-
group_text_baseline
¶ property type:
Enum
(TextBaseline
)The text baseline of the group categorical labels.
This property always applies to factors in the outermost level of nesting. If the list of categorical factors is flat (i.e. no nesting) then this property has no effect.
-
group_text_color
¶ property type:
ColorSpec
The text color of the group categorical labels.
This property always applies to factors in the outermost level of nesting. If the list of categorical factors is flat (i.e. no nesting) then this property has no effect.
-
group_text_font
¶ property type:
String
The text font of the group categorical labels.
This property always applies to factors in the outermost level of nesting. If the list of categorical factors is flat (i.e. no nesting) then this property has no effect.
-
group_text_font_size
¶ property type:
FontSizeSpec
The text font size of the group categorical labels.
This property always applies to factors in the outermost level of nesting. If the list of categorical factors is flat (i.e. no nesting) then this property has no effect.
-
group_text_font_style
¶ property type:
Enum
(FontStyle
)The text font style of the group categorical labels.
This property always applies to factors in the outermost level of nesting. If the list of categorical factors is flat (i.e. no nesting) then this property has no effect.
-
group_text_line_height
¶ property type:
Float
The text line height of the group categorical labels.
This property always applies to factors in the outermost level of nesting. If the list of categorical factors is flat (i.e. no nesting) then this property has no effect.
-
separator_line_alpha
¶ property type:
NumberSpec
The line alpha of the separator line between top-level categorical groups.
This property always applies to factors in the outermost level of nesting.
-
separator_line_cap
¶ property type:
Enum
(LineCap
)The line cap of the separator line between top-level categorical groups.
This property always applies to factors in the outermost level of nesting.
-
separator_line_color
¶ property type:
ColorSpec
The line color of the separator line between top-level categorical groups.
This property always applies to factors in the outermost level of nesting.
-
separator_line_dash
¶ property type:
DashPattern
The line dash of the separator line between top-level categorical groups.
This property always applies to factors in the outermost level of nesting.
-
separator_line_dash_offset
¶ property type:
Int
The line dash offset of the separator line between top-level categorical groups.
This property always applies to factors in the outermost level of nesting.
-
separator_line_join
¶ property type:
Enum
(LineJoin
)The line join of the separator line between top-level categorical groups.
This property always applies to factors in the outermost level of nesting.
-
separator_line_width
¶ property type:
NumberSpec
The line width of the separator line between top-level categorical groups.
This property always applies to factors in the outermost level of nesting.
-
subgroup_label_orientation
¶ property type:
Either
(Enum
(TickLabelOrientation
),Float
)What direction the subgroup label text should be oriented.
If a number is supplied, the angle of the text is measured from horizontal.
This property always applies to factors in the middle level of nesting. If the list of categorical factors is has only zero or one levels of nesting, then this property has no effect.
-
subgroup_text_align
¶ property type:
Enum
(TextAlign
)The text align of the subgroup categorical labels.
This property always applies to factors in the middle level of nesting. If the list of categorical factors is has only zero or one levels of nesting, then this property has no effect.
-
subgroup_text_alpha
¶ property type:
NumberSpec
The text alpha of the subgroup categorical labels.
This property always applies to factors in the middle level of nesting. If the list of categorical factors is has only zero or one levels of nesting, then this property has no effect.
-
subgroup_text_baseline
¶ property type:
Enum
(TextBaseline
)The text baseline of the subgroup categorical labels.
This property always applies to factors in the middle level of nesting. If the list of categorical factors is has only zero or one levels of nesting, then this property has no effect.
-
subgroup_text_color
¶ property type:
ColorSpec
The text color of the subgroup categorical labels.
This property always applies to factors in the middle level of nesting. If the list of categorical factors is has only zero or one levels of nesting, then this property has no effect.
-
subgroup_text_font
¶ property type:
String
The text font of the subgroup categorical labels.
This property always applies to factors in the middle level of nesting. If the list of categorical factors is has only zero or one levels of nesting, then this property has no effect.
-
subgroup_text_font_size
¶ property type:
FontSizeSpec
The text font size of the subgroup categorical labels.
This property always applies to factors in the middle level of nesting. If the list of categorical factors is has only zero or one levels of nesting, then this property has no effect.
-
-
class
ContinuousAxis
(**kwargs)[source]¶ Bases:
bokeh.models.axes.Axis
A base class for all numeric, non-categorical axes types.
Note
This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.
-
class
DatetimeAxis
(**kwargs)[source]¶ Bases:
bokeh.models.axes.LinearAxis
A
LinearAxis
that picks nice numbers for tick locations on a datetime scale. Configured with aDatetimeTickFormatter
by default.
-
class
LinearAxis
(**kwargs)[source]¶ Bases:
bokeh.models.axes.ContinuousAxis
An axis that picks nice numbers for tick locations on a linear scale. Configured with a
BasicTickFormatter
by default.
-
class
LogAxis
(**kwargs)[source]¶ Bases:
bokeh.models.axes.ContinuousAxis
An axis that picks nice numbers for tick locations on a log scale. Configured with a
LogTickFormatter
by default.
-
class
MercatorAxis
(dimension='lat', **kw)[source]¶ Bases:
bokeh.models.axes.LinearAxis
An axis that picks nice numbers for tick locations on a Mercator scale. Configured with a
MercatorTickFormatter
by default.Parameters: dimension ('lat' or 'lon', optional) – Whether this axis will display latitude or longitude values. (default: ‘lat’)