I think what you are getting at is closer to what the lower level plotting interface provides, which gives you full control over things.
Charts will be pretty agnostic about how you are aggregating the data outside of it (sum(5)=5), as long as you organize it in a non-pivoted manner. Ideally, you want to assign columns to parts of the chart by the name of the column, instead of having a very specific aggregated structure. The reason the interface is moving the way it is, is to support the increasingly popular use for exploratory data analysis. With this use case, you don’t want to be bothered with how to munge data, or generate/assign colors, you just want to separate your data across a handful of dimensions through specification. So, “chart group by [‘col1’] and use [‘col3’] for values”. “No, that doesn’t show what I want, group by [‘col1’, ‘col2’] instead.” Not only is this more meaningful and consistent from a graphics system perspective, but most importantly, the idea is to shorten the feedback loop.
I do think there are probably opportunities to break out some components between the plotting interface and the higher level charts interface for those that want more control, it’ll just take a little bit of time for things to settle.
A side benefit that I hope to provide here in the coming months, is that this pattern makes for super simple interactive charts. My goal is to get to interact(Bar(df)) in an ipython notebook, which will produce a chart, a dropdown box containing all the columns in the dataframe for each dimension and attribute, dropdowns for each enum, and toggle boxes for each boolean option.
On Thursday, October 29, 2015 at 8:33:25 PM UTC-5, PaulYCDong wrote:
Many thanks for your thoughts, looks kinda technical for me to fully apprehend.
An alternative is really gear the user to do the aggregation in pandas and specify the color in the ColumnDataSource. I believe people (like me) using the Chart interface may actually like it that way.
For me, personally, where Bokeh is superior to Matplotlib for data analysis is its interactivity and it does not require you to upload all data to an external server like Plotly.
Great work for providing such a nice tool!
On Thursday, 29 October 2015 14:01:03 UTC+8, Nick Roth wrote:
I need to do another scrub through, but there are a number of places you could or could not try to sort automatically for the user. In some cases this would be a big help, in others, not so much. I’m not sure which version of bokeh you are using, but there a verbose example of doing this in the next version (v0.11) that we should improve on. I think maybe a global sort=False option should turn off all sorting, then it would be up to you to sort things yourself in the data ahead of time.
What I imagine is happening is that bronze, gold, silver is a alphabetical sort, so when providing an iterable of colors the things being colored by are sorted, then the colors assigned.
Another option I’m considering is full manual control through a mapping between values and things (colors in this case) as a dict, and/or a callable that is passed the values and you return colors.
On Wednesday, October 28, 2015 at 9:50:43 PM UTC-5, PaulYCDong wrote:
Many thanks for pointing the way!
For the bar constructor:
bar = Bar(
medals, label=‘name’, values=‘count’, stack=‘medal’, tools=‘crosshair’,
xlabel=’’, ylabel=‘Count’, bar_width=0.9, width=1200, height=600,
color=[‘saddlebrown’, ‘darkorange’, ‘silver’], responsive=True)
How would you know when you’re labeling the colors as color=[‘saddlebrown’, ‘darkorange’, ‘silver’], if you haven’t seen the chart with automatic colors, i.e. silver would actually come last in the group?
Thanks for the answer!
On Tuesday, 27 October 2015 23:36:35 UTC+8, Sarah Bird wrote:
There is a solution to that exercise in the bokeh-notebooks repo for you
to crib from. See:
Sorry, I could have made that more discoverable!
On 10/14/15 11:45 PM, PaulYCDong wrote:
Very Happy with the new chart interface that ships with Bokeh 0.10! such
a great job!
I’m going thru the tutorial in bokeh/bokeh-notebooks/tutorial, "01 -
charts" as attached
Everything’s OK until the last exercise where I am challenged to tweak
the display and styling of the stacked medals bar chart - just how am I
suppose to do that with the chart interface?
Is there any documentation / sample code I can refer to?
Also, if possible, can I also change the sequence of the series? I would
want the gold on top and bronze at bottom for each stacked bar.
Appreciate your help as always.
You received this message because you are subscribed to the Google
Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
To post to this group, send email to [email protected]
To view this discussion on the web visit
For more options, visit https://groups.google.com/a/continuum.io/d/optout.