☰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

Rescaling

Community Support
nickle
nickle

I have a figure defined like this

returns_hist = figure(plot_width=SMALLWIDTH, plot_height=HEIGHT, tools='', title='Returns Histogram')

I then update the data in an update function in this way


hist, edges = np.histogram(data['returns'], density=True, bins=50)
returns_hist.quad(top=hist, bottom=0, left=edges[:-1], right=edges[1:], line_color="white")

What I see is that some of the data sets have very large central peaks. Other's small.

If I display a large peeked data set its fine, the y_axis rescales.

If I then display a data set with a low peak, the y_axis does not rescale.

Is there a way for forcing a rescaling?

Thanks
⌁   Link to post
Bryan
Bryan

Hi,

It's not really possible to speculate without more information. By default, "figure" uses auto-scaling DataRange1d objects for ranges. So possibly you are updating the range start/end manually (which disables further auto-scaling), or you have some other data that is preventing the scaling from only considering the histogram. More complete code would be necessary to say.

Thanks,

Bryan

···

On May 2, 2019, at 12:50 PM, nickle@gmail.com wrote:

I have a figure defined like this

returns_hist = figure(plot_width=SMALLWIDTH, plot_height=HEIGHT, tools='', title='Returns Histogram')

I then update the data in an update function in this way

hist, edges = np.histogram(data['returns'], density=True, bins=50)
returns_hist.quad(top=hist, bottom=0, left=edges[:-1], right=edges[1:], line_color="white")

What I see is that some of the data sets have very large central peaks. Other's small.

If I display a large peeked data set its fine, the y_axis rescales.

If I then display a data set with a low peak, the y_axis does not rescale.

Is there a way for forcing a rescaling?

Thanks

--
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/3bb97874-867d-447d-a162-8a1cd714f3bd%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