☰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

y_axis_type = 'log' appears to be breaking default zoom in bokeh 0.60

Community Support
Tom
Tom

I’m using bokeh 0.60 on a mac. I’ve tried on pc also. I’m using google chrome as the web browser and ipython notebook.

I’ve been trying to use y_axis_type = ‘log’ and the same for the x_axis. It appears that even though my data starts well below 1. Say .05 which is quite far in log space, bokeh’s default zoom starts the y_axis at 1. It get this right when not in log mode. I suspect the zoomer is not taking the log space into account. I’ve seen the bug in other plotting libs before. You can see in the screenshot that the output of the y.min() is ~ .05 which is much smaller than 1.0. If you pan the plot up you will see a considerable amount of data below 1.

This is the python export of the ipython notebook that produced this example:

coding: utf-8

In[56]:

from bokeh import plotting

import numpy as np

plotting.output_notebook()

import matplotlib.pyplot as plt

cmap = plt.get_cmap(‘Spectral’)

import bokeh

bokeh.version

In[54]:

x = np.exp(np.arange(100))

y = np.exp(np.random.normal(size = 100))

size = np.random.normal(size = 100)

size -= size.min()

color =cmap(np.random.normal(size = 100), bytes = True)

color = [‘#%X%X%X’%tuple(c[:-1]) for c in color]

plotting.scatter(x,y, x_axis_type = ‘log’, y_axis_type = ‘log’, size = size*5, color = color)

plotting.show()

y.min()

In:

⌁   Link to post
Bryan
Bryan

Tom,

I will have a look (can you make an issue on GitHub with this code and screen shot?) In the meantime, you can set the range explicitly with:

  y_range=[y.min(), y.max()]

or in completeness:

  plotting.scatter(x,y, x_axis_type = 'log', y_axis_type = 'log', y_range=[y.min(), y.max()], size = size*5, color = color)

Bryan

···

On Sep 16, 2014, at 8:51 PM, Tom <tom.denniston@gmail.com> wrote:

I'm using bokeh 0.60 on a mac. I've tried on pc also. I'm using google chrome as the web browser and ipython notebook.

I've been trying to use y_axis_type = 'log' and the same for the x_axis. It appears that even though my data starts well below 1. Say .05 which is quite far in log space, bokeh's default zoom starts the y_axis at 1. It get this right when not in log mode. I suspect the zoomer is not taking the log space into account. I've seen the bug in other plotting libs before. You can see in the screenshot that the output of the y.min() is ~ .05 which is much smaller than 1.0. If you pan the plot up you will see a considerable amount of data below 1.

This is the python export of the ipython notebook that produced this example:

# coding: utf-8

# In[56]:

from bokeh import plotting

import numpy as np

plotting.output_notebook()

import matplotlib.pyplot as plt

cmap = plt.get_cmap('Spectral')

import bokeh

bokeh.__version__

# In[54]:

x = np.exp(np.arange(100))

y = np.exp(np.random.normal(size = 100))

size = np.random.normal(size = 100)

size -= size.min()

color =cmap(np.random.normal(size = 100), bytes = True)

color = ['#%X%X%X'%tuple(c[:-1]) for c in color]

plotting.scatter(x,y, x_axis_type = 'log', y_axis_type = 'log', size = size*5, color = color)

plotting.show()

y.min()

# In:

--
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/179cf002-af94-49d1-91d3-882fccedb27e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
<Screen Shot 2014-09-16 at 9.42.01 PM.png>

⌁   Link to post
Tom
Tom

Thanks Bryan,

That works. I’ll make an issue on git.

···

On Tuesday, September 16, 2014 9:51:14 PM UTC-4, Tom wrote:

I’m using bokeh 0.60 on a mac. I’ve tried on pc also. I’m using google chrome as the web browser and ipython notebook.

I’ve been trying to use y_axis_type = ‘log’ and the same for the x_axis. It appears that even though my data starts well below 1. Say .05 which is quite far in log space, bokeh’s default zoom starts the y_axis at 1. It get this right when not in log mode. I suspect the zoomer is not taking the log space into account. I’ve seen the bug in other plotting libs before. You can see in the screenshot that the output of the y.min() is ~ .05 which is much smaller than 1.0. If you pan the plot up you will see a considerable amount of data below 1.

This is the python export of the ipython notebook that produced this example:

coding: utf-8

In[56]:

from bokeh import plotting

import numpy as np

plotting.output_notebook()

import matplotlib.pyplot as plt

cmap = plt.get_cmap(‘Spectral’)

import bokeh

bokeh.version

In[54]:

x = np.exp(np.arange(100))

y = np.exp(np.random.normal(size = 100))

size = np.random.normal(size = 100)

size -= size.min()

color =cmap(np.random.normal(size = 100), bytes = True)

color = [‘#%X%X%X’%tuple(c[:-1]) for c in color]

plotting.scatter(x,y, x_axis_type = ‘log’, y_axis_type = ‘log’, size = size*5, color = color)

plotting.show()

y.min()

In:

⌁   Link to post

End of archived discussion · Replies are disabled