在散景中线性和对数刻度之间切换
发布于 2021-01-29 15:05:13
关注者
0
被浏览
85
1 个回答
-
一种可能的解决方案是将线性图和对数图都放入Tab中,例如:
from bokeh.plotting import figure, show from bokeh.models.widgets import Tabs, Panel panels = [] for axis_type in ["linear", "log"]: fig = figure(x_axis_type=axis_type, y_axis_type=axis_type) fig.scatter(x=[1,10,100,1000], y=[1,10,100,1000]) panel = Panel(child=fig, title=axis_type) panels.append(panel) tabs = Tabs(tabs=panels) show(tabs)
另外,您也可以
bokeh.models.widgets.Button
使用CustomJS回调来连接,以更改打印范围,但是对我来说,上面的操作似乎更容易一些。