在散景图中隐藏图例 [英] Hide legend in bokeh plot

查看:59
本文介绍了在散景图中隐藏图例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

LS, 散景图会自动为图生成图例. 如何隐藏(完全不显示)Bokeh图中的图例? 我试过了:legend = 'none'.但是没有成功. 谢谢

LS, Bokeh plot automatically generates a legend for a plot. How can I hide (not show at all) the legend in a Bokeh plot ? I tried: legend = 'none'. But no success. Thanks

推荐答案

如果我可以稍微扩展一下-legend=False是使Bokeh图例不可见的正确方法,但是它在绘图本身的创建中使用,而不是被称为绘图对象的属性.我的意思是写

If I can just expand this a little - legend=False is the correct way to make the Bokeh legend invisible, but it's used within the creation of the plot itself, rather than being called as an attribute of the plot object. By which I mean, write

from bokeh.charts import Scatter
myPlot = Scatter(foo, bar, legend=False)

而不是

from bokeh.charts import Scatter
myPlot = Scatter(foo, bar)
myPlot.legend=False.

这篇关于在散景图中隐藏图例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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