☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

CORRECTION TO Vectorized Colors and Sizes

Community Support
Jimmy_Gunawan
Jimmy_Gunawan

I was studying the example on Vectorized Colors and Sizes,

THIS DOES NOT WORK:

colors = ["#%02x%02x%02x" % (r, g, 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]

ERROR: TypeError: %x format: an integer is required, not numpy.float64

THIS WORKS:

colors = ["#%02x%02x%02x" % (int(r), int(g), 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]

Took me quite a while, but I learn something.

⌁   Link to post
Bryan
Bryan

Can you provide the exact URL you were looking at? I think you were looking at a link for an old version, since this was changed some time ago, at least in one place but maybe there are others.

Thanks,

Bryan

···

On Mar 14, 2016, at 04:33, Jimmy Gunawan jimmy.cg@gmail.com wrote:

I was studying the example on Vectorized Colors and Sizes,

THIS DOES NOT WORK:

colors = ["#%02x%02x%02x" % (r, g, 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]

ERROR: TypeError: %x format: an integer is required, not numpy.float64

THIS WORKS:

colors = ["#%02x%02x%02x" % (int(r), int(g), 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]

Took me quite a while, but I learn something.

–

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+unsubscribe@continuum.io.

To post to this group, send email to bokeh@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a8ef6fa6-1965-46f8-b89f-2305fee4b3b8%40continuum.io.

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

⌁   Link to post
Jimmy_Gunawan
Jimmy_Gunawan

Oh, there is a newer version of the documentation?

I was looking at this:

http://bokeh.pydata.org/en/0.10.0/docs/quickstart.html

···

On Monday, 14 March 2016 23:29:20 UTC+11, Bryan Van de ven wrote:

Can you provide the exact URL you were looking at? I think you were looking at a link for an old version, since this was changed some time ago, at least in one place but maybe there are others.

Thanks,

Bryan

On Mar 14, 2016, at 04:33, Jimmy Gunawan jimm...@gmail.com wrote:

I was studying the example on Vectorized Colors and Sizes,

THIS DOES NOT WORK:

colors = ["#%02x%02x%02x" % (r, g, 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]

ERROR: TypeError: %x format: an integer is required, not numpy.float64

THIS WORKS:

colors = ["#%02x%02x%02x" % (int(r), int(g), 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]

Took me quite a while, but I learn something.

–

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/a8ef6fa6-1965-46f8-b89f-2305fee4b3b8%40continuum.io.

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

⌁   Link to post
Bryan
Bryan

Hi,

yes the latest docs for the most recently released version are always at:

  Bokeh documentation — Bokeh 3.3.2 Documentation

It does look like this has been updated in the latest docs:

  http://bokeh.pydata.org/en/latest/docs/user_guide/quickstart.html#vectorized-colors-and-sizes

Starting with version 0.11 the docs site also has a "version selection dropdown" in the upper left hand corner, which should make it easier to get to the latest version of the docs going forward.

Thanks,

Bryan

···

On Mar 14, 2016, at 4:35 PM, Jimmy Gunawan <jimmy.cg@gmail.com> wrote:

Oh, there is a newer version of the documentation?

I was looking at this:
Quickstart — Bokeh 0.10.0 documentation

On Monday, 14 March 2016 23:29:20 UTC+11, Bryan Van de ven wrote:
Can you provide the exact URL you were looking at? I think you were looking at a link for an old version, since this was changed some time ago, at least in one place but maybe there are others.

Thanks,

Bryan

On Mar 14, 2016, at 04:33, Jimmy Gunawan <jimm...@gmail.com> wrote:

I was studying the example on Vectorized Colors and Sizes,

THIS DOES NOT WORK:
colors = ["#%02x%02x%02x" % (r, g, 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]

ERROR: TypeError: %x format: an integer is required, not numpy.float64

THIS WORKS:
colors = ["#%02x%02x%02x" % (int(r), int(g), 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]

Took me quite a while, but I learn something.

--
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/a8ef6fa6-1965-46f8-b89f-2305fee4b3b8%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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f0863372-efc0-4e75-b450-a30a20ecebcf%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post

End of archived discussion · Replies are disabled