1
當數字有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')