How do I remove grid lines from a Bokeh plot?
Question:
I would like to remove the grid lines from a Bokeh plot. What is the best way to do this?
Answers:
Have a look at the Bokeh line styling documentation
You can hide the lines by setting their grid_line_color
to None
.
fig.xgrid.grid_line_color = None
fig.ygrid.grid_line_color = None
An alternative way to hide the lines is:
p.xgrid.visible = False
p.ygrid.visible = False
http://docs.bokeh.org/en/latest/docs/user_guide/styling.html#visible-property
It might be faster, but I didn’t check it out.
You can write
p.grid.visible = False
which will make both xgrid
and ygrid
invisible at the same time.
http://docs.bokeh.org/en/latest/docs/user_guide/styling.html#styling-grids
I think T-Gott’s answer better solves the original question: "remove the grid lines from a Bokeh plot".
I would like to remove the grid lines from a Bokeh plot. What is the best way to do this?
Have a look at the Bokeh line styling documentation
You can hide the lines by setting their grid_line_color
to None
.
fig.xgrid.grid_line_color = None
fig.ygrid.grid_line_color = None
An alternative way to hide the lines is:
p.xgrid.visible = False
p.ygrid.visible = False
http://docs.bokeh.org/en/latest/docs/user_guide/styling.html#visible-property
It might be faster, but I didn’t check it out.
You can write
p.grid.visible = False
which will make both xgrid
and ygrid
invisible at the same time.
http://docs.bokeh.org/en/latest/docs/user_guide/styling.html#styling-grids
I think T-Gott’s answer better solves the original question: "remove the grid lines from a Bokeh plot".