New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial range calculation for log plots can cause empty plots #5576

Closed
clairetang6 opened this Issue Dec 16, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@clairetang6
Contributor

clairetang6 commented Dec 16, 2016

PR 5477 introduced a bug where plots can show up empty if the initial range calculation returns NaN (when data values are <=0 or None).

Before PR 5477 the code below produced:
image

After PR 5477:
image

from bokeh.plotting import figure, output_file, show
from bokeh.layouts import gridplot

output_file('initial_log_range')

x = [1, 2, 3]

# fig1
y = [0.1, 0.2, 0.9]
fig1 = figure(y_axis_type='log', plot_width=300, plot_height=300)
fig1.line(x,y)

# fig2
y = [None, 0.2, 0.9]
fig2 = figure(y_axis_type='log', plot_width=300, plot_height=300)
fig2.line(x,y)

# fig3
y = [-10, 0.2, 0.9]
fig3 = figure(y_axis_type='log', plot_width=300, plot_height=300)
fig3.line(x,y)

# fig4
y = [-10, 0.2, 10]
fig4 = figure(y_axis_type='log', plot_width=300, plot_height=300)
fig4.line(x,y)

grid = gridplot([[fig1, fig2],[fig3, fig4]])

show(grid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment