#!/usr/bin/env python # coding: utf-8 # In[2]: from lets_plot import * LetsPlot.setup_html() # In[6]: dat = dict( x = [0, 2], y = [0, 2], c = ["a", "b"], s = ["a", "b"] ) p = ggplot(dat) + geom_point(aes("x", "y", shape="s", color="c"), size=10) p # In[10]: p + scale_color_manual(name="O", values=["red", "blue"]) #+ scale_shape(name="O") # In[13]: p1 = ggplot(dat) + geom_tile(aes("x", "y", fill="c")) p1 # In[15]: p1 + scale_fill_manual(name="O", values=["red", "blue"], labels=['No', 'Yes']) # In[25]: dat2 = dict( x = ["a", "a", "b"], ) (ggplot(dat2) + geom_bar(aes("x", fill="x")) + scale_fill_manual(name="O", values=["red", "blue"], labels=['No', 'Yes']) ) # In[24]: from lets_plot.mapping import as_discrete (ggplot(dat2) + geom_bar(aes("x", fill=as_discrete("x"))) + scale_fill_manual(name="O", values=["red", "blue"], labels=['No', 'Yes']) ) # In[ ]: