简体   繁体   中英

Selectively show text in Bokeh plot based on zoom level

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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