Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparent legend in Bokeh

In Matplotlib the legend function has a keyword argument called fancybox that makes the legend slightly transparent to see the lines behind the legend. Here is an example function call:

import matplotlib.pyplot as plt
plt.legend(fontsize='xx-small', loc='best', fancybox=True)

I can't find anything similar to this in Bokeh. Does anyone know if Bokeh has the functionality to make a plot transparent without going behind the scenes and monkey patching something in for it? Thanks.

like image 827
Kyle Siegel Avatar asked Dec 25 '22 15:12

Kyle Siegel


1 Answers

I'm using bokeh 1.0.2 and the following worked for me:

# Make legend fully transparent
plot.legend.background_fill_alpha = 0.0
like image 64
aimfeld Avatar answered Jan 04 '23 23:01

aimfeld