{"id":11215,"date":"2020-01-17T09:00:56","date_gmt":"2020-01-17T14:00:56","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=11215"},"modified":"2020-01-17T09:35:52","modified_gmt":"2020-01-17T14:35:52","slug":"digcircs","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2020\/01\/17\/digcircs\/","title":{"rendered":"digCircs"},"content":{"rendered":"<div class=\"content\">\n<p><a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495\">Sean<\/a>&#8216;s pick this week is <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/73167\">digcircs<\/a> by <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/2166720\">Graham W Griffiths<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>My pick this week is a really cool visualization of the numbers in a sequence. digCircs draws colored parabolic lines between sequential digits in a sequence. Take a look at the first 10000 digits of pi:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainDigCircs\/pidig.png\" hspace=\"5\" vspace=\"5\" \/><\/p>\n<p>or e:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainDigCircs\/edig.png\" hspace=\"5\" vspace=\"5\" \/><\/p>\n<p>Now there&#8217;s actually another reason I picked this. A large portion of my job is staying on top of new features in MATLAB so that I can help customers adopt the technology. As such, I maniacally read the <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/release-notes.html\">release notes<\/a> and generally recommend everyone do the same. It&#8217;s always exciting to see a new feature in the wild and that is the case with this.<\/p>\n<p>Starting in R2019a, you can use HEX color codes for MATLAB graphics objects. Graham uses this to determine the colors of the lines. Here&#8217;s a simple example:<\/p>\n<pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid #c8c8c8;\">cols1 =  [  <span style=\"color: #a020f0;\">\"#D78553\"<\/span>, <span style=\"color: #0000ff;\">...<\/span><span style=\"color: #228b22;\"> %  1<\/span>\r\n            <span style=\"color: #a020f0;\">\"#4E3270\"<\/span>, <span style=\"color: #0000ff;\">...<\/span><span style=\"color: #228b22;\"> %  2<\/span>\r\n            <span style=\"color: #a020f0;\">\"#C877C8\"<\/span>, <span style=\"color: #0000ff;\">...<\/span><span style=\"color: #228b22;\"> %  3<\/span>\r\n            <span style=\"color: #a020f0;\">\"#1C5D5C\"<\/span>, <span style=\"color: #0000ff;\">...<\/span><span style=\"color: #228b22;\"> %  4<\/span>\r\n            <span style=\"color: #a020f0;\">\"#2BE7D2\"<\/span>, <span style=\"color: #0000ff;\">...<\/span><span style=\"color: #228b22;\"> %  5<\/span>\r\n            <span style=\"color: #a020f0;\">\"#113C7E\"<\/span>, <span style=\"color: #0000ff;\">...<\/span><span style=\"color: #228b22;\"> %  6<\/span>\r\n            <span style=\"color: #a020f0;\">\"#1279F1\"<\/span>, <span style=\"color: #0000ff;\">...<\/span><span style=\"color: #228b22;\"> %  7<\/span>\r\n            <span style=\"color: #a020f0;\">\"#35472A\"<\/span>, <span style=\"color: #0000ff;\">...<\/span><span style=\"color: #228b22;\"> %  8<\/span>\r\n            <span style=\"color: #a020f0;\">\"#9EC26D\"<\/span>, <span style=\"color: #0000ff;\">...<\/span><span style=\"color: #228b22;\"> %  9<\/span>\r\n            <span style=\"color: #a020f0;\">\"#543725\"<\/span>];    <span style=\"color: #228b22;\">% 10<\/span>\r\n\r\nh = plot(magic(10));\r\n<span style=\"color: #0000ff;\">for<\/span> ii = 1:10\r\n    h(ii).Color = cols1(ii);\r\n<span style=\"color: #0000ff;\">end<\/span><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainDigCircs\/mainDigCircs_01.png\" hspace=\"5\" vspace=\"5\" \/><\/p>\n<h3>Comments<a name=\"4\"><\/a><\/h3>\n<p>Give it a try and let us know what you think <a href=\"http:\/\/blogs.mathworks.com\/pick\/?p=11215#respond\">here<\/a> or leave a <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/73167#comments\">comment<\/a> for Graham.<\/p>\n<p><script language=\"JavaScript\">\n<!--\n\n    function grabCode_ef5f605d83874501aacdd288bc0b6092() {\n        \/\/ Remember the title so we can use it in the new page\n        title = document.title;\n\n        \/\/ Break up these strings so that their presence\n        \/\/ in the Javascript doesn't mess up the search for\n        \/\/ the MATLAB code.\n        t1='ef5f605d83874501aacdd288bc0b6092 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\n        t2='##### ' + 'SOURCE END' + ' #####' + ' ef5f605d83874501aacdd288bc0b6092';\n    \n        b=document.getElementsByTagName('body')[0];\n        i1=b.innerHTML.indexOf(t1)+t1.length;\n        i2=b.innerHTML.indexOf(t2);\n \n        code_string = b.innerHTML.substring(i1, i2);\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\n\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \n        \/\/ in the XML parser.\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\n        \/\/ doesn't go ahead and substitute the less-than character. \n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\n\n        author = 'Sean de Wolski';\n        copyright = 'Copyright 2019 The MathWorks, Inc.';\n\n        w = window.open();\n        d = w.document;\n        d.write('<\/p>\n\n\n\n\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\n\n\n\n\n<p>\\n');\n      \n      d.title = title + ' (MATLAB code)';\n      d.close();\n      }   \n      \n-->\n<\/script><\/p>\n<p style=\"text-align: right; font-size: xx-small; font-weight: lighter; font-style: italic; color: gray;\">\n<a><span style=\"font-size: x-small; font-style: italic;\">Get<br \/>\nthe MATLAB code<br \/>\n<noscript>(requires JavaScript)<\/noscript><\/span><\/a><\/p>\n<p>Published with MATLAB\u00ae R2020a<\/p>\n<\/div>\n<p><!--\nef5f605d83874501aacdd288bc0b6092 ##### SOURCE BEGIN #####\n%% digCircs\n%\n% <http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495 Sean>'s pick this week is\n% <http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/73167 digcircs> by\n% <http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/2166720 Graham W Griffiths>.\n%\n\n%%\n%\n% My pick this week is a really cool visualization of the numbers in a\n% sequence.  digCircs draws colored parabolic lines between sequential\n% digits in a sequence.  Take a look at the first 10000 digits of pi:\n%\n% <<pidig.png>>\n\n%%\n% or e:\n%\n% <<edig.png>>\n\n%%\n% Now there's actually another reason I picked this.  A large portion of my\n% job is staying on top of new features in MATLAB so that I can help\n% customers adopt the technology.  As such, I maniacally read the\n% <https:\/\/www.mathworks.com\/help\/matlab\/release-notes.html release notes>\n% and generally recommend everyone do the same.  It's always exciting to\n% see a new feature in the wild and that is the case with this.\n%\n% Starting in R2019a, you can use HEX color codes for MATLAB graphics\n% objects.  Graham uses this to determine the colors of the lines.  Here's\n% a simple example:\n\ncols1 =  [  \"#D78553\", ... %  1\n\"#4E3270\", ... %  2\n\"#C877C8\", ... %  3\n\"#1C5D5C\", ... %  4\n\"#2BE7D2\", ... %  5\n\"#113C7E\", ... %  6\n\"#1279F1\", ... %  7\n\"#35472A\", ... %  8\n\"#9EC26D\", ... %  9\n\"#543725\"];    % 10\n\nh = plot(magic(10));\nfor ii = 1:10\nh(ii).Color = cols1(ii);\nend\n\n%% Comments\n%\n% Give it a try and let us know what you think\n% <http:\/\/blogs.mathworks.com\/pick\/?p=11215#respond here> or leave a\n% <http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/73167#comments % comment> for Graham.\n%\n\n##### SOURCE END ##### ef5f605d83874501aacdd288bc0b6092\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"http:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainDigCircs\/pidig.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>\nSean&#8216;s pick this week is digcircs by Graham W Griffiths.<br \/>\n&nbsp;<br \/>\nMy pick this week is a really cool visualization of the numbers in a sequence. digCircs draws colored parabolic lines between&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2020\/01\/17\/digcircs\/\">read more >><\/a><\/p>\n","protected":false},"author":87,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11215"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=11215"}],"version-history":[{"count":3,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11215\/revisions"}],"predecessor-version":[{"id":11281,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11215\/revisions\/11281"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=11215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=11215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=11215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}