{"id":15471,"date":"2021-08-12T11:08:45","date_gmt":"2021-08-12T05:38:45","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=15471"},"modified":"2021-08-12T11:08:51","modified_gmt":"2021-08-12T05:38:51","slug":"mandelbrot-set-python","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/","title":{"rendered":"How To Generate The Mandelbrot Set In Python"},"content":{"rendered":"\n<p>In this article, we are going to learn about how to generate Mandelbrot set in Python. This is one of the beautiful objects in Mathematics. In the Mandelbrot set, there is an infinite amount of beautiful shapes and patterns. Now let us learn about it in a detailed manner. And also how to generate Mandelbrot set in Python.<\/p>\n\n\n\n<p><strong>The Mandelbrot set is the most beautiful pattern. It is a three-dimensional pattern. Spherical coordinates are used to construct this set. We are going to print two Mandelbrot set using python libraries. Using iteration to print this set of patterns.<\/strong><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Formula_to_generate_the_Mandelbrot_set\" >Formula to generate the Mandelbrot set<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Iteration_of_the_Mandelbrot_set\" >Iteration of the Mandelbrot set<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Generating_the_Mandelbrot_set_in_Python_in_a_form_of_image_Method_1\" >Generating the Mandelbrot set in Python in a form of image Method 1<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Entire_code_Method_1\" >Entire code : Method 1<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Generating_the_Mandelbrot_set_in_Python_in_a_form_of_image_Method_2\" >Generating the Mandelbrot set in Python in a form of image Method 2<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Entire_Code_Method_2\" >Entire Code: Method 2<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Printing_the_Mandelbrot_Set_in_a_form_of_Graph\" >Printing the Mandelbrot Set in a form of Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Frequently_Asked_Questions_Related_to_Mandelbrot_Set_in_Python\" >Frequently Asked Questions Related to Mandelbrot Set in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#Trending_Right_Now\" >Trending Right Now<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-formula-to-generate-the-mandelbrot-set\"><span class=\"ez-toc-section\" id=\"Formula_to_generate_the_Mandelbrot_set\"><\/span>Formula to generate the Mandelbrot set<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"256\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/20210811_162043_0000-2-1024x256.png\" alt=\"How to generate mandelbrot set in python\" class=\"wp-image-15479\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/20210811_162043_0000-2-1024x256.png 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/20210811_162043_0000-2-300x75.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/20210811_162043_0000-2-768x192.png 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/20210811_162043_0000-2.png 1035w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>We can see the formula for the Mandelbrot set in the above image. This is a type of set that is commonly called fractal. The Mandelbrot set is calculated in the number systems of complex numbers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-iteration-of-the-mandelbrot-set\"><span class=\"ez-toc-section\" id=\"Iteration_of_the_Mandelbrot_set\"><\/span>Iteration of the Mandelbrot set<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The Mandelbrot set is generated iteration. Iteration means repeating the process again and again. In mathematics, the iteration process is the most often application of the mathematical function. The function involved in the Mandelbrot set is straightforward. They are quadratic polynomials. The form of a quadratic polynomial is f(y) = y<sup>2<\/sup> + k, where k is a constant number.<\/p>\n\n\n\n<p>First, we iterate y<sup>2<\/sup>+k. Now we can write this number as y<sub>0<\/sub>. We will apply the function we have y<sup>2<\/sup>+k to y<sub>0<\/sub> we will get the new number.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">y<sub>1<\/sub> = y<sup>2<\/sup><sub>0<\/sub> + k.<\/pre>\n\n\n\n<p>Now we will follow the same in this too now we will get<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;y<sub>2<\/sub> = y<sup>2<\/sup><sub>1<\/sub> + k<\/pre>\n\n\n\n<p>The iteration is now,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">y<sub>3<\/sub> = y<sup>2<\/sup><sub>2<\/sub> + k<\/pre>\n\n\n\n<p>The value becomes,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;y<sub>4<\/sub> = y<sup>2<\/sup><sub>3<\/sub> + k<\/pre>\n\n\n\n<p>and it goes on. The numbers  y<sub>1<\/sub>, y2\u2026.. are the orbit of  y<sub>0<\/sub>  under an iteration of y<sup>2<\/sup>+k.<\/p>\n\n\n\n<p>The Mandelbrot set contains all complex values for which the corresponding orbit of 0 under  y<sup>2<\/sup>+k. Mandelbrot set is represented by the letter M. The name Mandelbrot is came by Benoit Mandelbrot. He is the first person to study the set.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>For example:<\/strong><\/p>\n\n\n\n<p>If we take k is equal to one, the sequence of the Mandelbrot set is zero, one, two, five, twenty-six, and it goes on and becomes infinity. So one is not an element of the Mandelbrot set. If we take -1 the sequence is 0, -1, 0, 0, -1 and at last it becomes -1. <\/p>\n\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-golf monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Popular now<\/span><span class=\"monsterinsights-inline-popular-posts-border\" ><\/span><span class=\"monsterinsights-inline-popular-posts-border-2\" ><\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\"  href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-cant-compare-datetime-datetime-to-datetime-date\/\">[Fixed] typeerror can&#8217;t compare datetime.datetime to datetime.date<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Generating_the_Mandelbrot_set_in_Python_in_a_form_of_image_Method_1\"><\/span>Generating the Mandelbrot set in Python in a form of image Method 1<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom numpy import complex, array\nfrom PIL import Image\nimport colorsys\nwidth_of_the_set = 1000\n<\/pre><\/div>\n\n\n<p>Importing the necessary libraries, we want to generate the given set. The necessary libraries are NumPy, PIL, and colorsys. From NumPy importing complex and array. And from PIL importing image so that it will display the set in image format. Importing colorsys. After importing the libraries, we are setting the width of the set as 1000.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef color(i):\n    color_of_the_set = 255 * array(colorsys.hsv_to_rgb(i \/ 245.0, 0.9, 0.4))\n    return tuple(color_of_the_set.astype(int))\n<\/pre><\/div>\n\n\n<p>Now create a function named\u00a0<strong>color<\/strong>. This function is for colors. Giving the colors as an integer value in the form of RGB. Next to return the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Tuple\" target=\"_blank\" rel=\"noreferrer noopener\">tuple<\/a> to print the colors of the set.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef mandelbrot_set(x, y):\n    c1 = complex(x, y)\n    c2 = 0\n    for n in range(1, 900):\n        if abs(c2) &gt; 2:\n            return color(n)\n        c2 = c2 * c2 + c1\n    return (0, 0, 0)\n<\/pre><\/div>\n\n\n<p>Creating another function named <strong>mandelbrot_set<\/strong>. A Variable c1 holds the complex numbers, and c2 is equal to zero. Using for loop to iterate till the given value. Now using the if statement to check the condition. If the condition is True, the corresponding color will be generated. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimage = Image.new('RGB', (width_of_the_set, int(width_of_the_set \/ 2)))\npixels = image.load()  \nfor x in range(image.size&#x5B;0]):\n    print(&quot;%.2f %%&quot; % (x \/ width_of_the_set * 100.0)) \n    for y in range(image.size&#x5B;1]):\n        pixels&#x5B;x, y] = mandelbrot_set((x - (0.75 * width_of_the_set)) \/ (width_of_the_set \/ 4),(y - (width_of_the_set \/ 4)) \/ (width_of_the_set \/ 4))\nimage.show()\n<\/pre><\/div>\n\n\n<p>Creating another for loop and is useful for image size. Using nested for loop to iterate the size of the image. The last statement <a href=\"http:\/\/www.pythonpool.com\/matplotlib-imshow\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"text-decoration: underline;\">image.show()<\/span> <\/a>is useful to print the image.<\/p>\n\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-kilo monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Popular now<\/span><span class=\"monsterinsights-inline-popular-posts-border\" ><\/span><span class=\"monsterinsights-inline-popular-posts-border-2\" ><\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\"  href=\"https:\/\/www.pythonpool.com\/fixed-nameerror-name-unicode-is-not-defined\/\">[Fixed] nameerror: name Unicode is not defined<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-entire-code-method-1\"><span class=\"ez-toc-section\" id=\"Entire_code_Method_1\"><\/span>Entire code : Method 1<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom numpy import complex, array\nfrom PIL import Image\nimport colorsys\nwidth_of_the_set = 1000\ndef color(i):\n    color_of_the_set = 255 * array(colorsys.hsv_to_rgb(i \/ 245.0, 0.9, 0.4))\n    return tuple(color_of_the_set.astype(int))\ndef mandelbrot_set(x, y):\n    c1 = complex(x, y)\n    c2 = 0\n    for n in range(1, 900):\n        if abs(c2) &gt; 2:\n            return color(n)\n        c2 = c2 * c2 + c1\n    return (0, 0, 0)\nimage = Image.new('RGB', (width_of_the_set, int(width_of_the_set \/ 2)))\npixels = image.load()  \nfor x in range(image.size&#x5B;0]):\n    print(&quot;%.2f %%&quot; % (x \/ width_of_the_set * 100.0)) \n    for y in range(image.size&#x5B;1]):\n        pixels&#x5B;x, y] = mandelbrot_set((x - (0.75 * width_of_the_set)) \/ (width_of_the_set \/ 4),\n                                      (y - (width_of_the_set \/ 4)) \/ (width_of_the_set \/ 4))\nimage.show()\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\" id=\"h-output\"><strong>Output<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1014\" height=\"513\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/Screenshot-12-1.png\" alt=\"Generating the Mandelbrot set in Python in a form of image Method 1\" class=\"wp-image-15491\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/Screenshot-12-1.png 1014w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/Screenshot-12-1-300x152.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/Screenshot-12-1-768x389.png 768w\" sizes=\"(max-width: 1014px) 100vw, 1014px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-generating-the-mandelbrot-set-in-python-in-a-form-of-image-method-2\"><span class=\"ez-toc-section\" id=\"Generating_the_Mandelbrot_set_in_Python_in_a_form_of_image_Method_2\"><\/span>Generating the Mandelbrot set in Python in a form of image Method 2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom PIL import Image\nx1 = -2.0\nx2 = 1.0\ny1 = -1.5\ny2 = 1.5\nmax_iterations = 255 \nimage_of_x = 512\nimage_of_y = 512\nimage = Image.new(&quot;RGB&quot;, (image_of_x, image_of_y))\n<\/pre><\/div>\n\n\n<p>Importing a library PIL. From PIL importing image. The output is in the form of the image, so importing the image. Initializing the values of x1, x2, y1, and y2. Giving the maximum iterations as 255. The image of the x and y is 512.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfor y in range(image_of_y):\n    zy = y * (y2- y1) \/ (image_of_y - 1)  + y1\n    for x in range(image_of_x):\n        zx = x * (x2 - x1) \/ (image_of_x - 1)  + x1\n        z = zx + zy * 1j\n        c = z\n        for i in range(max_iterations):\n            if abs(z) &gt; 2.0: break\n            z = z * z + c\n        image.putpixel((x, y), (i % 4 * 64, i % 8 * 32, i % 16 * 16))\nimage.show()\n<\/pre><\/div>\n\n\n<p>Creating for loop to iterate. The first for loop is for the image of y, and the other is an image of x. Another for loop is for maximum iterations. Image.show() is useful to display the output in the image form.<\/p>\n\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-delta monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-icon\" style=\"\"><svg width=\"14\" height=\"19\" viewBox=\"0 0 14 19\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M7.875 0.899463C7.875 1.59183 8.0816 2.24711 8.49479 2.8653C8.93229 3.48349 9.44271 4.06458 10.026 4.60859C10.6337 5.15259 11.2292 5.73369 11.8125 6.35188C12.4201 6.97007 12.9306 7.76135 13.3438 8.72572C13.7812 9.66537 14 10.7163 14 11.8785C14 13.832 13.3073 15.5011 11.9219 16.8858C10.5608 18.2953 8.92014 19 7 19C5.07986 19 3.42708 18.2953 2.04167 16.8858C0.680556 15.5011 0 13.832 0 11.8785C0 9.94973 0.668403 8.28062 2.00521 6.87116C2.27257 6.57443 2.58854 6.50024 2.95312 6.64861C3.31771 6.79697 3.5 7.08134 3.5 7.50171V10.6545C3.5 11.3221 3.71875 11.8908 4.15625 12.3607C4.61806 12.8305 5.16493 13.0654 5.79688 13.0654C6.45312 13.0654 7.01215 12.8428 7.47396 12.3978C7.93576 11.9279 8.16667 11.3592 8.16667 10.6916C8.16667 10.2712 8.04514 9.86318 7.80208 9.46754C7.58333 9.0719 7.31597 8.71336 7 8.3919C6.68403 8.07044 6.34375 7.73662 5.97917 7.39043C5.63889 7.04425 5.34722 6.66097 5.10417 6.2406C4.88542 5.82024 4.73958 5.35041 4.66667 4.83114C4.59375 4.31186 4.67882 3.68131 4.92188 2.93948C5.18924 2.17293 5.63889 1.33219 6.27083 0.417277C6.51389 0.0463641 6.84201 -0.0772735 7.25521 0.0463641C7.6684 0.170002 7.875 0.454368 7.875 0.899463Z\" fill=\"#EB5757\"><\/path><\/svg><\/span><span class=\"monsterinsights-inline-popular-posts-label\" >Trending<\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\"  href=\"https:\/\/www.pythonpool.com\/solved-runtimeerror-cuda-error-invalid-device-ordinal\/\">[Solved] runtimeerror: cuda error: invalid device ordinal<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-entire-code-method-2\"><span class=\"ez-toc-section\" id=\"Entire_Code_Method_2\"><\/span>Entire Code: Method 2<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom PIL import Image\nx1 = -2.0\nx2 = 1.0\ny1 = -1.5\ny2 = 1.5\nmax_iterations = 255 \nimage_of_x = 512\nimage_of_y = 512\nimage = Image.new(&quot;RGB&quot;, (image_of_x, image_of_y)) \nfor y in range(image_of_y):\n    zy = y * (y2- y1) \/ (image_of_y - 1)  + y1\n    for x in range(image_of_x):\n        zx = x * (x2 - x1) \/ (image_of_x - 1)  + x1\n        z = zx + zy * 1j\n        c = z\n        for i in range(max_iterations):\n            if abs(z) &gt; 2.0: break\n            z = z * z + c\n        image.putpixel((x, y), (i % 4 * 64, i % 8 * 32, i % 16 * 16))\nimage.show()\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\" id=\"h-output-1\"><strong>Output<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/Screenshot-13.png\" alt=\"Generating the Mandelbrot set\" class=\"wp-image-15492\" width=\"707\" height=\"717\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/Screenshot-13.png 502w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/Screenshot-13-296x300.png 296w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-printing-the-mandelbrot-set-in-a-form-of-graph\"><span class=\"ez-toc-section\" id=\"Printing_the_Mandelbrot_Set_in_a_form_of_Graph\"><\/span>Printing the Mandelbrot Set in a form of Graph<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom pylab import imshow,show,gray\nfrom numpy import zeros,linspace\ni=800\nj = zeros(&#x5B;i,i],int)\nvalue_of_x = linspace(-2,2,i)\nvalue_of_y= linspace(-2,2,i)\nfor m,x in enumerate(value_of_x):\n    for n,y in enumerate(value_of_y):\n        complex_number = 0 + 0j\n        z = complex(x,y)\n        for i in range(100):\n            complex_number   = complex_number *complex_number  + z\n            if abs(complex_number) &gt; 2.0:\n                j&#x5B;n,m] = 1\n                break\nimshow(j,origin=&quot;lower&quot;)\ngray()\nshow()\n<\/pre><\/div>\n\n\n<p>Importing the necessary libraries. From pylab importing imshow, gray, and show. Zeros and linspace from numpy library. Giving the value of the graph as 800. for loop is useful to iterate. Initialized a complex number as 0+0j. Another for loop is to iterate complex_number. The <strong><a href=\"http:\/\/www.pythonpool.com\/python-absolute-value\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"text-decoration: underline;\">abs()<\/span><\/a> <\/strong>is useful for roundoff the values, at last using break statement to terminate the loop.<\/p>\n\n\n\n<p class=\"has-medium-font-size\" id=\"h-output-2\"><strong>Output<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/Figure-2021-08-11-191839.png\" alt=\"Printing in a form of graph\" class=\"wp-image-15494\" width=\"705\" height=\"680\"\/><\/figure>\n\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-alpha monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Trending<\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\"  href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-type-numpy-ndarray-doesnt-define-__round__-method\/\">[Fixed] typeerror: type numpy.ndarray doesn&#8217;t define __round__ method<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-frequently-asked-questions-related-to-mandelbrot-set-in-python\"><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions_Related_to_Mandelbrot_Set_in_Python\"><\/span>Frequently Asked Questions Related to Mandelbrot Set in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1628689819078\"><strong class=\"schema-faq-question\">1. What is the Mandelbrot set?<\/strong> <p class=\"schema-faq-answer\">Mandelbrot is a set of complex numbers that the functions that do not diverge when iterated from z are equal to zero.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1628690038632\"><strong class=\"schema-faq-question\">2. Is the Mandelbrot set is three-dimensional?<\/strong> <p class=\"schema-faq-answer\">Yes, the Mandelbrot set is a three-dimensional object.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1628690112539\"><strong class=\"schema-faq-question\">3. Write the equation for the Mandelbrot set.<\/strong> <p class=\"schema-faq-answer\">\u00a0The equation for the Mandelbrot set is z<sub>n+1<\/sub>\u00a0= z<sub>n<\/sub><sup>2<\/sup>\u00a0+ c.<\/p> <\/div> <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we learned about how to generate Mandelbrot set fractals in python. This set is one of the beautiful and interesting sets in mathematics. And this is very easy to understand. We hope that this article is beneficial for you.<\/p>\n\n\n<div class=\"monsterinsights-widget-popular-posts monsterinsights-widget-popular-posts-charlie monsterinsights-popular-posts-styled monsterinsights-widget-popular-posts-columns-1\"><h2 class=\"monsterinsights-widget-popular-posts-widget-title\"><span class=\"ez-toc-section\" id=\"Trending_Right_Now\"><\/span>Trending Right Now<span class=\"ez-toc-section-end\"><\/span><\/h2><ul class=\"monsterinsights-widget-popular-posts-list\"><li style=\"background-color:#EEEEEE;border-color:#CD3034;\"><a href=\"https:\/\/www.pythonpool.com\/f-string-unmatched\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" style=\"font-size:17px;\">Frustrated with Unmatched f-strings? Master the Art of Formatting<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><\/div><\/div><\/a><\/li><li style=\"background-color:#EEEEEE;border-color:#CD3034;\"><a href=\"https:\/\/www.pythonpool.com\/supercharge-your-code-with-python-rtype\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" style=\"font-size:17px;\">Supercharge Your Code with Python Rtype<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><\/div><\/div><\/a><\/li><li style=\"background-color:#EEEEEE;border-color:#CD3034;\"><a href=\"https:\/\/www.pythonpool.com\/what-does-split-do-in-python\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" style=\"font-size:17px;\">What does split do in Python?<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><\/div><\/div><\/a><\/li><li style=\"background-color:#EEEEEE;border-color:#CD3034;\"><a href=\"https:\/\/www.pythonpool.com\/python-heapq\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" style=\"font-size:17px;\">Python Heapq: Boost Your Efficiency with Heap Operations!<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><\/div><\/div><\/a><\/li><\/ul><\/div><p><\/p>","protected":false},"excerpt":{"rendered":"<p>In this article, we are going to learn about how to generate Mandelbrot set in Python. This is one of the beautiful objects in Mathematics. &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How To Generate The Mandelbrot Set In Python\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#more-15471\" aria-label=\"More on How To Generate The Mandelbrot Set In Python\">Read more<\/a><\/p>\n","protected":false},"author":22,"featured_media":15509,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[4416,4415,4414],"class_list":["post-15471","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-andelbrot-set-python-code","tag-mandelbrot-set-with-python","tag-plotting-mandelbrot-set-python","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Generate The Mandelbrot Set In Python - Python Pool<\/title>\n<meta name=\"description\" content=\"Now let us learn about it and also how to generate Mandelbrot set in Python. In Mandelbrot set there is an infinite amount of beautifu\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Generate The Mandelbrot Set In Python\" \/>\n<meta property=\"og:description\" content=\"In this article, we are going to learn about how to generate Mandelbrot set in Python. This is one of the beautiful objects in Mathematics. In the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-12T05:38:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-12T05:38:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Priyalakshmi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Priyalakshmi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/\"},\"author\":{\"name\":\"Priyalakshmi\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/83e6e22a6c461cc1a8445bb473db2f20\"},\"headline\":\"How To Generate The Mandelbrot Set In Python\",\"datePublished\":\"2021-08-12T05:38:45+00:00\",\"dateModified\":\"2021-08-12T05:38:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/\"},\"wordCount\":843,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp\",\"keywords\":[\"andelbrot set python code\",\"mandelbrot set with python\",\"plotting mandelbrot set python\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/\",\"url\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/\",\"name\":\"How To Generate The Mandelbrot Set In Python - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp\",\"datePublished\":\"2021-08-12T05:38:45+00:00\",\"dateModified\":\"2021-08-12T05:38:51+00:00\",\"description\":\"Now let us learn about it and also how to generate Mandelbrot set in Python. In Mandelbrot set there is an infinite amount of beautifu\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628689819078\"},{\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690038632\"},{\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690112539\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp\",\"width\":1200,\"height\":628,\"caption\":\"mandelbrot set python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Generate The Mandelbrot Set In Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/83e6e22a6c461cc1a8445bb473db2f20\",\"name\":\"Priyalakshmi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8f1aadb3b77a89fe5776d41fb52aec63200d0e68e92c71cb9aafac7fb4456696?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8f1aadb3b77a89fe5776d41fb52aec63200d0e68e92c71cb9aafac7fb4456696?s=96&d=wavatar&r=g\",\"caption\":\"Priyalakshmi\"}},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628689819078\",\"position\":1,\"url\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628689819078\",\"name\":\"1. What is the Mandelbrot set?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Mandelbrot is a set of complex numbers that the functions that do not diverge when iterated from z are equal to zero.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690038632\",\"position\":2,\"url\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690038632\",\"name\":\"2. Is the Mandelbrot set is three-dimensional?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes, the Mandelbrot set is a three-dimensional object.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690112539\",\"position\":3,\"url\":\"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690112539\",\"name\":\"3. Write the equation for the Mandelbrot set.\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"\u00a0The equation for the Mandelbrot set is zn+1\u00a0= zn2\u00a0+ c.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How To Generate The Mandelbrot Set In Python - Python Pool","description":"Now let us learn about it and also how to generate Mandelbrot set in Python. In Mandelbrot set there is an infinite amount of beautifu","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/","og_locale":"en_US","og_type":"article","og_title":"How To Generate The Mandelbrot Set In Python","og_description":"In this article, we are going to learn about how to generate Mandelbrot set in Python. This is one of the beautiful objects in Mathematics. In the","og_url":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/","og_site_name":"Python Pool","article_published_time":"2021-08-12T05:38:45+00:00","article_modified_time":"2021-08-12T05:38:51+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp","type":"image\/webp"}],"author":"Priyalakshmi","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Priyalakshmi","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/"},"author":{"name":"Priyalakshmi","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/83e6e22a6c461cc1a8445bb473db2f20"},"headline":"How To Generate The Mandelbrot Set In Python","datePublished":"2021-08-12T05:38:45+00:00","dateModified":"2021-08-12T05:38:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/"},"wordCount":843,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp","keywords":["andelbrot set python code","mandelbrot set with python","plotting mandelbrot set python"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/","url":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/","name":"How To Generate The Mandelbrot Set In Python - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp","datePublished":"2021-08-12T05:38:45+00:00","dateModified":"2021-08-12T05:38:51+00:00","description":"Now let us learn about it and also how to generate Mandelbrot set in Python. In Mandelbrot set there is an infinite amount of beautifu","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628689819078"},{"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690038632"},{"@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690112539"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/mandelbrot-set-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/08\/How-To-Generate-The-Mandelbrot-Set-In-Python.webp","width":1200,"height":628,"caption":"mandelbrot set python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"How To Generate The Mandelbrot Set In Python"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/83e6e22a6c461cc1a8445bb473db2f20","name":"Priyalakshmi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8f1aadb3b77a89fe5776d41fb52aec63200d0e68e92c71cb9aafac7fb4456696?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8f1aadb3b77a89fe5776d41fb52aec63200d0e68e92c71cb9aafac7fb4456696?s=96&d=wavatar&r=g","caption":"Priyalakshmi"}},{"@type":"Question","@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628689819078","position":1,"url":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628689819078","name":"1. What is the Mandelbrot set?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Mandelbrot is a set of complex numbers that the functions that do not diverge when iterated from z are equal to zero.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690038632","position":2,"url":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690038632","name":"2. Is the Mandelbrot set is three-dimensional?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes, the Mandelbrot set is a three-dimensional object.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690112539","position":3,"url":"https:\/\/www.pythonpool.com\/mandelbrot-set-python\/#faq-question-1628690112539","name":"3. Write the equation for the Mandelbrot set.","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"\u00a0The equation for the Mandelbrot set is zn+1\u00a0= zn2\u00a0+ c.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/15471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=15471"}],"version-history":[{"count":38,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/15471\/revisions"}],"predecessor-version":[{"id":15526,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/15471\/revisions\/15526"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/15509"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=15471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=15471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=15471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}