New Chart Interface Question

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.

01 - charts.ipynb (2.18 MB)

Apologies, that exercise was part of the tutorial for the older interface. There is a PR in flight that add some new functions to bokeh.charts and has exactly this example included:

  https://github.com/bokeh/bokeh/pull/2986

It will be merged and part of an upcoming release soon.

I'm actually not sure about the bar ordering. Can you open an issue on GitHub to ask this? Not all the Bokeh developers watch the user mailing list.

Thanks,

Bryan

···

On Oct 15, 2015, at 1:45 AM, PaulYCDong <[email protected]> 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 https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
<01 - charts.ipynb>

Bryan,

Absolutely no need to apologize, Bokeh has helped a lot by making the data visualization more interactive and we users owe you and your team only appreciation.

I shall try to open an issue on GitHub on the ordering of the bar.

Again, great release 10.0!

Paul

···

On Thursday, 15 October 2015 19:28:10 UTC+8, Bryan Van de ven wrote:

Apologies, that exercise was part of the tutorial for the older interface. There is a PR in flight that add some new functions to bokeh.charts and has exactly this example included:

    [https://github.com/bokeh/bokeh/pull/2986](https://github.com/bokeh/bokeh/pull/2986)

It will be merged and part of an upcoming release soon.

I’m actually not sure about the bar ordering. Can you open an issue on GitHub to ask this? Not all the Bokeh developers watch the user mailing list.

Thanks,

Bryan

On Oct 15, 2015, at 1:45 AM, PaulYCDong [email protected] 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 https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

<01 - charts.ipynb>

Hi Paul,

There is a solution to that exercise in the bokeh-notebooks repo for you
to crib from. See:

bokeh-notebooks/tutorial/assets/solutions.txt

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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io
<https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io?utm_medium=email&utm_source=footer&gt;\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Sarah,

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:

Hi Paul,

There is a solution to that exercise in the bokeh-notebooks repo for you

to crib from. See:

bokeh-notebooks/tutorial/assets/solutions.txt

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]

mailto:[email protected].

To post to this group, send email to [email protected]

mailto:[email protected].

To view this discussion on the web visit

https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io

<https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

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:

Hi Sarah,

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:

Hi Paul,

There is a solution to that exercise in the bokeh-notebooks repo for you

to crib from. See:

bokeh-notebooks/tutorial/assets/solutions.txt

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]

mailto:[email protected].

To post to this group, send email to [email protected]

mailto:[email protected].

To view this discussion on the web visit

https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io

<https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Nick,

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!

thanks,

Paul

···

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:

Hi Sarah,

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:

Hi Paul,

There is a solution to that exercise in the bokeh-notebooks repo for you

to crib from. See:

bokeh-notebooks/tutorial/assets/solutions.txt

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]

mailto:[email protected].

To post to this group, send email to [email protected]

mailto:[email protected].

To view this discussion on the web visit

https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io

<https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

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:

Hi Nick,

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!

thanks,

Paul

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:

Hi Sarah,

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:

Hi Paul,

There is a solution to that exercise in the bokeh-notebooks repo for you

to crib from. See:

bokeh-notebooks/tutorial/assets/solutions.txt

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]

mailto:[email protected].

To post to this group, send email to [email protected]

mailto:[email protected].

To view this discussion on the web visit

https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io

<https://groups.google.com/a/continuum.io/d/msgid/bokeh/a690a2e3-1672-4d4d-8526-846604b516d7%40continuum.io?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.