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=margin(t=20, # Top
r=10, # Right
b=10, # Bottom
l=10)) # Left