Jupyter - mwicat/personal GitHub Wiki

Installation

pip install jupyterlab ipympl

Set notebook directory

jupyter notebook --generate-config
jupyter notebook --notebook-dir=~/jupyter-notebooks

Start

jupyter notebook

Jupyterlab

jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter lab build

Plotting

%matplotlib widget

import matplotlib.pyplot as plt
import numpy as np
minpar = 0
maxpar = 1
numsamples = 100

minval = 1
maxval = 5

pars = np.linspace(minpar, maxpar, numsamples)
vals = np.linspace(minval, maxval, numsamples)

pwr = 4.
def par2val(par): return minval + (maxval - minval) * np.power(par, pwr)
def val2par(val): return ((val - minval) / (maxval - minval)) ** (1/pwr)

plt.figure()
plt.plot(pars, par2val(pars))
plt.plot(vals, val2par(vals))