Chaos
Visualizations connecting chaos theory, fractals, and the logistic map!
Jonny Hyman, 2020
Written byThis code was developed for this YouTube video from Veritasium
This is not a library, but rather a collection of standalone scripts! As such, there is a bit of code duplication between scripts.
Requirements
- Python 3.6+ (tested on Python 3.6 and Python 3.7, macOS Catalina and Windows 10)
- Numpy package :
pip install numpy
- Numba package :
pip install numba
Logistic Map - Interactive
python logistic_interactive.py
Additional Requirements
- PyQt5 :
pip install pyqt5
- PyQtGraph :
pip install pyqtgraph
This visualization creates a cobweb plot, time series graph, and bifurcation plot for visualizing the logistic map. The font pictured is "Avenir Next" which is licensed as part of macOS. Other OSes will see their default font.
Shortcuts:
- Spacebar: play/pause
- Backspace: reset view & animation
3D Mandelbrot Set
Here we see the Mandelbrot set on the x-y plane, and iterations of the Mandelbrot set in the z axis. This reveals the bifurcation plot beneath the Mandelbrot set!
Final visualization is accomplished by a volume rendering of 1000x1000x1000 voxels, oversampled by 16 to reduce aliasing.
Additional Requirements
- Vispy :
pip install vispy
- Matplotlib :
pip install matplotlib
- PyOpenGL :
pip install pyopengl
- ffmpeg if you want to auto-stitch rendered frames to .movs
- macOS: Install homebrew then
brew install ffmpeg
- Windows: Install chocolatey then
choco install ffmpeg
- macOS: Install homebrew then
Logistic Map Zoom
- Vispy :
pip install vispy
- Note: The final version of the visualization used a custom version of Vispy, modified to improve the appearance of axes. I have not released this and don't plan to, but if you really need it please post in Issues a feature request.