<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/flowers-for-julia/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://fronkonstin.com/2018/11/19/flowers-for-julia/"> R – Fronkonstin</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div class="twitter-share"><a rel="nofollow" href="https://twitter.com/intent/tweet?url=https%3A%2F%2Ffronkonstin.com%2F2018%2F11%2F19%2Fflowers-for-julia%2F&via=aschinchon" class="twitter-share-button" target="_blank">Tweet</a></div>
<blockquote>
<p>No hables de futuro, es una ilusión cuando el Rock &amp; Roll conquistó mi corazón (El Rompeolas, Loquillo y los Trogloditas)</p>
</blockquote>
<p>In this post I create flowers inspired in <a rel="nofollow" href="https://en.wikipedia.org/wiki/Julia_set" target="_blank">the Julia Sets</a>, a family of fractal sets obtained from complex numbers, after being iterated by a holomorphic function. Despite of the ugly previous definition, the mechanism to create them is quite simple:</p>
<ul>
<li>Take a grid of complex numbers between -2 and 2 (both, real and imaginary parts).</li>
<li>Take a function of the form <img alt=" f(z)=z^{n}+c" title=" f(z)=z^{n}+c" src="https://s0.wp.com/latex.php?latex=+f%28z%29%3Dz%5E%7Bn%7D%2Bc&bg=ffffff&%23038;fg=000&%23038;s=0" class="latex"> setting parameters <img alt="n" title="n" src="https://s0.wp.com/latex.php?latex=n&bg=ffffff&%23038;fg=000&%23038;s=0" class="latex"> and <img alt="c" title="c" src="https://s0.wp.com/latex.php?latex=c&bg=ffffff&%23038;fg=000&%23038;s=0" class="latex">.</li>
<li>Iterate the function over the complex numbers several times. In other words: apply the function on each complex. Apply it again on the output and repeat this process a number of times.</li>
<li>Calculate the modulus of the resulting number.</li>
<li>Represent the initial complex number in a scatter plot where x-axis correspond to the real part and y-axis to the imaginary one. Color the point depending on the modulus of the resulting number after applying the function <img alt="f(z)" title="f(z)" src="https://s0.wp.com/latex.php?latex=f%28z%29&bg=ffffff&%23038;fg=000&%23038;s=0" class="latex"> iteratively.</li>
</ul>
<p>This image corresponds to a grid of 9 million points and 7 iterations of the function <img alt="f(z)=z^{5}+0.364716021116823" title="f(z)=z^{5}+0.364716021116823" src="https://s0.wp.com/latex.php?latex=f%28z%29%3Dz%5E%7B5%7D%2B0.364716021116823&bg=ffffff&%23038;fg=000&%23038;s=0" class="latex">:</p>
<p><img data-orig-file="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_5_0.364716021116823_7.png?fit=4800%2C4800&amp;ssl=1" data-orig-size="4800,4800" data-medium-file="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_5_0.364716021116823_7.png?fit=300%2C300&amp;ssl=1" data-attachment-id="4724" data-image-meta="{" data-image-description="" src="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_5_0.364716021116823_7.png?resize=604%2C604&ssl=1" data-permalink="https://fronkonstin.com/2018/11/19/flowers-for-julia/julia_5_0-364716021116823_7/" data-large-file="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_5_0.364716021116823_7.png?fit=604%2C604&amp;ssl=1" alt="" data-image-title="julia_5_0.364716021116823_7" sizes="(max-width: 604px) 100vw, 604px" width="450" data-comments-opened="1" class="wp-image-4724" data-recalc-dims="1"></p>
<p>To color the points, I pick a random palette from the top list of <a rel="nofollow" href="https://www.colourlovers.com/" target="_blank">COLOURLovers</a> site using the <code>colourlovers</code> package. Since each flower involves a huge amount of calculations, I use Reduce to make this process efficiently. More examples:</p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_1.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_2.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_3.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_4.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_5.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_6.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_7.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_8.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_9.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_10.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_11.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_12.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_13.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_14.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_15.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/11/julia_16.png?w=604&ssl=1" data-recalc-dims="1"></p>
<div></div>
<p>There are two little Julias in the world whom I would like to dedicate this post. I wish them all the best of the world and I am sure they will discover the beauty of mathematics. These flowers are yours.</p>
<p>The code is available <a rel="nofollow" href="https://github.com/aschinchon/julia-flowers" target="_blank">here</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://fronkonstin.com/2018/11/19/flowers-for-julia/"> R – Fronkonstin</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/nTQH-Nsqz7o" height="1"></a></div>