How to change the default color palette/cycle globally

Hi,

despite some googling and checking the documentatoin I couldn’t find a way to change the default bokeh color cycle globally. The default green, red, … is very unfriendly to colorblind persons and I would like to replace it by a different color cycle, such as e.g. proposed in Wong, Nat. meth. (2011). I’m looking for a function analogous to seaborn.set_palette.

Thanks in advance.

Hi,

I'm assuming you are referring to the default palette used by several of the charts in the bokeh.charts API? If so, that seems to be pulling DEFAULT_PALETTE from here:

  https://github.com/bokeh/bokeh/blob/master/bokeh/plotting/helpers.py#L24

Two things to note:

* I believe most of the charts also accept a "palette" argument that can override the default (just pass a list of colors)

* It would be great to have a better default palette, but this is an area where we could use help. If you'd like to make an issue and a pull request to update the file I linked above, it would be welcome.

Thanks,

Bryan

···

On Dec 21, 2016, at 8:07 AM, [email protected] wrote:

Hi,

despite some googling and checking the documentatoin I couldn't find a way to change the default bokeh color cycle globally. The default green, red, ... is very unfriendly to colorblind persons and I would like to replace it by a different color cycle, such as e.g. proposed in Wong, Nat. meth. (2011). I'm looking for a function analogous to seaborn.set_palette.

Thanks in advance.

--
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/443b44c0-5cc4-4d53-8753-0f6c5df40ed7%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi,

thanks for your reply and pointing me to the right file. I’ll provide an alternative palette and make a pull request.

Best
Emmanuel

···

On Wednesday, December 21, 2016 at 4:22:04 PM UTC+1, Bryan Van de ven wrote:

Hi,

I’m assuming you are referring to the default palette used by several of the charts in the bokeh.charts API? If so, that seems to be pulling DEFAULT_PALETTE from here:

    [https://github.com/bokeh/bokeh/blob/master/bokeh/plotting/helpers.py#L24](https://github.com/bokeh/bokeh/blob/master/bokeh/plotting/helpers.py#L24)

Two things to note:

  • I believe most of the charts also accept a “palette” argument that can override the default (just pass a list of colors)

  • It would be great to have a better default palette, but this is an area where we could use help. If you’d like to make an issue and a pull request to update the file I linked above, it would be welcome.

Thanks,

Bryan

On Dec 21, 2016, at 8:07 AM, [email protected] wrote:

Hi,

despite some googling and checking the documentatoin I couldn’t find a way to change the default bokeh color cycle globally. The default green, red, … is very unfriendly to colorblind persons and I would like to replace it by a different color cycle, such as e.g. proposed in Wong, Nat. meth. (2011). I’m looking for a function analogous to seaborn.set_palette.

Thanks in advance.


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/443b44c0-5cc4-4d53-8753-0f6c5df40ed7%40continuum.io.

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

I guess I have one more question. Those palettes with colorblind friendly, easily distinguishable colors are not necessarliy the aesthetically most appealing ones. I’m not sure what bokeh’s policy is in this respect. Readability or aesthetics?

···

On Wednesday, December 21, 2016 at 4:22:04 PM UTC+1, Bryan Van de ven wrote:

Hi,

I’m assuming you are referring to the default palette used by several of the charts in the bokeh.charts API? If so, that seems to be pulling DEFAULT_PALETTE from here:

    [https://github.com/bokeh/bokeh/blob/master/bokeh/plotting/helpers.py#L24](https://github.com/bokeh/bokeh/blob/master/bokeh/plotting/helpers.py#L24)

Two things to note:

  • I believe most of the charts also accept a “palette” argument that can override the default (just pass a list of colors)

  • It would be great to have a better default palette, but this is an area where we could use help. If you’d like to make an issue and a pull request to update the file I linked above, it would be welcome.

Thanks,

Bryan

On Dec 21, 2016, at 8:07 AM, [email protected] wrote:

Hi,

despite some googling and checking the documentatoin I couldn’t find a way to change the default bokeh color cycle globally. The default green, red, … is very unfriendly to colorblind persons and I would like to replace it by a different color cycle, such as e.g. proposed in Wong, Nat. meth. (2011). I’m looking for a function analogous to seaborn.set_palette.

Thanks in advance.


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/443b44c0-5cc4-4d53-8753-0f6c5df40ed7%40continuum.io.

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

Do you have some examples of good usable palettes? We could try to select on that is as aesthetic as possible as a first cut.

All the current palettes readily available in Bokeh are here:

  https://github.com/bokeh/bokeh/blob/master/bokeh/palettes.py

There might already be some usable ones there that could just be swapped in. I *think* all or most of those are preview-able here:
  
  http://bokeh.pydata.org/en/dev/docs/reference/palettes.html

But we can certainly add any new ones easily enough.

If you are at all interested, a slightly bigger task would be to make the default palette more easily configurable, maybe via a function. The we could perhaps default to an "aesthetic" palette but make switching to other palettes trivial. However I understand if your time is too limited to pursue larger tasks (but a feature request GH issue in any case would be helpful)

Thanks,

Bryan

···

On Dec 21, 2016, at 10:05 AM, [email protected] wrote:

I guess I have one more question. Those palettes with colorblind friendly, easily distinguishable colors are not necessarliy the aesthetically most appealing ones. I'm not sure what bokeh's policy is in this respect. Readability or aesthetics?

On Wednesday, December 21, 2016 at 4:22:04 PM UTC+1, Bryan Van de ven wrote:
Hi,

I'm assuming you are referring to the default palette used by several of the charts in the bokeh.charts API? If so, that seems to be pulling DEFAULT_PALETTE from here:

        https://github.com/bokeh/bokeh/blob/master/bokeh/plotting/helpers.py#L24

Two things to note:

* I believe most of the charts also accept a "palette" argument that can override the default (just pass a list of colors)

* It would be great to have a better default palette, but this is an area where we could use help. If you'd like to make an issue and a pull request to update the file I linked above, it would be welcome.

Thanks,

Bryan
  
> On Dec 21, 2016, at 8:07 AM, emmanuel...@gmail.com wrote:
>
> Hi,
>
> despite some googling and checking the documentatoin I couldn't find a way to change the default bokeh color cycle globally. The default green, red, ... is very unfriendly to colorblind persons and I would like to replace it by a different color cycle, such as e.g. proposed in Wong, Nat. meth. (2011). I'm looking for a function analogous to seaborn.set_palette.
>
> Thanks in advance.
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/443b44c0-5cc4-4d53-8753-0f6c5df40ed7%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/b67dda92-6a33-43b3-b445-8e32fc53f0c3%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.