# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3 (ipykernel)
#     language: python
#     name: python3
# ---

# +
# %matplotlib inline
from ipywidgets import interactive, IntSlider, FloatSlider
import matplotlib.pyplot as plt
from matplotlib import rcParams
from julia import get_julia_set
import numpy as np

def plot_julia_euler(magnitude, phase, r, size, max_iterations):
    julia_set = get_julia_set(size, size, magnitude*np.exp(1j * phase), r, max_iterations)
    rcParams['figure.figsize'] = (5, 5)
    plt.rc('axes', titlesize=20)
    plt.axis('off') 
    plt.imshow(julia_set, cmap='hot', interpolation='hamming')
    plt.show()

interactive(plot_julia_euler, 
    magnitude=FloatSlider(value=0.63, min=-5.0, max=5.0, step=0.01, description="magnitude"), 
    phase=FloatSlider(value=0.91, min=-2*np.pi, max=2*np.pi, step=0.01, description="phase"), 
    r=FloatSlider(value=2., min=1., max=10., step=0.01, description="R"), 
    size=IntSlider(value=200, min=100, max=1000, description="resolution"), 
    max_iterations=IntSlider(value=15, min=1, max=30, description="color detail"))

StarcoderdataJupyterScriptsDedupFiltered