问题
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