#!/usr/bin/env python # coding: utf-8 # In[1]: from lets_plot import * LetsPlot.setup_html() LetsPlot.set_theme(theme_grey()) # In[2]: data = { 'drink': ['coffee','tea','water', 'milk'], 'mean': [3, 4, 6, 2], 'upper': [1, 5, 7, 4], 'lower': [6, 3, 2, 1] } # In[3]: ggplot(data) + \ geom_crossbar(aes(x='drink', middle='mean', ymin='lower', ymax='upper', color='mean'), tooltips=layer_tooltips().disable_splitting()) + \ scale_color_discrete() + theme_grey() # In[4]: ggplot(data) + \ geom_crossbar(aes(x='drink', middle='mean', ymin='lower', ymax='upper', color='mean'), fill_by='color', tooltips=layer_tooltips().disable_splitting()) + \ scale_color_discrete() # In[5]: ggplot(data) + geom_crossbar(aes(x='drink', middle='mean', ymin='lower', ymax='upper', color='mean')) # In[6]: ggplot(data) + \ geom_errorbar(aes(x='drink', y='mean', ymin='lower', ymax='upper', color='mean')) + \ scale_color_discrete() # In[7]: ggplot(data) + \ geom_pointrange(aes(x='drink', y='mean', ymin='lower', ymax='upper', fill='mean'), \ size=3, linewidth=3, shape=21, color='dark_green') + \ scale_fill_discrete() # In[8]: ggplot(data) + \ geom_pointrange(aes(x='drink', y='mean', ymin='lower', ymax='upper', fill='mean'), size=3, linewidth=3, shape=21, color='dark_green', alpha=0.5) + \ scale_fill_discrete()