[7]:
import holoviews as hv
import numpy as np

from enjoyn import GifAnimator, HoloViewsPreprocessor


def plot(i):
    # needed to set opts
    from holoviews.plotting import bokeh

    x, y = np.mgrid[-10:10, -10:10] * i
    sine_rings = np.sin(x**2 + y**2) * np.pi + np.pi
    exp_falloff = 1 / np.exp((x**2 + y**2) / 8)
    vector_field = hv.VectorField((x, y, sine_rings, exp_falloff)).opts(
        xlim=(-15, 15), ylim=(-15, 15)
    )
    return vector_field


preprocessor = HoloViewsPreprocessor(func=plot)
output = GifAnimator(
    preprocessor=preprocessor,
    items=np.arange(-1.01, 1.251, 0.05),
    output_path="assets/parallel_holoviews.gif",
).compute()
[########################################] | 100% Completed | 16.6s

parallel-holoviews