geom_spoke() As a Layer of geom_livemap()

In [1]:
import numpy as np
from lets_plot import *
In [2]:
LetsPlot.setup_html()
In [3]:
X, Y = np.meshgrid([10, 20, 30, 40], [10, 20, 30, 40])

angle = np.pi / 180 * np.array([[0, 0, 5, 20],
                                [5, 10, 20, 50],
                                [35, 50, 65, 75],
                                [25, 30, 50, 80]])
amplitude = np.array([[1.5, 2.0, 2.5, 5.0],
                      [2.0, 2.5, 3.0, 6.0],
                      [2.5, 3.6, 5.0, 7.0],
                      [3.0, 4.5, 5.0, 5.0]])
data = dict(x=X.reshape(-1), y=Y.reshape(-1), amplitude=amplitude.reshape(-1), angle=angle.reshape(-1))
In [4]:
ggplot(data, aes('x', 'y', color='amplitude')) + \
    geom_livemap() + \
    geom_point(size=4) + \
    scale_color_gradient(low='#2c7bb6', high='#d7191c') + \
    geom_spoke(aes(angle='angle', radius='amplitude'), pivot='tip', size=2)
Out[4]: