bubblebath() plots circles or other polygons at random positions with varying radii. All input parameters are optional including frame size, range of radii, number of vertices per bubble (eg, polygon shape), density, the amount of space between bubbles or how much they can overlap, edge behavior, and other parameters. A figure is produced and there are four outputs that allow the user to make further changes to the plotted objects or to recreate the exact same plot using the same version of the code.
See the help section for a detailed description of each optional parameter and its default value.
bubblebath_examples.mlx contains many examples showing how to manipulate parameters and how to use the outputs to add color, calculated area of each circle, and other useful information.
Follow this page for updates.
Adam Danz (2020). Bubblebath.m (https://www.mathworks.com/matlabcentral/fileexchange/70348), MATLAB Central File Exchange. Retrieved April 7, 2020.
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!