I feel like this is a pretty dumb question and that there’s a simple answer, but after several hours going through the docs, source, and list archives I absolutely cannot find it.
I’m trying to plot data with one or both axes on a log scale. When I want log base 10, I set the _axis_type to “log”, and everything works great. If I want base 2, I’m completely at a loss for how to accomplish it. With the bokeh.models.AdaptiveTicker, I can indeed set the axis ticker to log2, but the scale still stays at either log10 or linear, depending on how I have my axis_type set.
I’m guessing at this point the functionality to do this in some sort of automatic way isn’t there, but I can’t even find a way to hack it up so both the scale and the ticks are log2.
from bokeh.plotting import figure, output_file, show
p = figure(x_axis_type="log")
p.circle([1, 5, 25, 125, 526], [1,2,3,4,5])
p.xaxis[0].ticker.base p.xaxis[0].ticker.base = 5
# this is the trick
p.xaxis[0].formatter.ticker p.xaxis[0].formatter.ticker = p.xaxis[0].ticker
output_file("foo.html")
show(p)
The tick formatter is supposed to get automatically wired up to the corresponding ticker, but isn't for some reason. It used to, but that got broken at some point. Fortunately setting it by hand works fine.
Can you submit a GitHub issue with all this information so that this can be fixed at some point?
I feel like this is a pretty dumb question and that there's a simple answer, but after several hours going through the docs, source, and list archives I absolutely cannot find it.
I'm trying to plot data with one or both axes on a log scale. When I want log base 10, I set the _axis_type to "log", and everything works great. If I want base 2, I'm completely at a loss for how to accomplish it. With the bokeh.models.AdaptiveTicker, I can indeed set the axis ticker to log2, but the scale still stays at either log10 or linear, depending on how I have my axis_type set.
I'm guessing at this point the functionality to do this in some sort of automatic way isn't there, but I can't even find a way to hack it up so both the scale and the ticks are log2.
Sorry, the code got formatted badly, let's try again:
from bokeh.plotting import figure, output_file, show
p = figure(x_axis_type="log")
p.circle([1, 5, 25, 125, 526], [1,2,3,4,5])
p.xaxis[0].ticker.base = 5
# this is the trick
p.xaxis[0].formatter.ticker = p.xaxis[0].ticker
output_file("foo.html")
show(p)
Thanks,
Bryan
···
On Oct 4, 2016, at 3:05 PM, Bryan Van de Ven <[email protected]> wrote:
Hi, there is is a small regression. This works:
from bokeh.plotting import figure, output_file, show
p = figure(x_axis_type="log")
p.circle([1, 5, 25, 125, 526], [1,2,3,4,5])
p.xaxis[0].ticker.base p.xaxis[0].ticker.base = 5
# this is the trick
p.xaxis[0].formatter.ticker p.xaxis[0].formatter.ticker = p.xaxis[0].ticker
output_file("foo.html")
show(p)
The tick formatter is supposed to get automatically wired up to the corresponding ticker, but isn't for some reason. It used to, but that got broken at some point. Fortunately setting it by hand works fine.
Can you submit a GitHub issue with all this information so that this can be fixed at some point?
I feel like this is a pretty dumb question and that there's a simple answer, but after several hours going through the docs, source, and list archives I absolutely cannot find it.
I'm trying to plot data with one or both axes on a log scale. When I want log base 10, I set the _axis_type to "log", and everything works great. If I want base 2, I'm completely at a loss for how to accomplish it. With the bokeh.models.AdaptiveTicker, I can indeed set the axis ticker to log2, but the scale still stays at either log10 or linear, depending on how I have my axis_type set.
I'm guessing at this point the functionality to do this in some sort of automatic way isn't there, but I can't even find a way to hack it up so both the scale and the ticks are log2.
Well AFAIK it's not really documented much, because it's supposed to be wired up automatically. As I mentioned, a GH issue will help us remember to fix it.