Plotting error bands possible?

Hi Clemens,

You can use the bokeh.plotting or bokeh.glyph interfaces to compose different glyphs and build what you need. Here’s an example that extends the line example to add bands using the patch glyph:

import numpy as np

from bokeh.plotting import figure, show, output_file

x = np.linspace(0, 4*np.pi, 200)

y = np.sin(x)

upperband = y + y*0.1

lowerband = y - y*0.1

band_x = np.append(x, x[::-1])

band_y = np.append(lowerband, upperband[::-1])

output_file(“line.html”, title=“line.py example”)

p = figure(title=“simple line example”)

p.line(x,y, color=“#2222aa”, line_width=2)

p.patch(band_x, band_y, color=‘#7570B3’, fill_alpha=0.2)

p.ygrid[0].ticker.desired_num_ticks = 20

show(p)

``

Best

Fabio

···

On Wednesday, May 13, 2015 at 1:46:31 PM UTC+2, Clemens Blank wrote:

Hello,

I know that error bars are possible in bokeh, but what about error bands?

For example like this: http://www.jqplot.com/deploy/dist/examples/bandedLine.html

Best regards

Clemens

Hi Fabio,

thanks a lot, that looks promising! :slight_smile:

Best regards

Clemens

···

Am Freitag, 22. Mai 2015 16:43:49 UTC+2 schrieb Fabio Pliger:

Hi Clemens,

You can use the bokeh.plotting or bokeh.glyph interfaces to compose different glyphs and build what you need. Here’s an example that extends the line example to add bands using the patch glyph:

import numpy as np

from bokeh.plotting import figure, show, output_file

x = np.linspace(0, 4*np.pi, 200)

y = np.sin(x)

upperband = y + y*0.1

lowerband = y - y*0.1

band_x = np.append(x, x[::-1])

band_y = np.append(lowerband, upperband[::-1])

output_file(“line.html”, title=“line.py example”)

p = figure(title=“simple line example”)

p.line(x,y, color=“#2222aa”, line_width=2)

p.patch(band_x, band_y, color=‘#7570B3’, fill_alpha=0.2)

p.ygrid[0].ticker.desired_num_ticks = 20

show(p)

``

Best

Fabio

On Wednesday, May 13, 2015 at 1:46:31 PM UTC+2, Clemens Blank wrote:

Hello,

I know that error bars are possible in bokeh, but what about error bands?

For example like this: http://www.jqplot.com/deploy/dist/examples/bandedLine.html

Best regards

Clemens

Wow, what I just realized: This simple plot is around 1.6MB big - is this for real? I mean, that’s not huge, that’s huge huge. Way to big for any serious web page - not too mention plots with way more data.

···

Am Freitag, 22. Mai 2015 16:43:49 UTC+2 schrieb Fabio Pliger:

Hi Clemens,

You can use the bokeh.plotting or bokeh.glyph interfaces to compose different glyphs and build what you need. Here’s an example that extends the line example to add bands using the patch glyph:

import numpy as np

from bokeh.plotting import figure, show, output_file

x = np.linspace(0, 4*np.pi, 200)

y = np.sin(x)

upperband = y + y*0.1

lowerband = y - y*0.1

band_x = np.append(x, x[::-1])

band_y = np.append(lowerband, upperband[::-1])

output_file(“line.html”, title=“line.py example”)

p = figure(title=“simple line example”)

p.line(x,y, color=“#2222aa”, line_width=2)

p.patch(band_x, band_y, color=‘#7570B3’, fill_alpha=0.2)

p.ygrid[0].ticker.desired_num_ticks = 20

show(p)

``

Best

Fabio

On Wednesday, May 13, 2015 at 1:46:31 PM UTC+2, Clemens Blank wrote:

Hello,

I know that error bars are possible in bokeh, but what about error bands?

For example like this: http://www.jqplot.com/deploy/dist/examples/bandedLine.html

Best regards

Clemens

Hi Clemens,

Try changing the line:

output_file("line.html", title="line.py example")

`to
``output_file(“line.html”, title=“line.py example”, mode=“cdn”)

`

This takes it down to 35k! But does mean that the person you send it to will need an internet connection to open it.

I’m hoping to work on some things that will reduce the size of the assets that come with bokeh. But it will probably be later in June till I can get to it.

Sincerely,

Sarah Bird

``

···

On Fri, May 22, 2015 at 11:08 AM, Clemens Blank [email protected] wrote:

Wow, what I just realized: This simple plot is around 1.6MB big - is this for real? I mean, that’s not huge, that’s huge huge. Way to big for any serious web page - not too mention plots with way more data.

Am Freitag, 22. Mai 2015 16:43:49 UTC+2 schrieb Fabio Pliger:

Hi Clemens,

You can use the bokeh.plotting or bokeh.glyph interfaces to compose different glyphs and build what you need. Here’s an example that extends the line example to add bands using the patch glyph:

import numpy as np

from bokeh.plotting import figure, show, output_file

x = np.linspace(0, 4*np.pi, 200)

y = np.sin(x)

upperband = y + y*0.1

lowerband = y - y*0.1

band_x = np.append(x, x[::-1])

band_y = np.append(lowerband, upperband[::-1])

output_file(“line.html”, title=“line.py example”)

p = figure(title=“simple line example”)

p.line(x,y, color=“#2222aa”, line_width=2)

p.patch(band_x, band_y, color=‘#7570B3’, fill_alpha=0.2)

p.ygrid[0].ticker.desired_num_ticks = 20

show(p)

``

Best

Fabio

On Wednesday, May 13, 2015 at 1:46:31 PM UTC+2, Clemens Blank wrote:

Hello,

I know that error bars are possible in bokeh, but what about error bands?

For example like this: http://www.jqplot.com/deploy/dist/examples/bandedLine.html

Best regards

Clemens

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/ddcb3c83-1ef2-4501-864f-97c930b0d01f%40continuum.io.

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

Hi Sarah,

thank you for the fast reply, so it’s only the necessary java script that big. Huh, world saved :slight_smile: With flask-compress it’s even smaller, 9.6KB - an awesome extension to flask btw. :wink:

Greetings

Clemens

···

Am Freitag, 22. Mai 2015 20:59:10 UTC+2 schrieb Sarah Bird:

Hi Clemens,

Try changing the line:

output_file("line.html", title="line.py example")

`to
``output_file(“line.html”, title=“line.py example”, mode=“cdn”)

`

This takes it down to 35k! But does mean that the person you send it to will need an internet connection to open it.

I’m hoping to work on some things that will reduce the size of the assets that come with bokeh. But it will probably be later in June till I can get to it.

Sincerely,

Sarah Bird

``

On Fri, May 22, 2015 at 11:08 AM, Clemens Blank [email protected] wrote:

Wow, what I just realized: This simple plot is around 1.6MB big - is this for real? I mean, that’s not huge, that’s huge huge. Way to big for any serious web page - not too mention plots with way more data.

Am Freitag, 22. Mai 2015 16:43:49 UTC+2 schrieb Fabio Pliger:

Hi Clemens,

You can use the bokeh.plotting or bokeh.glyph interfaces to compose different glyphs and build what you need. Here’s an example that extends the line example to add bands using the patch glyph:

import numpy as np

from bokeh.plotting import figure, show, output_file

x = np.linspace(0, 4*np.pi, 200)

y = np.sin(x)

upperband = y + y*0.1

lowerband = y - y*0.1

band_x = np.append(x, x[::-1])

band_y = np.append(lowerband, upperband[::-1])

output_file(“line.html”, title=“line.py example”)

p = figure(title=“simple line example”)

p.line(x,y, color=“#2222aa”, line_width=2)

p.patch(band_x, band_y, color=‘#7570B3’, fill_alpha=0.2)

p.ygrid[0].ticker.desired_num_ticks = 20

show(p)

``

Best

Fabio

On Wednesday, May 13, 2015 at 1:46:31 PM UTC+2, Clemens Blank wrote:

Hello,

I know that error bars are possible in bokeh, but what about error bands?

For example like this: http://www.jqplot.com/deploy/dist/examples/bandedLine.html

Best regards

Clemens

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/ddcb3c83-1ef2-4501-864f-97c930b0d01f%40continuum.io.

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

Hi Clemens,

It’s also the CSS that’s very big.

That will be the first target of my efforts as I think there will be a lot of easy wins there.

Splitting up the JS may be trickier.

I’m somewhat obsessive about web page sizes as I often develop for low-bandwidth constraints (100kb is my usual target) so I’m keen to see this improve.

Best,

Bird

···

On Fri, May 22, 2015 at 12:09 PM, Clemens Blank [email protected] wrote:

Hi Sarah,

thank you for the fast reply, so it’s only the necessary java script that big. Huh, world saved :slight_smile: With flask-compress it’s even smaller, 9.6KB - an awesome extension to flask btw. :wink:

Greetings

Clemens

Am Freitag, 22. Mai 2015 20:59:10 UTC+2 schrieb Sarah Bird:

Hi Clemens,

Try changing the line:

output_file("line.html", title="line.py example")

`to
``output_file(“line.html”, title=“line.py example”, mode=“cdn”)

`

This takes it down to 35k! But does mean that the person you send it to will need an internet connection to open it.

I’m hoping to work on some things that will reduce the size of the assets that come with bokeh. But it will probably be later in June till I can get to it.

Sincerely,

Sarah Bird

``

On Fri, May 22, 2015 at 11:08 AM, Clemens Blank [email protected] wrote:

Wow, what I just realized: This simple plot is around 1.6MB big - is this for real? I mean, that’s not huge, that’s huge huge. Way to big for any serious web page - not too mention plots with way more data.

Am Freitag, 22. Mai 2015 16:43:49 UTC+2 schrieb Fabio Pliger:

Hi Clemens,

You can use the bokeh.plotting or bokeh.glyph interfaces to compose different glyphs and build what you need. Here’s an example that extends the line example to add bands using the patch glyph:

import numpy as np

from bokeh.plotting import figure, show, output_file

x = np.linspace(0, 4*np.pi, 200)

y = np.sin(x)

upperband = y + y*0.1

lowerband = y - y*0.1

band_x = np.append(x, x[::-1])

band_y = np.append(lowerband, upperband[::-1])

output_file(“line.html”, title=“line.py example”)

p = figure(title=“simple line example”)

p.line(x,y, color=“#2222aa”, line_width=2)

p.patch(band_x, band_y, color=‘#7570B3’, fill_alpha=0.2)

p.ygrid[0].ticker.desired_num_ticks = 20

show(p)

``

Best

Fabio

On Wednesday, May 13, 2015 at 1:46:31 PM UTC+2, Clemens Blank wrote:

Hello,

I know that error bars are possible in bokeh, but what about error bands?

For example like this: http://www.jqplot.com/deploy/dist/examples/bandedLine.html

Best regards

Clemens

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/ddcb3c83-1ef2-4501-864f-97c930b0d01f%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/319da4e2-8a48-4889-848e-d69031d4d82e%40continuum.io.

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

Just to elaborate, most of the bulk comes from always including all the widget implementation and css inside the Bokeh library. We are going to cleave that off into a separately loaded component that only has to be "paid for" when it is actually used. I don't have a good estimate for what we can get down to eventually, but as a experiment I took a very coarse scalpel to the codebase and "built" BokehJS roughly without widget support and dependencies, and the resulting minified, gzipped file size was about 190k. I think we can do even better than that, though.

Bryan

···

On May 22, 2015, at 2:32 PM, Sarah Bird <[email protected]> wrote:

Hi Clemens,

It's also the CSS that's very big.

That will be the first target of my efforts as I think there will be a lot of easy wins there.

Splitting up the JS may be trickier.

I'm somewhat obsessive about web page sizes as I often develop for low-bandwidth constraints (100kb is my usual target) so I'm keen to see this improve.

Best,

Bird

On Fri, May 22, 2015 at 12:09 PM, Clemens Blank <[email protected]> wrote:
Hi Sarah,

thank you for the fast reply, so it's only the necessary java script that big. Huh, world saved :slight_smile: With flask-compress it's even smaller, 9.6KB - an awesome extension to flask btw. :wink:

Greetings

Clemens

Am Freitag, 22. Mai 2015 20:59:10 UTC+2 schrieb Sarah Bird:
Hi Clemens,

Try changing the line:

output_file("line.html", title="line.py example")
to
output_file("line.html", title="line.py example", mode="cdn")

This takes it down to 35k! But does mean that the person you send it to will need an internet connection to open it.

I'm hoping to work on some things that will reduce the size of the assets that come with bokeh. But it will probably be later in June till I can get to it.

Sincerely,

Sarah Bird

On Fri, May 22, 2015 at 11:08 AM, Clemens Blank <[email protected]> wrote:
Wow, what I just realized: This simple plot is around 1.6MB big - is this for real? I mean, that's not huge, that's huge huge. Way to big for any serious web page - not too mention plots with way more data.

Am Freitag, 22. Mai 2015 16:43:49 UTC+2 schrieb Fabio Pliger:
Hi Clemens,

You can use the bokeh.plotting or bokeh.glyph interfaces to compose different glyphs and build what you need. Here's an example that extends the line example to add bands using the patch glyph:

import numpy as np

from bokeh.plotting import figure, show, output_file

x = np.linspace(0, 4*np.pi, 200)
y = np.sin(x)
upperband = y + y*0.1
lowerband = y - y*0.1

band_x = np.append(x, x[::-1])
band_y = np.append(lowerband, upperband[::-1])

output_file("line.html", title="line.py example")

p = figure(title="simple line example")
p.line(x,y, color="#2222aa", line_width=2)

p.patch(band_x, band_y, color='#7570B3', fill_alpha=0.2)

p.ygrid[0].ticker.desired_num_ticks = 20

show(p)

Best

Fabio

On Wednesday, May 13, 2015 at 1:46:31 PM UTC+2, Clemens Blank wrote:
Hello,

I know that error bars are possible in bokeh, but what about error bands?

For example like this: Error Bands and Confidence Intervals

Best regards

Clemens

--
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/ddcb3c83-1ef2-4501-864f-97c930b0d01f%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/319da4e2-8a48-4889-848e-d69031d4d82e%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/CA%2BEr%2BdR2w_PxpOA1v7J9ar-E2wkFMWeYLahgW6v1KKTDLYoSBg%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Well that sounds good, although I personally don’t mind that much about a “one-time” load. Concerning the widgets, it might be a good idea to not only separate them, but maybe totally rework them, since at least some (sliders) lack support for touch screens - and although I understand that this is not the main priority for the functionality of bokeh, it is absolutely necessary for nowadays web applications.

Clemens

···

Am Freitag, 22. Mai 2015 22:11:15 UTC+2 schrieb Bryan Van de ven:

Just to elaborate, most of the bulk comes from always including all the widget implementation and css inside the Bokeh library. We are going to cleave that off into a separately loaded component that only has to be “paid for” when it is actually used. I don’t have a good estimate for what we can get down to eventually, but as a experiment I took a very coarse scalpel to the codebase and “built” BokehJS roughly without widget support and dependencies, and the resulting minified, gzipped file size was about 190k. I think we can do even better than that, though.

Bryan

On May 22, 2015, at 2:32 PM, Sarah Bird [email protected] wrote:

Hi Clemens,

It’s also the CSS that’s very big.

That will be the first target of my efforts as I think there will be a lot of easy wins there.

Splitting up the JS may be trickier.

I’m somewhat obsessive about web page sizes as I often develop for low-bandwidth constraints (100kb is my usual target) so I’m keen to see this improve.

Best,

Bird

On Fri, May 22, 2015 at 12:09 PM, Clemens Blank [email protected] wrote:

Hi Sarah,

thank you for the fast reply, so it’s only the necessary java script that big. Huh, world saved :slight_smile: With flask-compress it’s even smaller, 9.6KB - an awesome extension to flask btw. :wink:

Greetings

Clemens

Am Freitag, 22. Mai 2015 20:59:10 UTC+2 schrieb Sarah Bird:

Hi Clemens,

Try changing the line:

output_file(“line.html”, title=“line.py example”)

to
output_file(“line.html”, title=“line.py example”, mode=“cdn”)

This takes it down to 35k! But does mean that the person you send it to will need an internet connection to open it.

I’m hoping to work on some things that will reduce the size of the assets that come with bokeh. But it will probably be later in June till I can get to it.

Sincerely,

Sarah Bird

On Fri, May 22, 2015 at 11:08 AM, Clemens Blank [email protected] wrote:

Wow, what I just realized: This simple plot is around 1.6MB big - is this for real? I mean, that’s not huge, that’s huge huge. Way to big for any serious web page - not too mention plots with way more data.

Am Freitag, 22. Mai 2015 16:43:49 UTC+2 schrieb Fabio Pliger:

Hi Clemens,

You can use the bokeh.plotting or bokeh.glyph interfaces to compose different glyphs and build what you need. Here’s an example that extends the line example to add bands using the patch glyph:

import numpy as np

from bokeh.plotting import figure, show, output_file

x = np.linspace(0, 4*np.pi, 200)

y = np.sin(x)

upperband = y + y*0.1

lowerband = y - y*0.1

band_x = np.append(x, x[::-1])

band_y = np.append(lowerband, upperband[::-1])

output_file(“line.html”, title=“line.py example”)

p = figure(title=“simple line example”)

p.line(x,y, color=“#2222aa”, line_width=2)

p.patch(band_x, band_y, color=‘#7570B3’, fill_alpha=0.2)

p.ygrid[0].ticker.desired_num_ticks = 20

show(p)

Best

Fabio

On Wednesday, May 13, 2015 at 1:46:31 PM UTC+2, Clemens Blank wrote:

Hello,

I know that error bars are possible in bokeh, but what about error bands?

For example like this: http://www.jqplot.com/deploy/dist/examples/bandedLine.html

Best regards

Clemens


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/ddcb3c83-1ef2-4501-864f-97c930b0d01f%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/319da4e2-8a48-4889-848e-d69031d4d82e%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/CA%2BEr%2BdR2w_PxpOA1v7J9ar-E2wkFMWeYLahgW6v1KKTDLYoSBg%40mail.gmail.com.

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