log axes with bases other than 10?

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.

Thanks!

David

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?

Thanks,

Bryan

···

On Oct 4, 2016, at 2:54 PM, [email protected] wrote:

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.

Thanks!

David

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ef43324e-6113-4790-aea8-c03a2de4e561%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

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?

Thanks,

Bryan

On Oct 4, 2016, at 2:54 PM, [email protected] wrote:

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.

Thanks!

David

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ef43324e-6113-4790-aea8-c03a2de4e561%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

That could not possibly have been more simple. Thank you very much. I don’t know how I missed that!

···

On Tuesday, October 4, 2016 at 3:06:35 PM UTC-5, Bryan Van de ven wrote:

p.xaxis[0].ticker.base = 5

    # this is the trick

    p.xaxis[0].formatter.ticker = p.xaxis[0].ticker 

David,

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.

Thanks,

Bryan

···

On Oct 4, 2016, at 3:13 PM, [email protected] wrote:

On Tuesday, October 4, 2016 at 3:06:35 PM UTC-5, Bryan Van de ven wrote:
        p.xaxis[0].ticker.base = 5

        # this is the trick
        p.xaxis[0].formatter.ticker = p.xaxis[0].ticker

That could not possibly have been more simple. Thank you *very* much. I don't know how I missed that!

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/37aa101f-40af-4c01-b9ca-7e12abb636d1%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.