Skip to content
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 · 1 comment · Fixed by #5561
Closed

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

clairetang6 opened this issue Dec 16, 2016 · 1 comment · Fixed by #5561

Comments

@clairetang6
Copy link
Contributor

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)
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants