CORRECTION TO Vectorized Colors and Sizes

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.

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

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

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

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

Hi,

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

  http://bokeh.pydata.org/en/latest/

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 <[email protected]> wrote:

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 <[email protected]> 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 [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/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 [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/f0863372-efc0-4e75-b450-a30a20ecebcf%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.