Python Bokeh日志轴格式为十进制

Python Bokeh日志轴格式为十进制,python,python-3.x,bokeh,Python,Python 3.x,Bokeh,例如,我想用带有对数轴的Bokeh在python中绘制一个轴,但是标签是用科学表示法(10^2),我想用整数表示法(100)。下面是示例代码和输出 import numpy as np from bokeh.plotting import figure, show, output_file x = np.linspace(0.1, 5, 80) p = figure(title="log axis example", y_axis_type="log", x_range=(0,

例如,我想用带有对数轴的Bokeh在python中绘制一个轴,但是标签是用科学表示法(10^2),我想用整数表示法(100)。下面是示例代码和输出

import numpy as np

from bokeh.plotting import figure, show, output_file

x = np.linspace(0.1, 5, 80)
p = figure(title="log axis example", y_axis_type="log",
       x_range=(0, 5), y_range=(0.001, 10**22),
       background_fill_color="#fafafa")
p.line(x, x**2, legend="y=x**2")

show(p)


非常感谢您的帮助。

使用
printfTickFormatter
指定一个勾号应该包含多少小数。有关格式化程序的详细信息:


非常感谢。我查看了LogTickFormatter,没有找到任何解决方案,但这非常有效!
import numpy as np

from bokeh.plotting import figure, show, output_file
from bokeh.models import PrintfTickFormatter

x = np.linspace(0.1, 5, 80)
p = figure(title="log axis example", y_axis_type="log",
       x_range=(min(x)-0.1, max(x)+0.1), y_range=(min(x**2), max(x**2)),
       background_fill_color="#fafafa")
p.line(x, x**2, legend="y=x**2")
p.yaxis[0].formatter = PrintfTickFormatter(format="%5f")

show(p)