☰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

plotting VERY large images

Community Support
Bokeh_coder
Bokeh_coder

Hello, I am interested to know how i can plot VERY large images using the image function in Bokeh?
I have a matrix of size 11000x7000, which normal matplotlib is able to plot in around 10 seconds using around 700mb ram.
Bokeh has problems plotting it if i just try to plot using the image function.
It makes sense if Bokeh is having problems with this since its a lot of data, but i really need to plot this, and even link this plot to plots such that linked zooming and panning is avilable. I furthermore need to reverse the y-axis to have 0,0 in top left corner.
Using normal Bokeh image function i can achieve this by reversing yrange and set negative dh in image.

So my question is, how can i go about achieving this in Bokeh?
Do i need to make use of Bokeh server? Datashader? Other?
Please advice, thank you.

⌁   Link to post
Will_Kew
Will_Kew

11000x7000 sounds very large. I suspect you want to use Datashader for this sort of work.
Unless you plot a 11000x7000 pixel image, you wont see every datapoint anyway, so some form of downsampling is required.

···

On Monday, 18 July 2016 06:23:47 UTC+1, Bokeh coder wrote:

Hello, I am interested to know how i can plot VERY large images using the image function in Bokeh?
I have a matrix of size 11000x7000, which normal matplotlib is able to plot in around 10 seconds using around 700mb ram.
Bokeh has problems plotting it if i just try to plot using the image function.
It makes sense if Bokeh is having problems with this since its a lot of data, but i really need to plot this, and even link this plot to plots such that linked zooming and panning is avilable. I furthermore need to reverse the y-axis to have 0,0 in top left corner.
Using normal Bokeh image function i can achieve this by reversing yrange and set negative dh in image.

So my question is, how can i go about achieving this in Bokeh?
Do i need to make use of Bokeh server? Datashader? Other?
Please advice, thank you.

⌁   Link to post
Bryan
Bryan

I also definitely recommend looking into Datashader. You're never going to want to send 700mb (more, realistically, given how Bokeh currently serializes arrays) into the browser. Even if you could, it's far more pixels than can be displayed at once.

Another option is to downsample the full image yourself in a bokeh app, based on the current plot size and bounds, but I would recommend looking at Datashader first.

Bryan

···

On Jul 18, 2016, at 9:16 AM, Will Kew <popher@gmail.com> wrote:

11000x7000 sounds very large. I suspect you want to use Datashader for this sort of work.
Unless you plot a 11000x7000 pixel image, you wont see every datapoint anyway, so some form of downsampling is required.

On Monday, 18 July 2016 06:23:47 UTC+1, Bokeh coder wrote:
Hello, I am interested to know how i can plot VERY large images using the image function in Bokeh?
I have a matrix of size 11000x7000, which normal matplotlib is able to plot in around 10 seconds using around 700mb ram.
Bokeh has problems plotting it if i just try to plot using the image function.
It makes sense if Bokeh is having problems with this since its a lot of data, but i really need to plot this, and even link this plot to plots such that linked zooming and panning is avilable. I furthermore need to reverse the y-axis to have 0,0 in top left corner.
Using normal Bokeh image function i can achieve this by reversing yrange and set negative dh in image.

So my question is, how can i go about achieving this in Bokeh?
Do i need to make use of Bokeh server? Datashader? Other?
Please advice, thank you.

--
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/d5ca5ad9-d281-446f-bf68-8ba423b83386%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
Bokeh_coder
Bokeh_coder

Hi Bryan,
Thank you for your fast response.
I suspected looking into datashader was the way to go.
Do you know if datashader can work with raster data?
I was concerned that it might only work for point-data because i have not really been able to find any raster examples with datashader.

Also, can i do things like invert y-axis using a datashader and link it to other bokeh plots to share eg. panning and zooming properties?

···

On Monday, July 18, 2016 at 4:41:55 PM UTC+2, Bryan Van de ven wrote:

I also definitely recommend looking into Datashader. You’re never going to want to send 700mb (more, realistically, given how Bokeh currently serializes arrays) into the browser. Even if you could, it’s far more pixels than can be displayed at once.

Another option is to downsample the full image yourself in a bokeh app, based on the current plot size and bounds, but I would recommend looking at Datashader first.

Bryan

On Jul 18, 2016, at 9:16 AM, Will Kew pop...@gmail.com wrote:

11000x7000 sounds very large. I suspect you want to use Datashader for this sort of work.
Unless you plot a 11000x7000 pixel image, you wont see every datapoint anyway, so some form of downsampling is required.

On Monday, 18 July 2016 06:23:47 UTC+1, Bokeh coder wrote:

Hello, I am interested to know how i can plot VERY large images using the image function in Bokeh?

I have a matrix of size 11000x7000, which normal matplotlib is able to plot in around 10 seconds using around 700mb ram.

Bokeh has problems plotting it if i just try to plot using the image function.

It makes sense if Bokeh is having problems with this since its a lot of data, but i really need to plot this, and even link this plot to plots such that linked zooming and panning is avilable. I furthermore need to reverse the y-axis to have 0,0 in top left corner.

Using normal Bokeh image function i can achieve this by reversing yrange and set negative dh in image.

So my question is, how can i go about achieving this in Bokeh?

Do i need to make use of Bokeh server? Datashader? Other?

Please advice, thank you.

–
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/d5ca5ad9-d281-446f-bf68-8ba423b83386%40continuum.io.

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

⌁   Link to post
Bryan
Bryan

Hi,

I'm not sure whether it is supported in Datashader yet or not, but I know it has been mentioned. Datashader is a young project, but also at the stage where motivating use cases from user's can be a big driver for new features. If you have the time and ability to help advocate and participate I imagine the results could be a great benefit to the wider community.

Of course, you may be on a tight time schedule. If you need something today/tomorrow, etc then explicit downsampling your own Bokeh app is probably the best quick path.

For the other questions, I'll have to defer to the datashader devs.

Bryan

···

On Jul 18, 2016, at 10:10 AM, Bokeh coder <michaelsvenna@gmail.com> wrote:

Hi Bryan,
Thank you for your fast response.
I suspected looking into datashader was the way to go.
Do you know if datashader can work with raster data?
I was concerned that it might only work for point-data because i have not really been able to find any raster examples with datashader.

Also, can i do things like invert y-axis using a datashader and link it to other bokeh plots to share eg. panning and zooming properties?

On Monday, July 18, 2016 at 4:41:55 PM UTC+2, Bryan Van de ven wrote:
I also definitely recommend looking into Datashader. You're never going to want to send 700mb (more, realistically, given how Bokeh currently serializes arrays) into the browser. Even if you could, it's far more pixels than can be displayed at once.

Another option is to downsample the full image yourself in a bokeh app, based on the current plot size and bounds, but I would recommend looking at Datashader first.

Bryan

> On Jul 18, 2016, at 9:16 AM, Will Kew <pop...@gmail.com> wrote:
>
> 11000x7000 sounds very large. I suspect you want to use Datashader for this sort of work.
> Unless you plot a 11000x7000 pixel image, you wont see every datapoint anyway, so some form of downsampling is required.
>
> On Monday, 18 July 2016 06:23:47 UTC+1, Bokeh coder wrote:
> Hello, I am interested to know how i can plot VERY large images using the image function in Bokeh?
> I have a matrix of size 11000x7000, which normal matplotlib is able to plot in around 10 seconds using around 700mb ram.
> Bokeh has problems plotting it if i just try to plot using the image function.
> It makes sense if Bokeh is having problems with this since its a lot of data, but i really need to plot this, and even link this plot to plots such that linked zooming and panning is avilable. I furthermore need to reverse the y-axis to have 0,0 in top left corner.
> Using normal Bokeh image function i can achieve this by reversing yrange and set negative dh in image.
>
> So my question is, how can i go about achieving this in Bokeh?
> Do i need to make use of Bokeh server? Datashader? Other?
> Please advice, thank you.
>
>
> --
> 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/d5ca5ad9-d281-446f-bf68-8ba423b83386%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/dbbdf920-6fee-4d68-9051-9584d2193513%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
Bokeh_coder
Bokeh_coder

Allright,
Datashader definitly does look like a good way to go…but might have to use a simpler intermediate approach then until it gets more ready…
We would most likely want to contribute to datashader, if we see the usecase…which i think we do.
Could this be an alternative to using pre-tiling/tilerenderer for very large images ?

···

On Monday, July 18, 2016 at 5:47:46 PM UTC+2, Bryan Van de ven wrote:

Hi,

I’m not sure whether it is supported in Datashader yet or not, but I know it has been mentioned. Datashader is a young project, but also at the stage where motivating use cases from user’s can be a big driver for new features. If you have the time and ability to help advocate and participate I imagine the results could be a great benefit to the wider community.

Of course, you may be on a tight time schedule. If you need something today/tomorrow, etc then explicit downsampling your own Bokeh app is probably the best quick path.

For the other questions, I’ll have to defer to the datashader devs.

Bryan

On Jul 18, 2016, at 10:10 AM, Bokeh coder michae...@gmail.com wrote:

Hi Bryan,

Thank you for your fast response.

I suspected looking into datashader was the way to go.

Do you know if datashader can work with raster data?

I was concerned that it might only work for point-data because i have not really been able to find any raster examples with datashader.

Also, can i do things like invert y-axis using a datashader and link it to other bokeh plots to share eg. panning and zooming properties?

On Monday, July 18, 2016 at 4:41:55 PM UTC+2, Bryan Van de ven wrote:

I also definitely recommend looking into Datashader. You’re never going to want to send 700mb (more, realistically, given how Bokeh currently serializes arrays) into the browser. Even if you could, it’s far more pixels than can be displayed at once.

Another option is to downsample the full image yourself in a bokeh app, based on the current plot size and bounds, but I would recommend looking at Datashader first.

Bryan

On Jul 18, 2016, at 9:16 AM, Will Kew pop...@gmail.com wrote:

11000x7000 sounds very large. I suspect you want to use Datashader for this sort of work.
Unless you plot a 11000x7000 pixel image, you wont see every datapoint anyway, so some form of downsampling is required.

On Monday, 18 July 2016 06:23:47 UTC+1, Bokeh coder wrote:
Hello, I am interested to know how i can plot VERY large images using the image function in Bokeh?
I have a matrix of size 11000x7000, which normal matplotlib is able to plot in around 10 seconds using around 700mb ram.
Bokeh has problems plotting it if i just try to plot using the image function.
It makes sense if Bokeh is having problems with this since its a lot of data, but i really need to plot this, and even link this plot to plots such that linked zooming and panning is avilable. I furthermore need to reverse the y-axis to have 0,0 in top left corner.
Using normal Bokeh image function i can achieve this by reversing yrange and set negative dh in image.

So my question is, how can i go about achieving this in Bokeh?
Do i need to make use of Bokeh server? Datashader? Other?
Please advice, thank you.

–
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/d5ca5ad9-d281-446f-bf68-8ba423b83386%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/dbbdf920-6fee-4d68-9051-9584d2193513%40continuum.io.

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

⌁   Link to post
Bryan
Bryan

Yes, that is absolutely one of the primary use-cases.

Bryan

···

On Jul 18, 2016, at 11:02 AM, Bokeh coder <michaelsvenna@gmail.com> wrote:

Allright,
Datashader definitly does look like a good way to go...but might have to use a simpler intermediate approach then until it gets more ready..
We would most likely want to contribute to datashader, if we see the usecase..which i think we do.
Could this be an alternative to using pre-tiling/tilerenderer for very large images ?

⌁   Link to post
Bokeh_coder
Bokeh_coder

ok, but as i recall bokeh also has a tilerenderer.

When should one use datashader and when should tilerenderer then be used?

Or will the datashader in the long run completely replace the tilerenderer?

···

On Tue, Jul 19, 2016 at 3:42 PM, Bryan Van de Ven bryan@bokeh.org wrote:

On Jul 18, 2016, at 11:02 AM, Bokeh coder michaelsvenna@gmail.com wrote:

Allright,

Datashader definitly does look like a good way to go…but might have to use a simpler intermediate approach then until it gets more ready…

We would most likely want to contribute to datashader, if we see the usecase…which i think we do.

Could this be an alternative to using pre-tiling/tilerenderer for very large images ?

Yes, that is absolutely one of the primary use-cases.

Bryan

–

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/AA8A938D-F092-49CC-A853-CCFE2DB2E421%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

⌁   Link to post
Bryan
Bryan

Michael,

That's a very broad question. I am not sure there's any concrete advice to give absent details and context. There is potentially some overlap once DataShader supports image like data sources, but I don't imagine DataShader completely displacing tiled data sources, which are in wide and common use. For instance DataShader will probably not have much or anything to say offer tiled maps.

Bryan

···

On Jul 19, 2016, at 9:23 AM, Michael Hansen <michaelsvenna@gmail.com> wrote:

ok, but as i recall bokeh also has a tilerenderer.
When should one use datashader and when should tilerenderer then be used?
Or will the datashader in the long run completely replace the tilerenderer?

On Tue, Jul 19, 2016 at 3:42 PM, Bryan Van de Ven <bryan@bokeh.org> wrote:

> On Jul 18, 2016, at 11:02 AM, Bokeh coder <michaelsvenna@gmail.com> wrote:
>
> Allright,
> Datashader definitly does look like a good way to go...but might have to use a simpler intermediate approach then until it gets more ready..
> We would most likely want to contribute to datashader, if we see the usecase..which i think we do.
> Could this be an alternative to using pre-tiling/tilerenderer for very large images ?

Yes, that is absolutely one of the primary use-cases.

Bryan

--
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/AA8A938D-F092-49CC-A853-CCFE2DB2E421%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/CAPty9BPs9m62m7NuM4paUX4ryL21a-1RcAku8BmQ9UbTFG%2B-Lg%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
Peter_Wang1
Peter_Wang1

The tilerenderer is used for spatial, well, tiling. :slight_smile: So, if the expected interaction mode for your visualization is that the user will be looking at limited spatial sub-regions of the larger dataset, then a tilerenderer makes sense. If, however, the user is going to be regularly changing their level of zoom as part of their interaction, and if there is widely varying information density between different regions of the data/image/map, then it makes sense to use Datashader, because it can faithfully handle that variation in data density, at arbitrary zoom levels.

Also, for dynamic data, datashader will be more suitable, because the pipeline approach lends itself to updating data, while most tile-based approaches have some process to generate static tiles a priori.

Hope that helps,

Peter

···

On Tue, Jul 19, 2016 at 9:23 AM, Michael Hansen michaelsvenna@gmail.com wrote:

ok, but as i recall bokeh also has a tilerenderer.

When should one use datashader and when should tilerenderer then be used?

Or will the datashader in the long run completely replace the tilerenderer?

–

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/CAPty9BPs9m62m7NuM4paUX4ryL21a-1RcAku8BmQ9UbTFG%2B-Lg%40mail.gmail.com.

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

–

On Tue, Jul 19, 2016 at 3:42 PM, Bryan Van de Ven bryanv@continuum.io wrote:

On Jul 18, 2016, at 11:02 AM, Bokeh coder michaelsvenna@gmail.com wrote:

Allright,

Datashader definitly does look like a good way to go…but might have to use a simpler intermediate approach then until it gets more ready…

We would most likely want to contribute to datashader, if we see the usecase…which i think we do.

Could this be an alternative to using pre-tiling/tilerenderer for very large images ?

Yes, that is absolutely one of the primary use-cases.

Bryan

–

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/AA8A938D-F092-49CC-A853-CCFE2DB2E421%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Peter Wang

CTO, Co-founder

[External image unavailable in archive]

⌁   Link to post
Bokeh_coder
Bokeh_coder

Thank you for the answers.

That makes sense.

The reason i asked about the raster images is because i saw this example:
https://github.com/bokeh/datashader/blob/master/examples/raster.py

But it sounds like i should look closer at the tiler then…

I will most likely try both on my data though and see what works best.

···

On Tue, Jul 19, 2016 at 4:47 PM, Peter Wang pwang@continuum.io wrote:

The tilerenderer is used for spatial, well, tiling. :slight_smile: So, if the expected interaction mode for your visualization is that the user will be looking at limited spatial sub-regions of the larger dataset, then a tilerenderer makes sense. If, however, the user is going to be regularly changing their level of zoom as part of their interaction, and if there is widely varying information density between different regions of the data/image/map, then it makes sense to use Datashader, because it can faithfully handle that variation in data density, at arbitrary zoom levels.

Also, for dynamic data, datashader will be more suitable, because the pipeline approach lends itself to updating data, while most tile-based approaches have some process to generate static tiles a priori.

Hope that helps,

Peter

–

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/CABGrp%2B95o_RO-t1iJYGaimYQv_0JaGeEa3sbC%3DLUsCtnH%3Dj-YA%40mail.gmail.com.

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

On Tue, Jul 19, 2016 at 9:23 AM, Michael Hansen michaelsvenna@gmail.com wrote:

ok, but as i recall bokeh also has a tilerenderer.

When should one use datashader and when should tilerenderer then be used?

Or will the datashader in the long run completely replace the tilerenderer?

–

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/CAPty9BPs9m62m7NuM4paUX4ryL21a-1RcAku8BmQ9UbTFG%2B-Lg%40mail.gmail.com.

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

–
Peter Wang

CTO, Co-founder

[External image unavailable in archive]

On Tue, Jul 19, 2016 at 3:42 PM, Bryan Van de Ven bryan@bokeh.org wrote:

On Jul 18, 2016, at 11:02 AM, Bokeh coder michaelsvenna@gmail.com wrote:

Allright,

Datashader definitly does look like a good way to go…but might have to use a simpler intermediate approach then until it gets more ready…

We would most likely want to contribute to datashader, if we see the usecase…which i think we do.

Could this be an alternative to using pre-tiling/tilerenderer for very large images ?

Yes, that is absolutely one of the primary use-cases.

Bryan

–

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/AA8A938D-F092-49CC-A853-CCFE2DB2E421%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