Reverse linearcolormapper

Is there an easy way to reverse the palette on a linear color mapper?

color_mapper = LinearColorMapper(palette=“Viridis10”, low=100, high=1000)

``

Works great, but I normally opt for the reverse of the new Matplotlib palettes (i.e. viridis_r )

Also I noticed that Viridis6 is reversed on the documentation page - <code class="docutils literal"><span class="pre">bokeh.palettes</span></code> — Bokeh 0.12.2 documentation though it seems to not be when you call it.

(Sorry if I’ve missed something obvious - pre 0.12.2 I used np.linspace to generate a list of colours from matplotlib )

Passing a string to palette is just a convenience. You can
pass a list of colors. T he
palettes are available as a list of colors.

from bokeh. palettes
import Viridis10

Viridis10.reverse()

  color_mapper = LinearColorMapper(palette=Viridis10, low=100,

high=1000)

HTH

···

On 9/8/16 3:04 AM, Will Kew wrote:

    Is there an easy way to reverse the palette on a

linear color mapper?

color_mapper = LinearColorMapper(palette=“Viridis10”, low=100, high=1000)

``

      Works great, but I normally opt for the reverse of the new

Matplotlib palettes (i.e. viridis_r )

      Also I noticed that Viridis6 is reversed on the

documentation page

though it seems to not be when you call it.

      (Sorry if I've missed something obvious - pre 0.12.2 I used

np.linspace to generate a list of colours from matplotlib )

  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/6397aaa1-314a-4238-a31d-a504592a08a7%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/6397aaa1-314a-4238-a31d-a504592a08a7%40continuum.io?utm_medium=email&utm_source=footer).

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


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

http://bokeh.pydata.org/en/0.12.2/docs/reference/palettes.html#bokeh-palettes

Ah, thought it might be something simple. Thanks Sarah! :slight_smile:

···

On Friday, 9 September 2016 03:41:00 UTC+1, Sarah Bird wrote:

Passing a string to palette is just a convenience. You can
pass a list of colors. T he
palettes are available as a list of colors.

from bokeh. palettes
import Viridis10

Viridis10.reverse()

color_mapper = LinearColorMapper(palette= Viridis10, low=100,
high=1000)

HTH

On 9/8/16 3:04 AM, Will Kew wrote:

    Is there an easy way to reverse the palette on a

linear color mapper?

color_mapper = LinearColorMapper(palette=“Viridis10”, low=100, high=1000)

``

      Works great, but I normally opt for the reverse of the new

Matplotlib palettes (i.e. viridis_r )

      Also I noticed that Viridis6 is reversed on the

documentation page

      (Sorry if I've missed something obvious - pre 0.12.2 I used

np.linspace to generate a list of colours from matplotlib )

  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/6397aaa1-314a-4238-a31d-a504592a08a7%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/6397aaa1-314a-4238-a31d-a504592a08a7%40continuum.io?utm_medium=email&utm_source=footer).

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


Sarah Bird
Developer, Bokeh

    [
      <img alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" style="width:150px;min-height:30px" height="30px" width="150px">
    ](http://continuum.io)