Sharedsupport / 2015-03-19-111407-holoviews.sagewsOpen in CoCalc
Authors: Harald Schilly, ℏal Snyder, William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
from holoviews import * from holoviews.operation import contours, threshold, gradient import numpy as np
def sine(x, phase=0, freq=100): return np.sin((freq * x + phase))
phases = np.linspace(0,2*np.pi,11) # Explored phases freqs = np.linspace(50,150,5) # Explored frequencies
dist = np.linspace(-0.5,0.5,202) # Linear spatial sampling x,y = np.meshgrid(dist, dist) grid = (x**2+y**2) # 2D spatial sampling
freq1 = Image(sine(grid, freq=50)) + Curve(zip(dist, sine(dist**2, freq=50))) freq2 = Image(sine(grid, freq=200)) + Curve(zip(dist, sine(dist**2, freq=200))) f = (freq1 + freq2).cols(2)
renderer = Store.renderer.instance(fig='svg', holomap='gif') renderer.save(f, 'example_I', style=dict(Image={'cmap':'jet'})) smc.file('example_I.svg')