简体   繁体   English

散景:具有解耦 y 轴的 Wheel_Zoom

[英]Bokeh: Wheel_Zoom with decoupled y-Axis

I render a plot in Bokeh using two independent y-Axis:我使用两个独立的 y 轴在散景中渲染一个图:

    pAltitude = figure(plot_width=800, plot_height=300, x_range=pElev.x_range)
    pAltitude.extra_y_ranges = {"speed": Range1d(50, 120)}
    pAltitude.add_layout(LinearAxis(y_range_name="speed"), 'right')

When this plot is shown in the browser I can use the wheel_zoom tool to zoom in and out of the plot.When hovering the mouse over the x-axis, only the timescale is zoomed in and out, when hovering over one of the y-axis, only the y-scale is zoomed.当这个图显示在浏览器中时,我可以使用 wheel_zoom 工具来放大和缩小图。当鼠标悬停在 x 轴上时,只有时间刻度被放大和缩小,当悬停在 y 轴之一上时轴,仅缩放 y 尺度。

So far, so good: Is there a possibility to decouple the two y-axis for wheel zooming (and panning)?到目前为止,一切都很好:是否有可能将两个 y 轴解耦以进行轮缩放(和平移)?

I'd like to have only the ordinary y-axis zoomed when hovering over it and only the extra y-axis zoomed when hovering over that one.我希望在悬停在普通 y 轴上时仅缩放普通 y 轴,而在悬停在该轴上时仅缩放额外的 y 轴。

Currently, both axis are coupled ad I cannot zoom or pan them individually.目前,两个轴都是耦合的,我无法单独缩放或平移它们。

Thanks a lot!非常感谢!

However然而

It is not currently possible (as of version 1.4, and upcoming 2.0) to uncouple "twin" axes.目前不可能(从 1.4 版和即将推出的 2.0 版开始)解耦“双”轴。 Scaling one range will always scale the other by the same relative amount.缩放一个范围将始终按相同的相对量缩放另一个范围。

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

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