Histograms

Hello,

I need to create a histogram and enable brushing and sliders to control the histogram to manipulate data in a plot next to it. However, I’m having trouble creating a histogram with existing data in a ColumnDataSource and I’m not sure if there is a simple Histogram method or if I have to create it from scratch. I do not want to use the bokeh server for this and it seems the only example I could find does. Help is appreciated, thank you!

Hi,

Just to be clear, without using the Bokeh server, there are only two options for this kind of interactivity:

* compute all possible data you might ever want to show up front, and include it all in your static HTML+JS output

* compute the histograms in Javascript

What the Bokeh server provides is the ability to use real Python code to compute the histograms on the fly, e.g. using np.histogram In any event Bokeh does not have a histogram built in, so you'd use np.histogram or similar yourself. Here is a file (non-server) example:

  https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/histogram.py

Thanks,

Bryan

···

On Sep 25, 2017, at 17:10, Allan <[email protected]> wrote:

Hello,

I need to create a histogram and enable brushing and sliders to control the histogram to manipulate data in a plot next to it. However, I'm having trouble creating a histogram with existing data in a ColumnDataSource and I'm not sure if there is a simple Histogram method or if I have to create it from scratch. I do not want to use the bokeh server for this and it seems the only example I could find does. Help is appreciated, 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 [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/afcf8ac5-1857-42f1-a1e3-b5608167521d%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks for the reply Bryan. Do you have any advice on implementing what I’m trying to do with the use of the Bokeh server? I’m not quite sure how I would enable brushing on a np.histogram.

···

On Monday, 25 September 2017 14:27:16 UTC-7, Bryan Van de ven wrote:

Hi,

Just to be clear, without using the Bokeh server, there are only two options for this kind of interactivity:

  • compute all possible data you might ever want to show up front, and include it all in your static HTML+JS output

  • compute the histograms in Javascript

What the Bokeh server provides is the ability to use real Python code to compute the histograms on the fly, e.g. using np.histogram In any event Bokeh does not have a histogram built in, so you’d use np.histogram or similar yourself. Here is a file (non-server) example:

    [https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/histogram.py](https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/histogram.py)

Thanks,

Bryan

On Sep 25, 2017, at 17:10, Allan [email protected] wrote:

Hello,

I need to create a histogram and enable brushing and sliders to control the histogram to manipulate data in a plot next to it. However, I’m having trouble creating a histogram with existing data in a ColumnDataSource and I’m not sure if there is a simple Histogram method or if I have to create it from scratch. I do not want to use the bokeh server for this and it seems the only example I could find does. Help is appreciated, 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 [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/afcf8ac5-1857-42f1-a1e3-b5608167521d%40continuum.io.

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

Hi,

I'm not really sure what exactly you want to accomplish, "brushing" is not really descriptive in any particular way. In case it is helpful, here is a server example that links selections on a scatter plot to updating histograms on the axes:

  https://github.com/bokeh/bokeh/blob/master/examples/app/selection_histogram.py

Thanks,

Bryan

···

On Sep 25, 2017, at 17:36, Allan <[email protected]> wrote:

Thanks for the reply Bryan. Do you have any advice on implementing what I'm trying to do with the use of the Bokeh server? I'm not quite sure how I would enable brushing on a np.histogram.

On Monday, 25 September 2017 14:27:16 UTC-7, Bryan Van de ven wrote:
Hi,

Just to be clear, without using the Bokeh server, there are only two options for this kind of interactivity:

* compute all possible data you might ever want to show up front, and include it all in your static HTML+JS output

* compute the histograms in Javascript

What the Bokeh server provides is the ability to use real Python code to compute the histograms on the fly, e.g. using np.histogram In any event Bokeh does not have a histogram built in, so you'd use np.histogram or similar yourself. Here is a file (non-server) example:

        https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/histogram.py

Thanks,

Bryan

> On Sep 25, 2017, at 17:10, Allan <[email protected]> wrote:
>
> Hello,
>
> I need to create a histogram and enable brushing and sliders to control the histogram to manipulate data in a plot next to it. However, I'm having trouble creating a histogram with existing data in a ColumnDataSource and I'm not sure if there is a simple Histogram method or if I have to create it from scratch. I do not want to use the bokeh server for this and it seems the only example I could find does. Help is appreciated, 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 [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/afcf8ac5-1857-42f1-a1e3-b5608167521d%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/7f25fbf4-65ed-41fc-b4fb-bf5b0d838fb0%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hello,

I want to brush like you can on the bottom two plots in this example:

https://demo.bokehplots.com/apps/stocks

Side question if you have some time, is there anyway of having a Slider() with two ‘draggers’ on one slider, so that you can for example define a range?

···

On Monday, 25 September 2017 14:46:09 UTC-7, Bryan Van de ven wrote:

Hi,

I’m not really sure what exactly you want to accomplish, “brushing” is not really descriptive in any particular way. In case it is helpful, here is a server example that links selections on a scatter plot to updating histograms on the axes:

    [https://github.com/bokeh/bokeh/blob/master/examples/app/selection_histogram.py](https://github.com/bokeh/bokeh/blob/master/examples/app/selection_histogram.py)

Thanks,

Bryan

On Sep 25, 2017, at 17:36, Allan [email protected] wrote:

Thanks for the reply Bryan. Do you have any advice on implementing what I’m trying to do with the use of the Bokeh server? I’m not quite sure how I would enable brushing on a np.histogram.

On Monday, 25 September 2017 14:27:16 UTC-7, Bryan Van de ven wrote:

Hi,

Just to be clear, without using the Bokeh server, there are only two options for this kind of interactivity:

  • compute all possible data you might ever want to show up front, and include it all in your static HTML+JS output

  • compute the histograms in Javascript

What the Bokeh server provides is the ability to use real Python code to compute the histograms on the fly, e.g. using np.histogram In any event Bokeh does not have a histogram built in, so you’d use np.histogram or similar yourself. Here is a file (non-server) example:

    [https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/histogram.py](https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/histogram.py)

Thanks,

Bryan

On Sep 25, 2017, at 17:10, Allan [email protected] wrote:

Hello,

I need to create a histogram and enable brushing and sliders to control the histogram to manipulate data in a plot next to it. However, I’m having trouble creating a histogram with existing data in a ColumnDataSource and I’m not sure if there is a simple Histogram method or if I have to create it from scratch. I do not want to use the bokeh server for this and it seems the only example I could find does. Help is appreciated, 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 [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/afcf8ac5-1857-42f1-a1e3-b5608167521d%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/7f25fbf4-65ed-41fc-b4fb-bf5b0d838fb0%40continuum.io.

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