Open LinuxIsCool opened 3 years ago
For now (hvPlot 0.8.0) the workaround is to use fill_alpha
instead of alpha
, and this for the Bokeh backend.
performance.hvplot.kde(fill_alpha=1) + performance.hvplot.kde(fill_alpha=0.1)
The issue comes down to the fact that HoloViews sets the default value of fill_alpha
for Distribution elements (the element used by df.hvplot.kde
):
https://github.com/holoviz/holoviews/blob/39863f54b9c61f8608b542577a739f53ae0b8b9d/holoviews/plotting/bokeh/__init__.py#L284-L287
alpha
is a special parameter for Bokeh:
An alias to set all alpha keyword arguments at once. (default: None) Alpha values must be between 0 (fully transparent) and 1 (fully opaque). Any explicitly set values for line_alpha, etc. will override this setting.
So when any other x_alpha
parameter is set, like fill_alpha
, alpha
then just applies to the x_alpha
parameters.
@jlstevens what would you expect at the HoloViews level? Should the plot below have fill_alpha=1
?
import numpy as np
import holoviews as hv
hv.extension('bokeh')
normal = np.random.randn(1000)
hv.Distribution(normal).opts(alpha=1)
I don't think it's possible to modify the alpha channel on kde plots. The alpha parameter only modifies the borders. It would be nice to be able to modify the alpha of the distributions.
Example code: