四边形与散景中的对数轴

问题描述:

当数字有y_axis_type='log'时可以使用figure.quad()吗?我可以绘制日志转换的四元组。我也可以在一个日志轴上绘制一条具有相同值的线。但是当我尝试在一个对数坐标轴上绘制一个四元组时,我得到一个空白图。我正在使用散景0.12.9。下面是一些测试代码与预期输出...四边形与散景中的对数轴

from bokeh.io import export_png 
from bokeh.layouts import gridplot 
from bokeh.plotting import figure 
import numpy as np 

N = 50 
left = np.arange(N) 
right = np.arange(1, N+1) 
bottom = np.zeros(N) 
top = 100 * np.sin(np.pi*left/N)**2 + 1 

fig_args = dict(width=400, height=400, tools="") 

f1 = figure(**fig_args, title='Quad') 
f1.quad(left=left, right=right, top=top, bottom=bottom, line_color='black') 

f2 = figure(**fig_args, title='Quad of Logs') 
f2.quad(left=left, right=right, top=np.log10(top), bottom=bottom, line_color='black') 

f3 = figure(**fig_args, y_axis_type='log', title='Line w/Log Axis') 
f3.line(left, top) 

f4 = figure(**fig_args, y_axis_type='log', title='Quad w/Log Axis') 
f4.quad(left=left, right=right, top=top, bottom=bottom, line_color='black') 

lout = gridplot([f1, f2, f3, f4], ncols=2) 
export_png(lout, 'test.png') 

enter image description here

仍然有悬而未决的问题,以确定如何最好有背景虚化的日志处理秤零点。从纯粹的数学观点来看,它们没有多大意义。有几种可行的实用方法可供采用,但其中没有一个已经实施。但是,如果你提供明确的方向,你可以得到你需要的情节。您可以通过使用比0以外的东西作为bottom值,明确设置y_range看到这一点:

f4 = figure(**fig_args, y_axis_type='log', title='Quad w/Log Axis', y_range=(1, 200)) 
f4.quad(left=left, right=right, top=top, bottom=0.000000001, line_color='black') 

息率这一形象:

enter image description here