bokeh.models.axes
¶Guide renderers for various kinds of axes that can be added to Bokeh plots
Axis
(**kwargs)¶Bases: bokeh.models.renderers.GuideRenderer
A base class that defines common properties for all axis types.
Axis
is not generally 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 issue 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_align
¶property type: Enum
(‘left’, ‘right’, ‘center’)
The text align of the axis label.
axis_label_text_alpha
¶property type: NumberSpec
(1.0)
The text alpha of the axis label.
axis_label_text_baseline
¶property type: Enum
(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)
The text baseline of the axis label.
axis_label_text_color
¶property type: ColorSpec
(‘#444444’)
The text color of the axis label.
axis_label_text_font_size
¶property type: FontSizeSpec
(‘12pt’)
The text font size of the axis label.
axis_label_text_font_style
¶property type: Enum
(‘normal’, ‘italic’, ‘bold’)
The text font style of the axis label.
axis_line_alpha
¶property type: NumberSpec
(1.0)
The line alpha of the axis line.
axis_line_color
¶property type: ColorSpec
(‘black’)
The line color of the axis line.
axis_line_dash
¶property type: DashPattern
The line dash of the axis line.
axis_line_width
¶property type: NumberSpec
(1)
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.
formatter
¶property type: Instance
(TickFormatter)
A TickFormatter to use for formatting the visual appearance of ticks.
location
¶property type: Either
(Auto
, Enum
(‘above’, ‘below’, ‘left’, ‘right’))
Where should labels and ticks be located in relation to the axis rule.
major_label_orientation
¶property type: Either
(Enum
(‘horizontal’, ‘vertical’), Float
)
What direction the major label text should be oriented. If a i number is supplied, the angle of the text is measured from horizontal.
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_align
¶property type: Enum
(‘left’, ‘right’, ‘center’)
The text align of the major tick labels.
major_label_text_alpha
¶property type: NumberSpec
(1.0)
The text alpha of the major tick labels.
major_label_text_baseline
¶property type: Enum
(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)
The text baseline of the major tick labels.
major_label_text_color
¶property type: ColorSpec
(‘#444444’)
The text color of the major tick labels.
major_label_text_font_size
¶property type: FontSizeSpec
(‘12pt’)
The text font size of the major tick labels.
major_label_text_font_style
¶property type: Enum
(‘normal’, ‘italic’, ‘bold’)
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
(1.0)
The line alpha of the major ticks.
major_tick_line_cap
¶property type: Enum
(‘butt’, ‘round’, ‘square’)
The line cap of the major ticks.
major_tick_line_color
¶property type: ColorSpec
(‘black’)
The line color of the major ticks.
major_tick_line_dash
¶property type: DashPattern
The line dash of the major ticks.
major_tick_line_join
¶property type: Enum
(‘miter’, ‘round’, ‘bevel’)
The line join of the major ticks.
major_tick_line_width
¶property type: NumberSpec
(1)
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
(1.0)
The line alpha of the minor ticks.
minor_tick_line_cap
¶property type: Enum
(‘butt’, ‘round’, ‘square’)
The line cap of the minor ticks.
minor_tick_line_color
¶property type: ColorSpec
(‘black’)
The line color of the minor ticks.
minor_tick_line_dash
¶property type: DashPattern
The line dash of the minor ticks.
minor_tick_line_join
¶property type: Enum
(‘miter’, ‘round’, ‘bevel’)
The line join of the minor ticks.
minor_tick_line_width
¶property type: NumberSpec
(1)
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.
[
{
"attributes": {
"axis_label": null,
"axis_label_standoff": null,
"axis_label_text_align": "left",
"axis_label_text_alpha": {
"value": 1.0
},
"axis_label_text_baseline": "bottom",
"axis_label_text_color": {
"value": "#444444"
},
"axis_label_text_font": "Helvetica",
"axis_label_text_font_size": {
"field": "12pt"
},
"axis_label_text_font_style": "normal",
"axis_line_alpha": {
"value": 1.0
},
"axis_line_cap": "butt",
"axis_line_color": {
"value": "black"
},
"axis_line_dash": [],
"axis_line_dash_offset": 0,
"axis_line_join": "miter",
"axis_line_width": {
"value": 1
},
"bounds": "auto",
"doc": null,
"formatter": null,
"id": "369d446a-25f4-42c1-88aa-2ddcffbead50",
"location": "auto",
"major_label_orientation": "horizontal",
"major_label_standoff": null,
"major_label_text_align": "left",
"major_label_text_alpha": {
"value": 1.0
},
"major_label_text_baseline": "bottom",
"major_label_text_color": {
"value": "#444444"
},
"major_label_text_font": "Helvetica",
"major_label_text_font_size": {
"field": "12pt"
},
"major_label_text_font_style": "normal",
"major_tick_in": null,
"major_tick_line_alpha": {
"value": 1.0
},
"major_tick_line_cap": "butt",
"major_tick_line_color": {
"value": "black"
},
"major_tick_line_dash": [],
"major_tick_line_dash_offset": 0,
"major_tick_line_join": "miter",
"major_tick_line_width": {
"value": 1
},
"major_tick_out": null,
"minor_tick_in": null,
"minor_tick_line_alpha": {
"value": 1.0
},
"minor_tick_line_cap": "butt",
"minor_tick_line_color": {
"value": "black"
},
"minor_tick_line_dash": [],
"minor_tick_line_dash_offset": 0,
"minor_tick_line_join": "miter",
"minor_tick_line_width": {
"value": 1
},
"minor_tick_out": null,
"name": null,
"plot": null,
"tags": [],
"ticker": null,
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "369d446a-25f4-42c1-88aa-2ddcffbead50",
"type": "Axis"
}
]
CategoricalAxis
(ticker=None, formatter=None, **kwargs)¶Bases: bokeh.models.axes.Axis
An axis that picks evenly spaced tick locations for a collection of categories/factors.
[
{
"attributes": {
"doc": null,
"id": "8f0e3a54-9727-4c05-928a-6279ba5ab13d",
"name": null,
"tags": []
},
"id": "8f0e3a54-9727-4c05-928a-6279ba5ab13d",
"type": "CategoricalTickFormatter"
},
{
"attributes": {
"axis_label": null,
"axis_label_standoff": null,
"axis_label_text_align": "left",
"axis_label_text_alpha": {
"value": 1.0
},
"axis_label_text_baseline": "bottom",
"axis_label_text_color": {
"value": "#444444"
},
"axis_label_text_font": "Helvetica",
"axis_label_text_font_size": {
"field": "12pt"
},
"axis_label_text_font_style": "normal",
"axis_line_alpha": {
"value": 1.0
},
"axis_line_cap": "butt",
"axis_line_color": {
"value": "black"
},
"axis_line_dash": [],
"axis_line_dash_offset": 0,
"axis_line_join": "miter",
"axis_line_width": {
"value": 1
},
"bounds": "auto",
"doc": null,
"formatter": {
"id": "8f0e3a54-9727-4c05-928a-6279ba5ab13d",
"type": "CategoricalTickFormatter"
},
"id": "2e89d438-8f95-4ce5-bab8-e573870b06e9",
"location": "auto",
"major_label_orientation": "horizontal",
"major_label_standoff": null,
"major_label_text_align": "left",
"major_label_text_alpha": {
"value": 1.0
},
"major_label_text_baseline": "bottom",
"major_label_text_color": {
"value": "#444444"
},
"major_label_text_font": "Helvetica",
"major_label_text_font_size": {
"field": "12pt"
},
"major_label_text_font_style": "normal",
"major_tick_in": null,
"major_tick_line_alpha": {
"value": 1.0
},
"major_tick_line_cap": "butt",
"major_tick_line_color": {
"value": "black"
},
"major_tick_line_dash": [],
"major_tick_line_dash_offset": 0,
"major_tick_line_join": "miter",
"major_tick_line_width": {
"value": 1
},
"major_tick_out": null,
"minor_tick_in": null,
"minor_tick_line_alpha": {
"value": 1.0
},
"minor_tick_line_cap": "butt",
"minor_tick_line_color": {
"value": "black"
},
"minor_tick_line_dash": [],
"minor_tick_line_dash_offset": 0,
"minor_tick_line_join": "miter",
"minor_tick_line_width": {
"value": 1
},
"minor_tick_out": null,
"name": null,
"plot": null,
"tags": [],
"ticker": {
"id": "15441533-a3ef-4e88-99e7-9bae1a43c491",
"type": "CategoricalTicker"
},
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "2e89d438-8f95-4ce5-bab8-e573870b06e9",
"type": "CategoricalAxis"
},
{
"attributes": {
"desired_num_ticks": 6,
"doc": null,
"id": "15441533-a3ef-4e88-99e7-9bae1a43c491",
"name": null,
"num_minor_ticks": 5,
"tags": []
},
"id": "15441533-a3ef-4e88-99e7-9bae1a43c491",
"type": "CategoricalTicker"
}
]
ContinuousAxis
(**kwargs)¶Bases: bokeh.models.axes.Axis
A base class for all numeric, non-categorica axes types.
ContinuousAxis
is not generally useful to instantiate on its own.
[
{
"attributes": {
"axis_label": null,
"axis_label_standoff": null,
"axis_label_text_align": "left",
"axis_label_text_alpha": {
"value": 1.0
},
"axis_label_text_baseline": "bottom",
"axis_label_text_color": {
"value": "#444444"
},
"axis_label_text_font": "Helvetica",
"axis_label_text_font_size": {
"field": "12pt"
},
"axis_label_text_font_style": "normal",
"axis_line_alpha": {
"value": 1.0
},
"axis_line_cap": "butt",
"axis_line_color": {
"value": "black"
},
"axis_line_dash": [],
"axis_line_dash_offset": 0,
"axis_line_join": "miter",
"axis_line_width": {
"value": 1
},
"bounds": "auto",
"doc": null,
"formatter": null,
"id": "59dc2658-cd95-4f4d-b69d-597ae5629508",
"location": "auto",
"major_label_orientation": "horizontal",
"major_label_standoff": null,
"major_label_text_align": "left",
"major_label_text_alpha": {
"value": 1.0
},
"major_label_text_baseline": "bottom",
"major_label_text_color": {
"value": "#444444"
},
"major_label_text_font": "Helvetica",
"major_label_text_font_size": {
"field": "12pt"
},
"major_label_text_font_style": "normal",
"major_tick_in": null,
"major_tick_line_alpha": {
"value": 1.0
},
"major_tick_line_cap": "butt",
"major_tick_line_color": {
"value": "black"
},
"major_tick_line_dash": [],
"major_tick_line_dash_offset": 0,
"major_tick_line_join": "miter",
"major_tick_line_width": {
"value": 1
},
"major_tick_out": null,
"minor_tick_in": null,
"minor_tick_line_alpha": {
"value": 1.0
},
"minor_tick_line_cap": "butt",
"minor_tick_line_color": {
"value": "black"
},
"minor_tick_line_dash": [],
"minor_tick_line_dash_offset": 0,
"minor_tick_line_join": "miter",
"minor_tick_line_width": {
"value": 1
},
"minor_tick_out": null,
"name": null,
"plot": null,
"tags": [],
"ticker": null,
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "59dc2658-cd95-4f4d-b69d-597ae5629508",
"type": "ContinuousAxis"
}
]
DatetimeAxis
(ticker=None, formatter=None, **kwargs)¶Bases: bokeh.models.axes.LinearAxis
An LinearAxis that picks nice numbers for tick locations on
a datetime scale. Configured with a DatetimeTickFormatter
by
default.
[
{
"attributes": {
"axis_label": "date",
"axis_label_standoff": null,
"axis_label_text_align": "left",
"axis_label_text_alpha": {
"value": 1.0
},
"axis_label_text_baseline": "bottom",
"axis_label_text_color": {
"value": "#444444"
},
"axis_label_text_font": "Helvetica",
"axis_label_text_font_size": {
"field": "12pt"
},
"axis_label_text_font_style": "normal",
"axis_line_alpha": {
"value": 1.0
},
"axis_line_cap": "butt",
"axis_line_color": {
"value": "black"
},
"axis_line_dash": [],
"axis_line_dash_offset": 0,
"axis_line_join": "miter",
"axis_line_width": {
"value": 1
},
"bounds": "auto",
"char_width": 10,
"doc": null,
"fill_ratio": 0.3,
"formatter": {
"id": "d9513176-a5b4-408d-b233-4ef423542952",
"type": "DatetimeTickFormatter"
},
"id": "b6a0bcef-0185-4af0-9922-25417d0a51c2",
"location": "auto",
"major_label_orientation": "horizontal",
"major_label_standoff": null,
"major_label_text_align": "left",
"major_label_text_alpha": {
"value": 1.0
},
"major_label_text_baseline": "bottom",
"major_label_text_color": {
"value": "#444444"
},
"major_label_text_font": "Helvetica",
"major_label_text_font_size": {
"field": "12pt"
},
"major_label_text_font_style": "normal",
"major_tick_in": null,
"major_tick_line_alpha": {
"value": 1.0
},
"major_tick_line_cap": "butt",
"major_tick_line_color": {
"value": "black"
},
"major_tick_line_dash": [],
"major_tick_line_dash_offset": 0,
"major_tick_line_join": "miter",
"major_tick_line_width": {
"value": 1
},
"major_tick_out": null,
"minor_tick_in": null,
"minor_tick_line_alpha": {
"value": 1.0
},
"minor_tick_line_cap": "butt",
"minor_tick_line_color": {
"value": "black"
},
"minor_tick_line_dash": [],
"minor_tick_line_dash_offset": 0,
"minor_tick_line_join": "miter",
"minor_tick_line_width": {
"value": 1
},
"minor_tick_out": null,
"name": null,
"num_labels": 8,
"plot": null,
"scale": "time",
"tags": [],
"ticker": {
"id": "63e83aac-e378-4327-8db3-c65c2295d987",
"type": "DatetimeTicker"
},
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "b6a0bcef-0185-4af0-9922-25417d0a51c2",
"type": "DatetimeAxis"
},
{
"attributes": {
"doc": null,
"formats": {},
"id": "d9513176-a5b4-408d-b233-4ef423542952",
"name": null,
"tags": []
},
"id": "d9513176-a5b4-408d-b233-4ef423542952",
"type": "DatetimeTickFormatter"
},
{
"attributes": {
"desired_num_ticks": 6,
"doc": null,
"id": "63e83aac-e378-4327-8db3-c65c2295d987",
"name": null,
"num_minor_ticks": 5,
"tags": []
},
"id": "63e83aac-e378-4327-8db3-c65c2295d987",
"type": "DatetimeTicker"
}
]
LinearAxis
(ticker=None, formatter=None, **kwargs)¶Bases: bokeh.models.axes.ContinuousAxis
An axis that picks nice numbers for tick locations on a
linear scale. Configured with a BasicTickFormatter
by default.
[
{
"attributes": {
"doc": null,
"id": "8a1a99ae-cbf4-4fb7-92b9-898d2d62aadf",
"name": null,
"power_limit_high": 5,
"power_limit_low": -3,
"precision": "auto",
"tags": [],
"use_scientific": true
},
"id": "8a1a99ae-cbf4-4fb7-92b9-898d2d62aadf",
"type": "BasicTickFormatter"
},
{
"attributes": {
"base": 10.0,
"desired_num_ticks": 6,
"doc": null,
"id": "681337f1-d6a1-45f2-abb6-d904b5661d0f",
"mantissas": [
2,
5,
10
],
"max_interval": 100.0,
"min_interval": 0.0,
"name": null,
"num_minor_ticks": 5,
"tags": []
},
"id": "681337f1-d6a1-45f2-abb6-d904b5661d0f",
"type": "BasicTicker"
},
{
"attributes": {
"axis_label": null,
"axis_label_standoff": null,
"axis_label_text_align": "left",
"axis_label_text_alpha": {
"value": 1.0
},
"axis_label_text_baseline": "bottom",
"axis_label_text_color": {
"value": "#444444"
},
"axis_label_text_font": "Helvetica",
"axis_label_text_font_size": {
"field": "12pt"
},
"axis_label_text_font_style": "normal",
"axis_line_alpha": {
"value": 1.0
},
"axis_line_cap": "butt",
"axis_line_color": {
"value": "black"
},
"axis_line_dash": [],
"axis_line_dash_offset": 0,
"axis_line_join": "miter",
"axis_line_width": {
"value": 1
},
"bounds": "auto",
"doc": null,
"formatter": {
"id": "8a1a99ae-cbf4-4fb7-92b9-898d2d62aadf",
"type": "BasicTickFormatter"
},
"id": "984e51ca-5703-42c2-9950-3dfd78c7b756",
"location": "auto",
"major_label_orientation": "horizontal",
"major_label_standoff": null,
"major_label_text_align": "left",
"major_label_text_alpha": {
"value": 1.0
},
"major_label_text_baseline": "bottom",
"major_label_text_color": {
"value": "#444444"
},
"major_label_text_font": "Helvetica",
"major_label_text_font_size": {
"field": "12pt"
},
"major_label_text_font_style": "normal",
"major_tick_in": null,
"major_tick_line_alpha": {
"value": 1.0
},
"major_tick_line_cap": "butt",
"major_tick_line_color": {
"value": "black"
},
"major_tick_line_dash": [],
"major_tick_line_dash_offset": 0,
"major_tick_line_join": "miter",
"major_tick_line_width": {
"value": 1
},
"major_tick_out": null,
"minor_tick_in": null,
"minor_tick_line_alpha": {
"value": 1.0
},
"minor_tick_line_cap": "butt",
"minor_tick_line_color": {
"value": "black"
},
"minor_tick_line_dash": [],
"minor_tick_line_dash_offset": 0,
"minor_tick_line_join": "miter",
"minor_tick_line_width": {
"value": 1
},
"minor_tick_out": null,
"name": null,
"plot": null,
"tags": [],
"ticker": {
"id": "681337f1-d6a1-45f2-abb6-d904b5661d0f",
"type": "BasicTicker"
},
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "984e51ca-5703-42c2-9950-3dfd78c7b756",
"type": "LinearAxis"
}
]
LogAxis
(ticker=None, formatter=None, **kwargs)¶Bases: bokeh.models.axes.ContinuousAxis
An axis that picks nice numbers for tick locations on a
log scale. Configured with a LogTickFormatter
by default.
[
{
"attributes": {
"doc": null,
"id": "f56828c1-e9c0-45f7-ba4e-e65e6dc59044",
"name": null,
"tags": [],
"ticker": {
"id": "513c9c8d-27c2-4478-bdfc-e12fb58cbb87",
"type": "LogTicker"
}
},
"id": "f56828c1-e9c0-45f7-ba4e-e65e6dc59044",
"type": "LogTickFormatter"
},
{
"attributes": {
"base": 10.0,
"desired_num_ticks": 6,
"doc": null,
"id": "513c9c8d-27c2-4478-bdfc-e12fb58cbb87",
"mantissas": [
2,
5,
10
],
"max_interval": 100.0,
"min_interval": 0.0,
"name": null,
"num_minor_ticks": 10,
"tags": []
},
"id": "513c9c8d-27c2-4478-bdfc-e12fb58cbb87",
"type": "LogTicker"
},
{
"attributes": {
"axis_label": null,
"axis_label_standoff": null,
"axis_label_text_align": "left",
"axis_label_text_alpha": {
"value": 1.0
},
"axis_label_text_baseline": "bottom",
"axis_label_text_color": {
"value": "#444444"
},
"axis_label_text_font": "Helvetica",
"axis_label_text_font_size": {
"field": "12pt"
},
"axis_label_text_font_style": "normal",
"axis_line_alpha": {
"value": 1.0
},
"axis_line_cap": "butt",
"axis_line_color": {
"value": "black"
},
"axis_line_dash": [],
"axis_line_dash_offset": 0,
"axis_line_join": "miter",
"axis_line_width": {
"value": 1
},
"bounds": "auto",
"doc": null,
"formatter": {
"id": "f56828c1-e9c0-45f7-ba4e-e65e6dc59044",
"type": "LogTickFormatter"
},
"id": "5e11b1bc-4f24-46e9-a261-e4b9bcd54dd8",
"location": "auto",
"major_label_orientation": "horizontal",
"major_label_standoff": null,
"major_label_text_align": "left",
"major_label_text_alpha": {
"value": 1.0
},
"major_label_text_baseline": "bottom",
"major_label_text_color": {
"value": "#444444"
},
"major_label_text_font": "Helvetica",
"major_label_text_font_size": {
"field": "12pt"
},
"major_label_text_font_style": "normal",
"major_tick_in": null,
"major_tick_line_alpha": {
"value": 1.0
},
"major_tick_line_cap": "butt",
"major_tick_line_color": {
"value": "black"
},
"major_tick_line_dash": [],
"major_tick_line_dash_offset": 0,
"major_tick_line_join": "miter",
"major_tick_line_width": {
"value": 1
},
"major_tick_out": null,
"minor_tick_in": null,
"minor_tick_line_alpha": {
"value": 1.0
},
"minor_tick_line_cap": "butt",
"minor_tick_line_color": {
"value": "black"
},
"minor_tick_line_dash": [],
"minor_tick_line_dash_offset": 0,
"minor_tick_line_join": "miter",
"minor_tick_line_width": {
"value": 1
},
"minor_tick_out": null,
"name": null,
"plot": null,
"tags": [],
"ticker": {
"id": "513c9c8d-27c2-4478-bdfc-e12fb58cbb87",
"type": "LogTicker"
},
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "5e11b1bc-4f24-46e9-a261-e4b9bcd54dd8",
"type": "LogAxis"
}
]