Chaos plot visualization is done using two different libraries (turtle and mathplotlib). In the first visualization, the points are drawn sequentially, due to this, the speed is much lower than in the second method, where all the points are drawn together and the result is presented in the form of a picture. Attractor points are 3 vertices of the triangle. The number of points can be changed (it is necessary to change the value of the variable n).
Sample image for an image using the turtle module and n = 50000
Sample image for an image using the mathplot module and n = 100000
The algorithm is similar to drawing a Sierpinski triangle, but 8 points of attractors are used: 4 points of the apex of the square and midpoints of the sides.
Sample image for an image using the mathplot module and n = 1000000
When using the variant that uses the mathplotlib library for large n
(~> 100000), it is recommended to additionally specify specify the last additional line width parameter in ax.scatter
, which can be made small, or even equal to zero, for example: linewidths = 0
An example of drawing a triangle for n = 10e7 without decreasing linewidth to 0
An example of drawing a triangle for n = 10e7 with decreasing linewidth to 0
Example of distribution of points with increasing n for a triangle
Example of distribution of points with increasing n for a square