A lot of the intention of charts is that for most cases you shouldn’t have to worry so much about all the styling details. If you want absolute control over application of colors, etc, then I’d suggest using the lower level interface.
Two things are important to note:
First, that charts produces is a Chart, which subclasses Plot. So, in the end you have the same result, a plot with GlyphRenderers. There will likely be some internal refactoring here soon so that the output provides the maximum flexibility and compatibility possible. So, once you get the output, you can manipulate the plot however you’d like.
Second, the approach with the new charts is to automatically handle the “mapping” of a palette (or anything really) to unique values in one or more columns (df[[‘col1’, ‘col2’]].drop_duplicates()). So, if you have an iterable of things you want to assign to unique values in those columns, charts handles the assignment and cycling your things as needed if you have too many unique values.
The general use case for any chart attribute is this:
-
Explicit input => color=‘Red’ or color=, etc
-
To use the default “things” you just specify the columns, so color=[‘col1’, ‘col2’], or marker=‘col2’ (or both)
-
To customize the default things, the intent is that there will be chart functions that produce this mapping with various input options. So, from bokeh.charts import color, then color=color([‘col1’, ‘col2’], palette=[‘color1’, ‘color2’, ‘color3’]). With this, charts will take the unique values between column 1 and column 2 by name, then will assign color1 to the first, color2 to the second, color3 to the third, color1 to the forth, and so on.
There should be some additional documentation on this topic in the next release in v0.11. For most of your concerns (ticks, grid, border, etc), I’d just handle modifying those on the output Chart object until more of the input options are sorted out. If you can’t get the core attributes working as you want them (color, marker, line color, etc), you can also modify those after creation on the GlyphRenderers and/or their associated ColumnDataSource, but also let us know what difficulties you had so we can work on making it easier.
···
On Sunday, October 25, 2015 at 12:22:10 PM UTC-5, [email protected] wrote:
Is it possible to style Bokeh charts with the same range of styling options as plots made using the plotting interface?
Specifically, I’d like to change the colors, opacity, number of ticks, grid attributes, border attributes etc. on a chart made using the Bar function.
Any help would be great.
-Nik