<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/pencil-scribbles/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://fronkonstin.com/2018/04/17/pencil-scribbles/"> 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%2F04%2F17%2Fpencil-scribbles%2F&via=aschinchon" class="twitter-share-button" target="_blank">Tweet</a></div>
<blockquote>
<p>Con las bombas que tiran los fanfarrones, se hacen las gaditanas tirabuzones (Palma y corona, Carmen Linares)</p>
</blockquote>
<p>This time I draw Franky again using an algorithm to solve the Travelling Salesman Problem as I did in <a rel="nofollow" href="https://fronkonstin.com/2018/04/04/the-travelling-salesman-portrait/" target="_blank">my last post</a>. On this occasion, instead of doing just one single line drawing, I overlap many of them (250 concretely), each of them sampling 400 points on <a rel="nofollow" href="http://ereaderbackgrounds.com/movies/bw/Frankenstein.jpg" target="_blank">the original image</a> (in my previous post I sampled 8.000 points). Last difference is that I don’t convert the image to pure black and white with <code>threshold</code> function: now I use the <em>gray scale number</em> of each pixel to weight the sample.</p>
<p>Once again, I use <code>ggplot2</code> package, and its magical <code>geom_path</code>, to generate the image. The <em>pencil effect</em> is obtained giving a very high transparency to the lines. This is the result:</p>
<p><img data-orig-file="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/04/frankyTSP.png?fit=2400%2C3000&amp;ssl=1" data-orig-size="2400,3000" data-medium-file="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/04/frankyTSP.png?fit=240%2C300&amp;ssl=1" data-attachment-id="4470" data-image-meta="{" data-image-description="" src="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/04/franky_scribbles3.png?resize=550%2C688&ssl=1" data-permalink="https://fronkonstin.com/2018/04/04/the-travelling-salesman-portrait/frankytsp/" data-large-file="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/04/frankyTSP.png?fit=604%2C755&amp;ssl=1" alt="" data-image-title="frankyTSP" width="450" data-comments-opened="1" class="wp-image-4470" data-recalc-dims="1"></p>
<p>I love when someone else experiment with my experiments as <a rel="nofollow" href="https://twitter.com/dataandme" target="_blank">Mara Averick</a> did:</p>
<div class="twitter-tweet">
<blockquote class="twitter-tweet" data-lang="en">
<p dir="ltr" lang="en"><img alt="💼" src="https://i0.wp.com/s.w.org/images/core/emoji/2.4/72x72/1f4bc.png?w=456&ssl=1" class="wp-smiley" data-recalc-dims="1"> single-line aRt w/ <a rel="nofollow" href="https://twitter.com/aschinchon?ref_src=twsrc%5Etfw" target="_blank">@aschinchon</a>:<br><img alt="👨‍🎨" src="https://i0.wp.com/s.w.org/images/core/emoji/2.4/72x72/1f468-200d-1f3a8.png?w=456&ssl=1" class="wp-smiley" data-recalc-dims="1"> &quot;The Travelling Salesman Portrait&quot; <a rel="nofollow" href="https://t.co/MZqXeCleuU" target="_blank">https://t.co/MZqXeCleuU</a> <a rel="nofollow" href="https://twitter.com/hashtag/rstats?src=hash&ref_src=twsrc%5Etfw" target="_blank">#rstats</a><br>(you'll never guess which are mine!) <a rel="nofollow" href="https://t.co/CxXzZh7YRR" target="_blank">pic.twitter.com/CxXzZh7YRR</a></p>
<p>— Mara Averick (@dataandme) <a rel="nofollow" href="https://twitter.com/dataandme/status/981940050761076737?ref_src=twsrc%5Etfw" target="_blank">April 5, 2018</a></p>
</blockquote>
</div>
<p>Or <a rel="nofollow" href="https://twitter.com/ejvankesteren" target="_blank">Erik-Jan van Kesteren</a>:</p>
<div class="twitter-tweet">
<blockquote class="twitter-tweet" data-lang="en">
<p dir="ltr" lang="en">An image as a travelling salesman problem using <a rel="nofollow" href="https://twitter.com/hashtag/rstats?src=hash&ref_src=twsrc%5Etfw" target="_blank">#rstats</a>. How did I do it? I didn't: I just cloned a <a rel="nofollow" href="https://twitter.com/hashtag/GitHub?src=hash&ref_src=twsrc%5Etfw" target="_blank">#GitHub</a> repo (<a rel="nofollow" href="https://t.co/u7GDUzsJRu" target="_blank">https://t.co/u7GDUzsJRu</a>) and put in my own picture. Really nice, follow his blog (<a rel="nofollow" href="https://t.co/rmOqmmsd6T" target="_blank">https://t.co/rmOqmmsd6T</a>) <img alt="👍" src="https://i0.wp.com/s.w.org/images/core/emoji/2.4/72x72/1f44d.png?w=456&ssl=1" class="wp-smiley" data-recalc-dims="1"> <a rel="nofollow" href="https://t.co/zLYXokR6U7" target="_blank">pic.twitter.com/zLYXokR6U7</a></p>
<p>— Erik-Jan van Kesteren (@ejvankesteren) <a rel="nofollow" href="https://twitter.com/ejvankesteren/status/984530488940552192?ref_src=twsrc%5Etfw" target="_blank">April 12, 2018</a></p>
</blockquote>
</div>
<p>You can do it as well with this one, since you will find the code <a rel="nofollow" href="https://github.com/aschinchon/pencil-scribbles" target="_blank">here</a>. Please, let me know your own creations if you do. You can find me on <a rel="nofollow" href="https://twitter.com/aschinchon" target="_blank">twitter</a> or <a rel="nofollow" href="https://fronkonstin.com/about/" target="_blank">by email</a>.</p>
<p>P.S.: Although it may seems otherwise, I’m not obsessed with Frankenstein <img alt="🙂" src="https://i1.wp.com/s.w.org/images/core/emoji/2.4/72x72/1f642.png?w=456&ssl=1" class="wp-smiley" data-recalc-dims="1"></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/04/17/pencil-scribbles/"> 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/ColkNgBi-FA" height="1"></a></div>