The tkMandelbrotSet package provides a tkinter application for visualizing and interacting with the Mandelbrot set.
Project description
tkMandelbrotSet
Source code: GitHub
The tkMandelbrotSet package provides a python class MandelbrotSet for generating Mandelbrot sets. It also provides a
tkinter application for visualizing and interacting with (e.g., zooming into) the Mandelbrot set.
Application Features:
- The Mandelbrot set is visualized by a
matplotlib pcolormeshfigure. - The user can zoom into the Mandelbrot set visualization by clicking and dragging a zooming rectangle with the mouse.
- The user can move backward and forward through the history of zooms.
- Red numbered rectangles on the visualization indicate the location of previous zooms.
- The user can "prune" the history of zooms to eliminate unwanted zoom locations.
- The user can visualize the Mandelbrot set using different colormaps.
- The user can export the Mandelbrot set visualization to an image file.
Application Known Issues and Limitations:
- File|Open..., File|Save, and File|Save As... menu bar options are not currently implemented. File open and save dialogs will be presented, but no action will be taken when they are closed.
References:
- https://en.wikipedia.org/wiki/Mandelbrot_set
- "The Mandelbrot Set," by Branner, Bodil, "Chaos and Fractals: The Mathematics Behind the Computer Graphics," Devaney, Robert L., and Linda Keen, eds., Proceedings of Symposia in Applied Mathematics, Volume 39, American Mathematical Society, 1989, pp. 75-106.
Requirements
- matplotlib>=3.10.8: GitHub, PyPi
- tkAppFramework>=0.9.4: GitHub, PyPi
- UserResponseCollector>=1.1.0: GitHub, PyPi
Credit where credit is due
- The Memento design pattern used to snapshot the state of the MandelbrotSet class follow the concepts, UML diagrams, and examples provided in "Design Patterns: Elements of Reusable Object-Oriented Software," by Eric Gamma, Richard Helm, Ralph Johnson, and John Vlissides, published by Addison-Wesley, 1995.
Application Usage
To launch the application for interacting with and visualizing the Mandelbrot set:
python -m tkMandelbrotSet.mandelbrot_set_app
Choose Help | View Help... from the application's menu bar to read instructions for using the application.
Advanced Usage
You can use the MandelbrotSet class to generate your own Mandelbrot set results.
import matplotlib.pyplot as plt
from tkMandelbrotSet.mandelbrot import MandelbrotSet, plot_mandelbrot_set
# Generate the Mandelbrot set
upper_left_corner = complex(real=-2.0, imag=2.0)
lower_rigt_corner = complex(real=1.0, imag=-2.0)
number_real_axis_pts = 500
number_imag_axis_pts = 500
ms = MandelbrotSet(upper_left_corner, lower_right_corner, number_real_axis_pts, number_imag_axis_pts)
ms.generate_mandelbrot_set()
# Get the plotting data
(x, y, z) = ms.get_plot_data(True)
# Visualize the Mandelbrot set
plot_mandelbrot_set(x, y, z)
plt.show()
Unittests
Unit tests for tkMandelbrotSet have filenames starting with test_. To run the unit tests,
type python -m unittest discover -s .\..\tests -v in a terminal window in the project directory.
While the unit tests are executing, a few tkinter windows will appear and disappear, as the application
is being tested.
License
MIT License. See the LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tkmandelbrotset-1.1.0.tar.gz.
File metadata
- Download URL: tkmandelbrotset-1.1.0.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d2c07dd702e4729f1b8c2a257199277054e0ecba722790e4aa306392bfe9e83
|
|
| MD5 |
92c34e0c9d0eab7b72f84bbeecb38182
|
|
| BLAKE2b-256 |
5b4c02c7e5c566027c13366669be8b4680a7f2fba702b896cfcbcb5034105f81
|
Provenance
The following attestation bundles were made for tkmandelbrotset-1.1.0.tar.gz:
Publisher:
release.yml on KevinRGeurts/tkMandelbrotSet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tkmandelbrotset-1.1.0.tar.gz -
Subject digest:
2d2c07dd702e4729f1b8c2a257199277054e0ecba722790e4aa306392bfe9e83 - Sigstore transparency entry: 1321334694
- Sigstore integration time:
-
Permalink:
KevinRGeurts/tkMandelbrotSet@7a82187af2d67923ffc0cf2e890fec1388ddab93 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/KevinRGeurts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7a82187af2d67923ffc0cf2e890fec1388ddab93 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file tkmandelbrotset-1.1.0-py3-none-any.whl.
File metadata
- Download URL: tkmandelbrotset-1.1.0-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eecad535940ab73c7c4fec294f6487e651aa9414403a7d6002adda577afe6e36
|
|
| MD5 |
e51d8fa19b98c41d6f05e50f0ff284b5
|
|
| BLAKE2b-256 |
103b31d78120be8c05f29ad6a854cc42d32efd4cd13249bf0661439292b31f61
|
Provenance
The following attestation bundles were made for tkmandelbrotset-1.1.0-py3-none-any.whl:
Publisher:
release.yml on KevinRGeurts/tkMandelbrotSet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tkmandelbrotset-1.1.0-py3-none-any.whl -
Subject digest:
eecad535940ab73c7c4fec294f6487e651aa9414403a7d6002adda577afe6e36 - Sigstore transparency entry: 1321334820
- Sigstore integration time:
-
Permalink:
KevinRGeurts/tkMandelbrotSet@7a82187af2d67923ffc0cf2e890fec1388ddab93 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/KevinRGeurts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7a82187af2d67923ffc0cf2e890fec1388ddab93 -
Trigger Event:
workflow_dispatch
-
Statement type: