Closed
Description
I'd like to set point transparency using html hex code
I don't want a separate alpha legend, just the colour one to be transparent. Although this works for the points themselves, the transparency doesn't seem to propagate to the legend when using set_colour_manual
In R, I might use override.aes
but I haven't found the equivalent in plotnine
Any suggestions?
import numpy as np
import pandas as pd
from plotnine import *
data = np.random.rand(20, 4)
df = pd.DataFrame(data)
df.columns = ['x', 'facet 1', 'facet 2', 'facet 3']
df['label'] = ['label 1']*10 + ['label 2']*5 + ['label 3']*5
df = pd.melt(df, id_vars=['x', 'label'])
g=(ggplot(df)
+ aes(x='x', y='value', color='label')
+ geom_point(size=10)
+ theme_seaborn('white')
+ scale_colour_manual({'label 1': 'orange', 'label 2': 'red', 'label 3': '#0000FF4D'})
)