Selectively show text in Bokeh plot based on zoom level

早过忘川 提交于 2021-02-08 11:27:29

问题


I am currently using Bokeh to plot some biological sequence data. Part of the plot involves displaying some text (amino acid residues) just above the x-axis, aligned with the numbers on the axis. When the user zooms in, they are then able to inspect the amino acid sequence (represented by single letters) that accompanies the data. However, when zoomed out, these letters merge together, and look quite messy.

Is there any way to selectively plot/show glyphs depending on the zoom level?

Many thanks,

Andrew


回答1:


There is currently (as of version 0.7.1) no way to do this with static plots. It would probably be possible to make this work one way or another using a Bokeh server app, but that might otherwise be overkill for your situation. Adding some way to "spell" things like this in python and have them go into static plots would be a really nice feature. I encourage you to create a feature request issue on GH (https://github.com/bokeh/bokeh) so that the idea can be discussed among the devs and other interested parties.



来源:https://stackoverflow.com/questions/28164874/selectively-show-text-in-bokeh-plot-based-on-zoom-level

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!