简体   繁体   English

Python:散景绘图使用 Function 作为比例设置垂直轴(Y 轴)

[英]Python: Bokeh Plotting Setting the Vertical Axis (Y-axis) Using Function as Scale

I wanted to create a weibull probability plot using Bokeh.我想使用 Bokeh 创建一个威布尔概率 plot。 Based on the reference (linked below),根据参考资料(如下链接),

https://www.itl.nist.gov/div898/handbook/eda/section3/weibplot.htm 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)).威布尔概率 plot 的 y 轴有一个带有刻度的轴:ln(-ln(1-p))。 Let's say that I have defined a function (with it's inverse function),假设我定义了一个 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, 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?如何在 Bokeh 上实现这一点(使用函数设置 y 轴刻度)?

Scale application actually happens in JavaScript, in the browser, not in any Python code.缩放应用程序实际上发生在 JavaScript 中,在浏览器中,而不是在任何 Python 代码中。 So no Python functions are relevant to the question with respect to Bokeh.因此,没有 Python 函数与散景问题相关。 As of version 2.3.1, only categorical, linear, and (standard) log scales are supported in the BokehJS client library.从 2.3.1 版开始,BokehJS 客户端库仅支持分类、线性和(标准)对数刻度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM