根据缩放级别在散景图中有选择地显示文本 [英] Selectively show text in Bokeh plot based on zoom level

查看:49
本文介绍了根据缩放级别在散景图中有选择地显示文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Bokeh绘制一些生物序列数据.该图的一部分涉及在x轴上方显示一些文本(氨基酸残基),并与该轴上的数字对齐.当用户放大时,他们便可以检查数据随附的氨基酸序列(用单个字母表示).但是,当缩小时,这些字母会合并在一起,看起来非常凌乱.

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?

非常感谢,

安德鲁

推荐答案

当前(自版本0.7.1起)无法使用静态图进行此操作.可以使用Bokeh服务器应用程序以一种或另一种方式进行此工作,但是对于您的情况,这可能会显得过大.添加某种方式在python中拼写"这样的东西并使它们进入静态图将是一个非常不错的功能.我鼓励您在GH上创建功能请求问题( https://github.com/bokeh/bokeh ),以便可以在开发者和其他有关方面之间讨论该想法.

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.

这篇关于根据缩放级别在散景图中有选择地显示文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆