limitation of 32768 points?

I’m just getting started with bokeh, and I’m noticing there seems to be a limitation of 32768 points, and I don’t know why. Does anyone know where it comes from and how to fix it?

import matplotlib.pyplot as plt

import numpy as np

import bokeh

t = np.arange(0,4.0,0.0001)

plt.plot(t,t**2)

bokeh.mpl.to_bokeh(notebook=True)

if I remove the bokeh line, it shows the parabola from x=0 to 4,

but with the bokeh line, it only shows up from 0 to 3.2768

Hi,

···

On Mon, Dec 15, 2014 at 7:25 PM, Jason Sachs [email protected] wrote:

I’m just getting started with bokeh, and I’m noticing there seems to be a limitation of 32768 points, and I don’t know why. Does anyone know where it comes from and how to fix it?

import matplotlib.pyplot as plt

import numpy as np

import bokeh

t = np.arange(0,4.0,0.0001)

plt.plot(t,t**2)

bokeh.mpl.to_bokeh(notebook=True)

if I remove the bokeh line, it shows the parabola from x=0 to 4,

but with the bokeh line, it only shows up from 0 to 3.2768

What browser do you use? I can reproduce this in Chrome 34. This looks like an implementation imposed limit on the length of a path. I was able to locally fix this issue by forcing Line renderer to split paths at fixed, sufficiently small intervals.

Mateusz

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/7e8b8182-16b5-470c-844c-4a46c1a47496%40continuum.io.

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

I use Chrome.

If it’s SVG, I’m a bit surprised about the path length… I tried creating an SVG path element with 1M segments and it did it fine (albeit slow). Here’s one with 256K: http://jsfiddle.net/edum0f60/

it's canvas

···

On 12/15/2014 02:57 PM, Jason Sachs wrote:

I use Chrome.

If it's SVG, I'm a bit surprised about the path length... I tried creating an SVG path element with 1M segments and it did it fine (albeit slow). Here's one with 256K: http://jsfiddle.net/edum0f60/
--
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/5c17f181-1f36-4688-b0d8-c538b8c30057%40continuum.io <https://groups.google.com/a/continuum.io/d/msgid/bokeh/5c17f181-1f36-4688-b0d8-c538b8c30057%40continuum.io?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I saw Jason S reported this exact same problem on mpld3, which does not use canvas, so I am not so sure.

···

On Dec 15, 2014, at 7:58 PM, Hugo Shi <[email protected]> wrote:

it's canvas

On 12/15/2014 02:57 PM, Jason Sachs wrote:

I use Chrome.

If it's SVG, I'm a bit surprised about the path length... I tried creating an SVG path element with 1M segments and it did it fine (albeit slow). Here's one with 256K: http://jsfiddle.net/edum0f60/
--
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/5c17f181-1f36-4688-b0d8-c538b8c30057%40continuum.io <https://groups.google.com/a/continuum.io/d/msgid/bokeh/5c17f181-1f36-4688-b0d8-c538b8c30057%40continuum.io?utm_medium=email&utm_source=footer>.
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/548F3D75.2020803%40gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Just tried rewriting my test case to use the HTML5 canvas API, it works fine too:

http://jsfiddle.net/33ttg0cy/1/

···

On Monday, December 15, 2014 1:01:19 PM UTC-7, Bryan Van de ven wrote:

I saw Jason S reported this exact same problem on mpld3, which does not use canvas, so I am not so sure.

On Dec 15, 2014, at 7:58 PM, Hugo Shi [email protected] wrote:

it’s canvas

On 12/15/2014 02:57 PM, Jason Sachs wrote:

I use Chrome.

If it’s SVG, I’m a bit surprised about the path length… I tried creating an SVG path element with 1M segments and it did it fine (albeit slow). Here’s one with 256K: http://jsfiddle.net/edum0f60/


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/5c17f181-1f36-4688-b0d8-c538b8c30057%40continuum.io <https://groups.google.com/a/continuum.io/d/msgid/bokeh/5c17f181-1f36-4688-b0d8-c538b8c30057%40continuum.io?utm_medium=email&utm_source=footer>.

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/548F3D75.2020803%40gmail.com.

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

Could this be a bug in matplotlib? Both this matplotlib -> bokeh renderer and the MPLD3 renderer have the same general approach (use matplotlib normally, then call some fancy magic to convert to javascript)

And drawing 40K points in bokeh itself works fine…

import numpy as np

import bokeh.plotting

t = np.arange(0,4.0,0.0001)

fig=bokeh.plotting.figure(plot_width=300, plot_height=300)

fig.line(t,t**2)

bokeh.plotting.show(fig)

···

On Monday, December 15, 2014 1:30:09 PM UTC-7, Jason Sachs wrote:

Could this be a bug in matplotlib? Both this matplotlib -> bokeh renderer and the MPLD3 renderer have the same general approach (use matplotlib normally, then call some fancy magic to convert to javascript)

I got the same (correct) result plotting 160k points (please see https://github.com/bokeh/bokeh/issues/1555) so perhaps this is indeed an MPL issue. However Mateusz reports a real browser problem on Chrome 34, it would be nice to verify that or not. I get a successful plot on Chrome Version 41.0.2243.2 dev (64-bit)

Bryan

···

On Dec 15, 2014, at 8:50 PM, Jason Sachs <[email protected]> wrote:

And drawing 40K points in bokeh itself works fine....

import numpy as np
import bokeh.plotting

t = np.arange(0,4.0,0.0001)
fig=bokeh.plotting.figure(plot_width=300, plot_height=300)
fig.line(t,t**2)
bokeh.plotting.show(fig)

On Monday, December 15, 2014 1:30:09 PM UTC-7, Jason Sachs wrote:
Could this be a bug in matplotlib? Both this matplotlib -> bokeh renderer and the MPLD3 renderer have the same general approach (use matplotlib normally, then call some fancy magic to convert to javascript)

--
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/bc2b5759-1a8c-4908-908c-4da597bd2a05%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I’m using Chrome Version 39.0.2171.71 m, on Windows 7 64-bit

···

On Monday, December 15, 2014 2:23:41 PM UTC-7, Bryan Van de ven wrote:

I got the same (correct) result plotting 160k points (please see https://github.com/bokeh/bokeh/issues/1555) so perhaps this is indeed an MPL issue. However Mateusz reports a real browser problem on Chrome 34, it would be nice to verify that or not. I get a successful plot on Chrome Version 41.0.2243.2 dev (64-bit)

Bryan

On Dec 15, 2014, at 8:50 PM, Jason Sachs [email protected] wrote:

And drawing 40K points in bokeh itself works fine…

import numpy as np

import bokeh.plotting

t = np.arange(0,4.0,0.0001)

fig=bokeh.plotting.figure(plot_width=300, plot_height=300)

fig.line(t,t**2)

bokeh.plotting.show(fig)

On Monday, December 15, 2014 1:30:09 PM UTC-7, Jason Sachs wrote:

Could this be a bug in matplotlib? Both this matplotlib -> bokeh renderer and the MPLD3 renderer have the same general approach (use matplotlib normally, then call some fancy magic to convert to javascript)


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/bc2b5759-1a8c-4908-908c-4da597bd2a05%40continuum.io.

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