The plot_inset Parameter in theme()

The plot_inset parameter in theme() specifies the inset for a plotting area, including the axes with their labels, but without titles. The parameter is set according to the margin rules: accept a number or a list of numbers.

In [1]:
import numpy as np

from lets_plot import *
In [2]:
LetsPlot.setup_html()
In [3]:
np.random.seed(42)

x = np.linspace(-np.pi, np.pi, 100)
y = np.sin(x)

p = ggplot({'x': x, 'y': y}, aes(x='x', y='y')) + \
    geom_line() + \
    ggtitle("Sine wave") + \
    theme_light() + \
    theme(plot_background=element_rect(size=1))
In [4]:
gggrid([
    p,
    p + theme(plot_inset=20)
])
Out[4]:
In [5]:
gggrid([
    p + theme(axis='blank'),
    p + theme(axis='blank') + theme(plot_inset=[0, 30])
])
Out[5]: