Skip to content

Instantly share code, notes, and snippets.

@lbrito1
Created November 25, 2015 13:25
Show Gist options
  • Save lbrito1/690809f54f217e6f6b9f to your computer and use it in GitHub Desktop.
Save lbrito1/690809f54f217e6f6b9f to your computer and use it in GitHub Desktop.
Bokeh desired_num_ticks interaction with custom x_range
import numpy as np
from bokeh.plotting import figure, show, output_file
x = range(0,100)
y = x
output_file("line.html", title="line.py example")
# p = figure(title="simple line example") # Works fine
p = figure(title="simple line example", x_range=map(lambda a: str(a), x)) # Doesn't work
p.line(x,y, color="#2222aa", line_width=2)
p.xgrid[0].ticker.desired_num_ticks = 3
show(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment