from lets_plot import *
LetsPlot.setup_html()
data = {
'x': [1, 1, 1, 1, 1, 1.5, 1.5, 2, 2, 2 ],
'y': [1, 1, 1, 1, 1, 2, 2, 1.5, 1.5, 1.5],
's': [3, 1, 2, 1, 4, 1, 3, 3, 3, 1],
'n': ['a', 'b', 'a', 'c', 'a', 'a', 'b', 'c', 'a', 'b']
}
ggplot(data) + geom_pie(aes('x', 'y', slice='s', fill='n'), hole=0.3, stat='identity')
ggplot({
'x': [0, 20, 200],
'y': [1, 2, 3]
}) + geom_pie(aes('x', 'y'), hole=0.2, stat='identity')
ggplot({
'x': [10, 20, 30],
'y': [-100, 15, 200]
}) + geom_pie(aes('x', 'y'), hole=0.2, stat='identity')
data2 = {
'x': [0, 1, 2, 3, 4, 5],
'y': [1, 1, 1, 1, 1, 1],
'size': [1, 2, 5, 10, 20, 40]
}
ggplot(data2, aes('x', 'y', size='size')) + geom_pie(hole=0.2, stat='identity')
# geom_point
ggplot(data2, aes('x', 'y', size='size')) + geom_point() + scale_size_identity()