繁体   English   中英

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

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

我想使用 Bokeh 创建一个威布尔概率 plot。 根据参考资料(如下链接),

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

威布尔概率 plot 的 y 轴有一个带有刻度的轴:ln(-ln(1-p))。 假设我定义了一个 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))

如何在 Bokeh 上实现这一点(使用函数设置 y 轴刻度)?

缩放应用程序实际上发生在 JavaScript 中,在浏览器中,而不是在任何 Python 代码中。 因此,没有 Python 函数与散景问题相关。 从 2.3.1 版开始,BokehJS 客户端库仅支持分类、线性和(标准)对数刻度。

暂无
暂无

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

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