I saw on parameters of density heatmap that they have an opacity parameter. I need it so it can have an overlay on an image. But when I use the parameter it gives an error that opacity doesn’t exist.
Any suggestions on how to solve this? Thanks in advance
you are right about the error, I get the same. Maybe a workaround like this could do the trick:
def change_color(plotly_color, opacity=1.0):
# set empty list
chgd_plotly_color=[]
# loop over colors in list
for color in plotly_color:
color_string = color.replace('rgb', 'rgba')
color_string = color_string.replace(')',f', {str(opacity)})')
chgd_plotly_color.append(color_string)
return chgd_plotly_color