<jupyter_start><jupyter_text>An Interesting Wee Widget<jupyter_code>%matplotlib inline
#%pylab inline
plt.xkcd()
import matplotlib.pyplot as plt
from numpy import pi, exp, real, imag, linspace
from ipywidgets import interact

def f(t,a=1,b=6,c=-14,d=0):
    return exp(a*1j*t) - exp(b*1j*t)/2 + 1j*exp(c*1j*t)/3 + exp(d*1j*t)/ 4

def plot_swirly(a=1,b=6,c=-14,d=0):
    t = linspace(0, 2*pi, 1000)
    ft = f(t,a,b,c,d)
    plt.plot(real(ft), imag(ft))
    
    # These two lines make the aspect ratio square
    fig = plt.gcf()
    fig.set_size_inches(6, 6, forward='True')

interact(plot_swirly,a=(-20,20),b=(-20,20),c=(-20,20),d=(-20,20));<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19047619047619047, 'fraction_numerical': 0.0625, 'mean_word_length': 4.9035087719298245, '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': '50255', 'license': 'MIT', 'n_tokens_mistral': 331, 'n_tokens_neox': 317, 'n_words': 56, 'path': 'Day0/An Interesting Wee Widget.ipynb', 'repo_name': 'SWUFE-labs/isea2018-2018isea', 'size': '672'}