1

I wanted to create a weibull probability plot using Bokeh. Based on the reference (linked below),

https://www.itl.nist.gov/div898/handbook/eda/section3/weibplot.htm

The y-axis of a weibull probability plot has an axes with scale: ln(-ln(1-p)). Let's say that I have defined a function (with it's inverse function),

import numpy as np

def forward(X):
    return np.log(-np.log(1 - X))

def inverse(Y):
    return 1 - np.exp(-np.exp(Y))

Using matplotlib.pyplot (from https://matplotlib.org/stable/gallery/scales/scales.html), I could use those function for setting the y-axis' scale on pyplot by,

import matplotlib.pyplot as plt

fig, ax = .........
ax.set_yscale('function', functions=(forward, inverse))

How can I achieve that (setting y-axis scale using function) on Bokeh?

rahmadidr
  • 13
  • 3

1 Answers1

0

Scale application actually happens in JavaScript, in the browser, not in any Python code. So no Python functions are relevant to the question with respect to Bokeh. As of version 2.3.1, only categorical , linear, and (standard) log scales are supported in the BokehJS client library.

bigreddot
  • 33,642
  • 5
  • 69
  • 122
  • Thank you very much for the answer. So probably, I will use other library. Do you have any recommendation for other libraries that could support plotting with custom (using function) axes, with output in HTML since I am currently developing data visualization in a web page? I tried to use mpld3, but it could not recognize my axes (using function) also. – rahmadidr Apr 13 '21 at 04:57
  • I don't have any. Mpld3 (which is a dead, unmaintained project for 5+ years now btw) has the same situation. Python code generates a *static data structure* up front, that is sent to a JS client library that does the actual rendering and interaction. Same for Plotly or Altair. For completeness, I will mention that Bokeh can support custom JS extensions, but creating a custom extension scale would be an advanced usage: https://docs.bokeh.org/en/latest/docs/user_guide/extensions.html – bigreddot Apr 13 '21 at 16:11