Skip to main content

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 pcolormesh figure.
  • 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:

  1. 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:

  1. https://en.wikipedia.org/wiki/Mandelbrot_set
  2. "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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tkmandelbrotset-1.1.0.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tkmandelbrotset-1.1.0-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

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

Hashes for tkmandelbrotset-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2d2c07dd702e4729f1b8c2a257199277054e0ecba722790e4aa306392bfe9e83
MD5 92c34e0c9d0eab7b72f84bbeecb38182
BLAKE2b-256 5b4c02c7e5c566027c13366669be8b4680a7f2fba702b896cfcbcb5034105f81

See more details on using hashes here.

Provenance

The following attestation bundles were made for tkmandelbrotset-1.1.0.tar.gz:

Publisher: release.yml on KevinRGeurts/tkMandelbrotSet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for tkmandelbrotset-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eecad535940ab73c7c4fec294f6487e651aa9414403a7d6002adda577afe6e36
MD5 e51d8fa19b98c41d6f05e50f0ff284b5
BLAKE2b-256 103b31d78120be8c05f29ad6a854cc42d32efd4cd13249bf0661439292b31f61

See more details on using hashes here.

Provenance

The following attestation bundles were made for tkmandelbrotset-1.1.0-py3-none-any.whl:

Publisher: release.yml on KevinRGeurts/tkMandelbrotSet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page