#!/usr/bin/env python # coding: utf-8 # # Parameter `alpha_stroke` in `geom_label()` # # # # Use the `alpha_stroke` parameter to enable the applying of `alpha` to `color` (label text and border). # In[1]: import numpy as np from lets_plot import * # In[2]: LetsPlot.setup_html() # In[3]: x = np.arange(1, 10) y = x[::-1] data = {'x': x, 'y': y, 'alpha': x} # In[4]: p = ggplot(data, aes(x='x', y='y', alpha='y')) + \ geom_bar(stat='identity', fill='#2b8cbe', tooltips='none') + \ guides(alpha='none') # In[5]: p + geom_label(aes(label='y'), nudge_y=1, label_format='.1f', fill='#2b8cbe') # #### Use `alpha_stroke` Parameter to Apply `alpha` to `color` # In[6]: p + geom_label(aes(label='y'), nudge_y=1, label_format='.1f', fill='#2b8cbe', alpha_stroke=True)