<jupyter_start><jupyter_text>Jim's example of creating an interactive plot to adjust dimensions of a single Gaussian<jupyter_code>import matplotlib.pyplot as plt 
import numpy as np

from IPython.html import widgets
from IPython.html.widgets import interact
from IPython.display import display
mean=0
sigma=1
x=np.linspace(-6,6,500)
y=(1/sigma/np.sqrt(2*np.pi))*np.exp(-(x-mean)**2/2/sigma**2)

%matplotlib inline
fig = plt.figure(figsize=(4,4))
axes = fig.add_subplot(111)
axes.plot(x,y)


def plt_arrays(x, y, title="title", color="blue", linestyle="solid", linewidth=2):
    fig = plt.figure()
    axes = fig.add_subplot(111)
    axes.plot(x,y, color=color, linestyle=linestyle, linewidth=linewidth)
    axes.set_title(title)
    axes.grid()
    plt.show()
def f(sigma, mu, **kwargs): 
    x=np.linspace(-6*sigma+mu,6*sigma+mu,500)
    y=(1/sigma/np.sqrt(2*np.pi))*np.exp(-(x-mu)**2/2/sigma**2)
    plt_arrays(x,y,title="title", **kwargs)
sigma=1
mu=0
f(sigma, mu)
i = interact(f, sigma=(0.001,5),mu=(-10,10),color = ["red","blue","green"],linestyle=["solid","dashed"],linewidth=(1,5))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18694096601073346, 'fraction_numerical': 0.03935599284436494, 'mean_word_length': 5.823170731707317, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '650772', 'license': 'MIT', 'n_tokens_mistral': 467, 'n_tokens_neox': 443, 'n_words': 78, 'path': 'tutorials/Widgets InteractiveGaussian.ipynb', 'repo_name': 'UWPRG/Python', 'size': '1118'}