☰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

extending burtin.py

Community Support
Mike_Schiller
Mike_Schiller

I’m trying to modify burtin.py (in examples/plotting/file) so that the resulting png will have a transparent background, but can’t seem to figure out how to go about that. Could someone point me in the right direction?

Also, I’m a bit confused as to the point of the line 65 of https://github.com/ContinuumIO/bokeh/blob/master/examples/plotting/server/burtin.py

While it seems to be instantiating the buttons on the resulting web page, I can change the first two arguments to be empty lists with no apparent affect. However, if I remove the line entirely, the plot.x_range statement on line 68 fails because there wasn’t a current plot on line 67. Is this a typical way of initializing things, or is there a better pattern to follow?

Thanks,

Mike

⌁   Link to post
Damian_Avila
Damian_Avila

Hi Mike,

To have transparent background just comment or delete the lines 71-72 (you can use those properties to choose any color you want).

Regarding your second question…

you can use figure() to configure the plot appearance, but you can also pass these properties to the glyph: line(), rect(), etc…

http://bokeh.pydata.org/docs/user_guide.html#plots

There is probably several ways to draw things using Bokeh (according with some specific needs) but I would suggest the pattern showed in the Bokeh tutorial: http://bokeh.pydata.org/tutorial/index.html, as a starting point.

Damián

···

On Wed, May 21, 2014 at 7:57 PM, Mike Schiller mdschiller@gmail.com wrote:

I’m trying to modify burtin.py (in examples/plotting/file) so that the resulting png will have a transparent background, but can’t seem to figure out how to go about that. Could someone point me in the right direction?

Also, I’m a bit confused as to the point of the line 65 of https://github.com/ContinuumIO/bokeh/blob/master/examples/plotting/server/burtin.py

While it seems to be instantiating the buttons on the resulting web page, I can change the first two arguments to be empty lists with no apparent affect. However, if I remove the line entirely, the plot.x_range statement on line 68 fails because there wasn’t a current plot on line 67. Is this a typical way of initializing things, or is there a better pattern to follow?

Thanks,

Mike

–

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/befdcbab-9cca-4e32-94d9-4d8c07b38c62%40continuum.io.

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

⌁   Link to post
Bryan
Bryan

Actually just deleting those lines will leave a white background, not transparent. It looks like we neglected the possibility of background alpha. It should be a simple fix, I will put in in master today, and also upload (and announce) some dev builds later as well.

Regarding the second question, very astute observation, it was just to set up the plot plot properties. The best way to do that now is with “figure()” though note, figure() does not create a plot on an existing one, or sets up properties for the next plot created. In this case there is not one, so the curplot() immediately after will fail. Those commands need to be moved later. I will update the example and push that to master as well.

···

--
Bryan Van de Ven
Continuum Analytics

On May 22, 2014 at 11:25:28 AM, Damian Avila (damian.avila@continuum.io) wrote:

Hi Mike,

To have transparent background just comment or delete the lines 71-72 (you
can use those properties to choose any color you want).

Regarding your second question...

you can use figure() to configure the plot appearance, but you can also
pass these properties to the glyph: line(), rect(), etc...

http://bokeh.pydata.org/docs/user_guide.html#plots

There is probably several ways to draw things using Bokeh (according with
some specific needs) but I would suggest the pattern showed in the Bokeh
tutorial: http://bokeh.pydata.org/tutorial/index.html, as a starting point.

Damián

On Wed, May 21, 2014 at 7:57 PM, Mike Schiller wrote:

> I'm trying to modify burtin.py (in examples/plotting/file) so that the
> resulting png will have a transparent background, but can't seem to figure
> out how to go about that. Could someone point me in the right direction?
>
> Also, I'm a bit confused as to the point of the line 65 of
> https://github.com/ContinuumIO/bokeh/blob/master/examples/plotting/server/burtin.py
>
> While it seems to be instantiating the buttons on the resulting web page,
> I can change the first two arguments to be empty lists with no apparent
> affect. However, if I remove the line entirely, the plot.x_range statement
> on line 68 fails because there wasn't a current plot on line 67. Is this a
> typical way of initializing things, or is there a better pattern to follow?
>
> Thanks,
> Mike
>
> --
> 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/befdcbab-9cca-4e32-94d9-4d8c07b38c62%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/CAM9Ly3G%3DmoKV%2B5G4Me1Zwm-L7%2B_RcWxu1miQFOzR7eXwP%3DuyiA%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
jordicasa
jordicasa

I’m also trying to make a plot with a completely transparent background (and border). I don’t know if you’ve already fixed that. I don’t find it in the documentation, and figure() does not seem to accept any attribute similar to background_fill_alpha. Any news?
(I’m using 0.8.1)

Thank you!

El dijous, 22 maig de 2014 18:38:07 UTC+2, Bryan Van de ven va escriure:

···

Actually just deleting those lines will leave a white background, not transparent. It looks like we neglected the possibility of background alpha. It should be a simple fix, I will put in in master today, and also upload (and announce) some dev builds later as well.

Regarding the second question, very astute observation, it was just to set up the plot plot properties. The best way to do that now is with “figure()” though note, figure() does not create a plot on an existing one, or sets up properties for the next plot created. In this case there is not one, so the curplot() immediately after will fail. Those commands need to be moved later. I will update the example and push that to master as well.

–

Bryan Van de Ven

Continuum Analytics

On May 22, 2014 at 11:25:28 AM, Damian Avila (damian...@continuum.io) wrote:

Hi Mike,

To have transparent background just comment or delete the lines 71-72 (you

can use those properties to choose any color you want).

Regarding your second question…

you can use figure() to configure the plot appearance, but you can also

pass these properties to the glyph: line(), rect(), etc…

http://bokeh.pydata.org/docs/user_guide.html#plots

There is probably several ways to draw things using Bokeh (according with

some specific needs) but I would suggest the pattern showed in the Bokeh

tutorial: http://bokeh.pydata.org/tutorial/index.html, as a starting point.

Damián

On Wed, May 21, 2014 at 7:57 PM, Mike Schiller wrote:

I’m trying to modify burtin.py (in examples/plotting/file) so that the

resulting png will have a transparent background, but can’t seem to figure

out how to go about that. Could someone point me in the right direction?

Also, I’m a bit confused as to the point of the line 65 of

https://github.com/ContinuumIO/bokeh/blob/master/examples/plotting/server/burtin.py

While it seems to be instantiating the buttons on the resulting web page,

I can change the first two arguments to be empty lists with no apparent

affect. However, if I remove the line entirely, the plot.x_range statement

on line 68 fails because there wasn’t a current plot on line 67. Is this a

typical way of initializing things, or is there a better pattern to follow?

Thanks,

Mike

–

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/befdcbab-9cca-4e32-94d9-4d8c07b38c62%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+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/CAM9Ly3G%3DmoKV%2B5G4Me1Zwm-L7%2B_RcWxu1miQFOzR7eXwP%3DuyiA%40mail.gmail.com.

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

⌁   Link to post
Bryan
Bryan

Hi Jordi,

No there was no GH issue for it and it evidently fell off my mental radar. Can you you make an issue for this on GitHub so that it can be tracked, and I will put it up for the 0.8.2 milestone.

Thanks,

Bryan

···

On Mar 4, 2015, at 11:29 AM, jordicasa@gmail.com wrote:

I'm also trying to make a plot with a completely transparent background (and border). I don't know if you've already fixed that. I don't find it in the documentation, and figure() does not seem to accept any attribute similar to background_fill_alpha. Any news?
(I'm using 0.8.1)

Thank you!

El dijous, 22 maig de 2014 18:38:07 UTC+2, Bryan Van de ven va escriure:
Actually just deleting those lines will leave a white background, not transparent. It looks like we neglected the possibility of background alpha. It should be a simple fix, I will put in in master today, and also upload (and announce) some dev builds later as well.

Regarding the second question, very astute observation, it was just to set up the plot plot properties. The best way to do that now is with “figure()” though note, figure() does not create a plot on an existing one, or sets up properties for the next plot created. In this case there is not one, so the curplot() immediately after will fail. Those commands need to be moved later. I will update the example and push that to master as well.

--
Bryan Van de Ven
Continuum Analytics

On May 22, 2014 at 11:25:28 AM, Damian Avila (damian...@continuum.io) wrote:
> Hi Mike,
>
> To have transparent background just comment or delete the lines 71-72 (you
> can use those properties to choose any color you want).
>
> Regarding your second question...
>
> you can use figure() to configure the plot appearance, but you can also
> pass these properties to the glyph: line(), rect(), etc...
>
> http://bokeh.pydata.org/docs/user_guide.html#plots
>
> There is probably several ways to draw things using Bokeh (according with
> some specific needs) but I would suggest the pattern showed in the Bokeh
> tutorial: http://bokeh.pydata.org/tutorial/index.html, as a starting point.
>
> Damián
>
>
>
> On Wed, May 21, 2014 at 7:57 PM, Mike Schiller wrote:
>
> > I'm trying to modify burtin.py (in examples/plotting/file) so that the
> > resulting png will have a transparent background, but can't seem to figure
> > out how to go about that. Could someone point me in the right direction?
> >
> > Also, I'm a bit confused as to the point of the line 65 of
> > https://github.com/ContinuumIO/bokeh/blob/master/examples/plotting/server/burtin.py
> >
> > While it seems to be instantiating the buttons on the resulting web page,
> > I can change the first two arguments to be empty lists with no apparent
> > affect. However, if I remove the line entirely, the plot.x_range statement
> > on line 68 fails because there wasn't a current plot on line 67. Is this a
> > typical way of initializing things, or is there a better pattern to follow?
> >
> > Thanks,
> > Mike
> >
> > --
> > 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/befdcbab-9cca-4e32-94d9-4d8c07b38c62%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+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/CAM9Ly3G%3DmoKV%2B5G4Me1Zwm-L7%2B_RcWxu1miQFOzR7eXwP%3DuyiA%40mail.gmail.com\.
> 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/ab784cec-008a-4dce-ad82-ae2d9f5fa7a2%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