Hide legend in bokeh plot

左心房为你撑大大i 提交于 2019-12-12 11:16:37

问题


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


回答1:


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)

rather than

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


来源:https://stackoverflow.com/questions/39141308/hide-legend-in-bokeh-plot

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