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
p1.line(x=data['col'].astype(str), y=data['col'],
color='black',legend_label='legend')
p1.legend.visible=False
The last line hides the legend.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With