Hi Dror,
It is known a bug with colons in category names. There is a related open GH issue.
Regarding your question about the colors, you can just specify the palette argument, like this:
palette=[‘#83255A’, ‘#008000’]
``
Also, looking at you example I’d suggest a few things:
Seems that you want to specify 2 categories but you are only providing one iterable with scalar values. So if you want to have multiple values on each category you should be specifying a 2d iterable like:
vals = [[10, 4], [5, 2]]
``
Also, chart notebook method excpects a boolean value, so you should be calling it like:
bar.notebook(True).show()
``
but I’d invite you to prefer specifying notebook=True argument when creating the Bard chart or to use the explicit output_notebook and show methods from the plotting interface. This is more explicit and in the next versions is very likely that those methods will become the preferred way (and shared among all bokeh interface levels). See the following example:
from bokeh.plotting import output_notebook, show
vals = [[10, 4], [5, 2]]
cat = [‘14 30’, ‘15 30’]
bar = Bar(vals, cat, title=“Stacked bars”,
xlabel=“category”, ylabel=“language”, palette=[‘#83255A’, ‘#008000’])
output_notebook()
show(bar)
``
Best
Fabio
···
On Tuesday, February 24, 2015 at 11:29:30 AM UTC+1, Dror Atariah wrote:
And bonus question: how do I change the color of the bars?
On Tuesday, February 24, 2015 at 11:16:02 AM UTC+1, Dror Atariah wrote:
The following MWE:
vals = [10, 5]
cat = [‘14 30’, ‘15 30’]
bar = Bar(vals, cat, title=“Stacked bars”,
xlabel=“category”, ylabel=“language”)
bar.notebook().show()
``
However, if I change the second line:
cat = [‘14:30’, ‘15:30’]
``
the bars are not plotted. What is the reason for this? Is it a bug or misuse?
``