%config InlineBackend.figure_formats = ['svg']

import xarray as xr
import xyzpy as xyz
import numpy as np

def singuass(x, a, l, phi):
    return np.sin(x / l - phi) * np.exp(-x**2 / a)

r = xyz.Runner(singuass, 'sg(x)')

combos = {
    'x': np.linspace(-4, 4, 52),
    'a': [1, 2, 3],
    'l': [0.2, 0.3, 0.4, 0.5, 0.6, 0.7],
    'phi': [0, 1],
}

r.run_combos(combos)
100%|##########| 1872/1872 [00:00<00:00, 224309.71it/s]
<xarray.Dataset>
Dimensions:  (a: 3, l: 6, phi: 2, x: 52)
Coordinates:
  * x        (x) float64 -4.0 -3.843 -3.686 -3.529 ... 3.529 3.686 3.843 4.0
  * a        (a) int64 1 2 3
  * l        (l) float64 0.2 0.3 0.4 0.5 0.6 0.7
  * phi      (phi) int64 0 1
Data variables:
    sg(x)    (x, a, l, phi) float64 -1.027e-07 -9.415e-08 ... -0.004828
r.last_ds.xyz.lineplot(x='x', y='sg(x)', z='l', col='a', row='phi', 
                       colors=True, figsize=(6, 4))
_images/f0f9d22ffddfc685bb3cb449ceb34084c7141df96b58f43080a3dcab7cef553c.svg
r.last_ds.xyz.ilineplot(x='x', y='sg(x)', z='l', col='a', row='phi', 
                        colors=True, figsize=(6, 4))
Loading BokehJS ...
r.last_ds.xyz.heatmap(x='x', y='l', z='sg(x)', col='a', row='phi', 
                      colors=True, colormap='balance', figsize=(6, 4))
_images/b7d50e4db581ec871ebba3dc1d51247362120f31510d8bda32ef06b012cf6483.svg
r.last_ds.xyz.iheatmap(x='x', y='l', z='sg(x)', col='a', row='phi', 
                       colors=True, colormap='balance', figsize=(6, 4))
# note we have dropped the 'row' specification but can still plot all the data
r.last_ds.xyz.scatter(x='sg(x)', y='x', z='l', col='a',
                      colors=True, colormap='viridis', figsize=(6, 4))
_images/a58ec7d43096c1e919d23600e513d9cfd6d1a9ae301e8d89603a6a3c4d83cdda.svg
r.last_ds.xyz.iscatter(x='sg(x)', y='x', z='l', col='a',
                       colors=True, colormap='viridis', figsize=(6, 4))
# note we have dropped the col specification
r.last_ds.xyz.histogram(x='sg(x)', z='l', row='phi',
                        bins=100, ylog=True, stacked=True, 
                        colors=True, colormap='magma_r', figsize=(6, 4))
_images/8b33d94ddf1c02ccc7f537b063a5d2ce29d293a633bdecc1626a485679d2c454.svg