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": "42de6166-94db-4c1b-acb8-e8df8d355447",
"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": "42de6166-94db-4c1b-acb8-e8df8d355447",
"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": {
"desired_num_ticks": 6,
"doc": null,
"id": "22ff56d6-50ae-4bef-ac6e-60ec6d591549",
"name": null,
"num_minor_ticks": 5,
"tags": []
},
"id": "22ff56d6-50ae-4bef-ac6e-60ec6d591549",
"type": "CategoricalTicker"
},
{
"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": "ecccdc2a-d4b0-4457-9c3b-c27d83292aae",
"type": "CategoricalTickFormatter"
},
"id": "e8cea077-289f-453d-99da-5fe5f24f727e",
"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": "22ff56d6-50ae-4bef-ac6e-60ec6d591549",
"type": "CategoricalTicker"
},
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "e8cea077-289f-453d-99da-5fe5f24f727e",
"type": "CategoricalAxis"
},
{
"attributes": {
"doc": null,
"id": "ecccdc2a-d4b0-4457-9c3b-c27d83292aae",
"name": null,
"tags": []
},
"id": "ecccdc2a-d4b0-4457-9c3b-c27d83292aae",
"type": "CategoricalTickFormatter"
}
]
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": "d636235a-5015-4b2d-85c9-5569da606dc2",
"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": "d636235a-5015-4b2d-85c9-5569da606dc2",
"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": "66768ea9-e846-4139-8f12-7646098fa8e3",
"type": "DatetimeTickFormatter"
},
"id": "9e39c58c-1f60-4851-937a-8ee906ba88c3",
"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": "d9569b71-ff54-4956-9d73-9036f65ee118",
"type": "DatetimeTicker"
},
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "9e39c58c-1f60-4851-937a-8ee906ba88c3",
"type": "DatetimeAxis"
},
{
"attributes": {
"doc": null,
"formats": {},
"id": "66768ea9-e846-4139-8f12-7646098fa8e3",
"name": null,
"tags": []
},
"id": "66768ea9-e846-4139-8f12-7646098fa8e3",
"type": "DatetimeTickFormatter"
},
{
"attributes": {
"desired_num_ticks": 6,
"doc": null,
"id": "d9569b71-ff54-4956-9d73-9036f65ee118",
"name": null,
"num_minor_ticks": 5,
"tags": []
},
"id": "d9569b71-ff54-4956-9d73-9036f65ee118",
"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": {
"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": "1e2e12f7-e870-454d-a78f-ed5903d482df",
"type": "BasicTickFormatter"
},
"id": "db206d90-da4f-417a-8bb5-3a7aa7604ed7",
"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": "8c3d6101-2d1b-492e-a1c0-70ae60924aff",
"type": "BasicTicker"
},
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "db206d90-da4f-417a-8bb5-3a7aa7604ed7",
"type": "LinearAxis"
},
{
"attributes": {
"base": 10.0,
"desired_num_ticks": 6,
"doc": null,
"id": "8c3d6101-2d1b-492e-a1c0-70ae60924aff",
"mantissas": [
2,
5,
10
],
"max_interval": 100.0,
"min_interval": 0.0,
"name": null,
"num_minor_ticks": 5,
"tags": []
},
"id": "8c3d6101-2d1b-492e-a1c0-70ae60924aff",
"type": "BasicTicker"
},
{
"attributes": {
"doc": null,
"id": "1e2e12f7-e870-454d-a78f-ed5903d482df",
"name": null,
"power_limit_high": 5,
"power_limit_low": -3,
"precision": "auto",
"tags": [],
"use_scientific": true
},
"id": "1e2e12f7-e870-454d-a78f-ed5903d482df",
"type": "BasicTickFormatter"
}
]
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": "34ac85d9-828a-449b-9bb3-6ba5969aa031",
"name": null,
"tags": [],
"ticker": {
"id": "2de51366-69ad-4edd-82b9-78b92711170d",
"type": "LogTicker"
}
},
"id": "34ac85d9-828a-449b-9bb3-6ba5969aa031",
"type": "LogTickFormatter"
},
{
"attributes": {
"base": 10.0,
"desired_num_ticks": 6,
"doc": null,
"id": "2de51366-69ad-4edd-82b9-78b92711170d",
"mantissas": [
2,
5,
10
],
"max_interval": 100.0,
"min_interval": 0.0,
"name": null,
"num_minor_ticks": 10,
"tags": []
},
"id": "2de51366-69ad-4edd-82b9-78b92711170d",
"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": "34ac85d9-828a-449b-9bb3-6ba5969aa031",
"type": "LogTickFormatter"
},
"id": "b22258b9-0678-4e0b-a19f-2d7661daea5d",
"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": "2de51366-69ad-4edd-82b9-78b92711170d",
"type": "LogTicker"
},
"visible": true,
"x_range_name": "default",
"y_range_name": "default"
},
"id": "b22258b9-0678-4e0b-a19f-2d7661daea5d",
"type": "LogAxis"
}
]