Closed david-cortes closed 2 months ago
For geom_smooth
the alpha
aesthetic only applies to the confidence interval because commonly, you only want to see through that area and not the line.
You can set the colour of the line to rgba hex value e.g. color="#00000077"
to get a transparent line.
Or, if you are mapping the color to a variable, you use staged evaluation to modify the color from rgb to rgba i.e.
aes(color=stage("col1", after_scale="make_transparent(color)"))
where
def make_transparent(rgb_seq):
return [f"{c}77" for c in rgb_seq]
Passing argument
alpha
togeom_smooth
doesn't end up applying transparency.Example: