Reputation: 1197
Objective: to change the border color of a Bokeh histogram bar from default black.
Below is an actual snippet from a Bokeh histogram:
The black lines highlighted above are what I am aiming to change to any other color besides black.
Any help would be appreciated.
Upvotes: 1
Views: 2478
Reputation: 34618
You haven't provided any code (you should always provide sample code when asking for help). So it's not actually possible to knowk whether you are using the old (and deprecated and removed) bokeh.charts.Histogram
or not. If that is the case, first things first: stop using it immediately. The old bokeh.charts
API is completely unmaintained at this point. It is a dead end.
Either way, you can create a histogram in Bokeh using the stable ad supported bokeh.plotting
API, in which case styling is styling is accomplished in the same general manner for all glyphs, as described in the User's Guide documentation.
Here is a complete example:
from bokeh.io import output_file, show
from bokeh.plotting import figure
from bokeh.sampledata.autompg import autompg as df
from numpy import histogram, linspace
x = linspace(0,250,200)
p = figure(plot_height=300)
hist, edges = histogram(df.hp, density=True, bins=20)
p.quad(top=hist, bottom=0, left=edges[:-1], right=edges[1:], alpha=0.4,
# same technique and properties for every Bokeh Glyph
line_color="red", line_width=2)
output_file("hist.html")
show(p)
Alternatively, if you are looking for a very high level API with a built in "Histogram Plot" type function, check out out HoloViews: http://holoviews.org/ It is a very high level API built on top of Bokeh and is actively maintained by a team of people.
Upvotes: 3