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
Metadata
Release files for tkMandelbrotSet 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tkmandelbrotset-1.1.0.tar.gz | 33.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tkmandelbrotset-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.7 kB
Release files / tkmandelbrotset-1.1.0.tar.gz
| Download URL | tkmandelbrotset-1.1.0.tar.gz |
|---|---|
| Size | 33.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d2c07dd702e4729f1b8c2a257199277054e0ecba722790e4aa306392bfe9e83
|
|
BLAKE2b-256 checksum How to use checksums |
5b4c02c7e5c566027c13366669be8b4680a7f2fba702b896cfcbcb5034105f81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / tkmandelbrotset-1.1.0-py3-none-any.whl
| Download URL | tkmandelbrotset-1.1.0-py3-none-any.whl |
|---|---|
| Size | 29.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eecad535940ab73c7c4fec294f6487e651aa9414403a7d6002adda577afe6e36
|
|
BLAKE2b-256 checksum How to use checksums |
103b31d78120be8c05f29ad6a854cc42d32efd4cd13249bf0661439292b31f61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency log