plot_margin
parameter in theme()
allows to change the margin areas of a plot using the margin()
function.
import numpy as np
from lets_plot import *
LetsPlot.setup_html()
np.random.seed(42)
data = {'x': np.random.randint(10, size=100)}
p = ggplot(data, aes(x='x')) + geom_bar() + ggtitle("Bar Сhart") + \
theme(plot_background=element_rect(size = 6))
p
p + theme(plot_margin=[20, # Top
10, # Right
10, # Bottom
10]) # Left