import numpy as np
from lets_plot import *
LetsPlot.setup_html()
set_theme()¶LetsPlot.set_theme(theme_bw()
+ flavor_darcula()
+ theme(panel_background=element_rect(fill='yellow')))
data = {'name': ['pen', 'brush', 'paper'],
'slice': [1, 3, 3]}
ggplot(data) + \
geom_pie(aes(fill='name', slice='slice'),
stat='identity', color='pen',
tooltips='none', labels=layer_labels().line('@name')) + \
scale_fill_manual(['pen', 'brush', 'paper'])
LetsPlot.set_theme(theme(panel_background=element_rect(fill='yellow'))
+ theme_bw()
+ flavor_darcula())
data = {'name': ['pen', 'brush', 'paper'],
'slice': [1, 3, 3]}
ggplot(data) + \
geom_pie(aes(fill='name', slice='slice'),
stat='identity', color='pen',
tooltips='none', labels=layer_labels().line('@name')) + \
scale_fill_manual(['pen', 'brush', 'paper'])
The previous flavors are overwritten by the last flavor.
LetsPlot.set_theme(theme(panel_background=element_rect(fill='yellow'))
+ theme_bw()
+ flavor_darcula()
+ flavor_high_contrast_light())
data = {'name': ['pen', 'brush', 'paper'],
'slice': [1, 3, 3]}
ggplot(data) + \
geom_pie(aes(fill='name', slice='slice'),
stat='identity', color='pen',
tooltips='none', labels=layer_labels().line('@name')) + \
scale_fill_manual(['pen', 'brush', 'paper'])
data = {'name': ['pen', 'brush', 'paper'],
'slice': [1, 3, 3]}
ggplot(data) + \
geom_pie(aes(fill='name', slice='slice'),
stat='identity', color='pen',
tooltips='none', labels=layer_labels().line('@name')) + \
scale_fill_manual(['pen', 'brush', 'paper']) +\
theme(panel_background=element_rect(fill='yellow')) +\
theme_classic() +\
flavor_darcula() +\
flavor_high_contrast_light()
gggrid() and GGbunch()¶LetsPlot.set_theme(theme_bw()
+ flavor_darcula()
+ theme(panel_background=element_rect(fill='yellow')))
np.random.seed(42)
n = 100
x = np.arange(n)
y = np.random.normal(size=n)
w, h = 200, 150
p = ggplot({'x': x, 'y': y}, aes(x='x', y='y')) + ggsize(w, h)
plot_list=[
gggrid([p+geom_point(), p+geom_histogram(bins=3)]),
p+geom_line()
]
gggrid(plot_list, ncol=1) + ggsize(400, 300)
p = ggplot({'x': x, 'y': y}, aes(x='x', y='y')) + ggsize(w, h)
bunch = GGBunch()
bunch.add_plot(p + geom_point(), 0, 0)
bunch.add_plot(p + geom_histogram(bins=3), w, 0)
bunch.add_plot(p + geom_line(), 0, h, 2*w, h)
bunch.show()
LetsPlot.set_theme(theme(panel_background=element_rect(fill='yellow'))
+ theme_bw()
+ flavor_darcula()
+ flavor_high_contrast_light()
+ geom_point())