{"id":3531,"date":"2020-01-14T14:34:48","date_gmt":"2020-01-14T19:34:48","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=3531"},"modified":"2020-01-14T14:34:48","modified_gmt":"2020-01-14T19:34:48","slug":"how-to-chart-my-year","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2020\/01\/14\/how-to-chart-my-year\/","title":{"rendered":"How to Chart My Year"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>I travel a lot.  Mostly for work.  I do try to take advantage of the priviledge - visiting so many amazing places -- and spend a little extra time occasionally.  People even joke that I should be writing a travel blog.  Of course I prefer to write one on MATLAB.  But how about combining these just for fun today.<\/p><p>Another observation: I find that often people don't include enough information on their plots, from axes labels to good titles.  And sometimes the story  we want to tell is complex.  Including how we present the data.  Good labels and titles go a long way to remedying the situation.<\/p><p>You may have noticed some recent posts about a new feature in MATLAB: <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/tiledlayout.html\"><tt>tiledlayout<\/tt><\/a>, meant to supplant <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/subplot.html\"><tt>subplot<\/tt><\/a>. Here are <a href=\"https:\/\/blogs.mathworks.com\/steve\/2019\/12\/10\/how-to-go-a-little-crazy-with-graphics-titles\">Steve's post<\/a> and <a href=\"https:\/\/blogs.mathworks.com\/pick\/2019\/09\/13\/tiled-layout\">Sean's on POTW<\/a>.<\/p><p>I thought it would be fun to make a \"calendar\" of sorts for my travels. As the year goes on, I hope to replace the plot each month with an iconic picture from my travels.  I will start it off with  junk data.  And I want to show my meanders a bit as well.  For now, again, the plot will be with nonsense data, to be filled in as the year goes on.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#35b390b1-0f89-40a8-8195-b42fb6b1aa23\">My  Calendar<\/a><\/li><li><a href=\"#75ac57b8-a4d2-44b1-acd8-dd91ee6bc854\">Observations<\/a><\/li><\/ul><\/div><h4>My  Calendar<a name=\"35b390b1-0f89-40a8-8195-b42fb6b1aa23\"><\/a><\/h4><p>Here's my calendar.<\/p><pre class=\"codeinput\">t = tiledlayout(4,4);\r\ntitle(t,<span class=\"string\">\"Loren's 2020 Travels\"<\/span>)\r\nt.TileSpacing = <span class=\"string\">\"compact\"<\/span>;\r\nt.Padding = <span class=\"string\">\"compact\"<\/span>;\r\nnexttile; plot(rand(3)), title(<span class=\"string\">\"Jan\"<\/span>)\r\nnexttile, plot(magic(3)), title(<span class=\"string\">\"Feb\"<\/span>)\r\nnexttile, plot(rand(3)), title(<span class=\"string\">\"Mar\"<\/span>)\r\nnexttile, plot(rand(3)), title(<span class=\"string\">\"Apr\"<\/span>)\r\nnexttile, plot(rand(3)), title(<span class=\"string\">\"May\"<\/span>)\r\nnexttile(8), plot(rand(3)), title(<span class=\"string\">\"Jun\"<\/span>)\r\nnexttile(9), plot(rand(3)), title(<span class=\"string\">\"Jul\"<\/span>)\r\nnexttile(12), plot(rand(3)), title(<span class=\"string\">\"Aug\"<\/span>)\r\nnexttile(13), plot(rand(3)), title(<span class=\"string\">\"Sep\"<\/span>)\r\nnexttile(14), plot(rand(3)), title(<span class=\"string\">\"Oct\"<\/span>)\r\nnexttile(15), plot(rand(3)), title(<span class=\"string\">\"Nov\"<\/span>)\r\nnexttile(16), plot(rand(3)), title(<span class=\"string\">\"Dec\"<\/span>)\r\nnexttile(6,[2,2]); geoplot([-44 77],[172 20],<span class=\"string\">\"m-*\"<\/span>)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2020\/subplotSuccessor_01.png\" alt=\"\"> <p>Maybe I should hold a contest to see if my pictures each month are identifiable.  I'll decide that later :-).<\/p><h4>Observations<a name=\"75ac57b8-a4d2-44b1-acd8-dd91ee6bc854\"><\/a><\/h4><p>Notice how I lay out my grid of plots, which thankfully has room for 12 months surrounding the central map.  Did you know that you could lay out plots so nicely now?  And add the all important annotations, plot by plot, including titles and axis labels?  Let me know <a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=3531#respond\">here<\/a>.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_afd03424fb434d3b9bcd82611b76c24f() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='afd03424fb434d3b9bcd82611b76c24f ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' afd03424fb434d3b9bcd82611b76c24f';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2020 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_afd03424fb434d3b9bcd82611b76c24f()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2019b<br><\/p><\/div><!--\r\nafd03424fb434d3b9bcd82611b76c24f ##### SOURCE BEGIN #####\r\n%% How to Chart My Year\r\n% I travel a lot.  Mostly for work.  I do try to take advantage of the\r\n% priviledge - visiting so many amazing places REPLACE_WITH_DASH_DASH and spend a little extra\r\n% time occasionally.  People even joke that I should be writing a travel\r\n% blog.  Of course I prefer to write one on MATLAB.  But how about\r\n% combining these just for fun today.\r\n%\r\n% Another observation: I find that often people don't include enough\r\n% information on their plots, from axes labels to good titles.  And\r\n% sometimes the story  we want to tell is complex.  Including how we\r\n% present the data.  Good labels and titles go a long way to remedying the\r\n% situation.\r\n% \r\n% You may have noticed some recent posts about a new feature in MATLAB:\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/tiledlayout.html\r\n% |tiledlayout|>, meant to supplant\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/subplot.html |subplot|>. Here\r\n% are\r\n% <https:\/\/blogs.mathworks.com\/steve\/2019\/12\/10\/how-to-go-a-little-crazy-with-graphics-titles\r\n% Steve's post> and\r\n% <https:\/\/blogs.mathworks.com\/pick\/2019\/09\/13\/tiled-layout Sean's on\r\n% POTW>.\r\n%\r\n% I thought it would be fun to make a \"calendar\" of sorts for my travels.\r\n% As the year goes on, I hope to replace the plot each month with an iconic\r\n% picture from my travels.  I will start it off with  junk data.  And I want\r\n% to show my meanders a bit as well.  For now, again, the plot will be with\r\n% nonsense data, to be filled in as the year goes on.\r\n\r\n%% My  Calendar\r\n% Here's my calendar.  \r\nt = tiledlayout(4,4);\r\ntitle(t,\"Loren's 2020 Travels\")\r\nt.TileSpacing = \"compact\";\r\nt.Padding = \"compact\";\r\nnexttile; plot(rand(3)), title(\"Jan\")\r\nnexttile, plot(magic(3)), title(\"Feb\")\r\nnexttile, plot(rand(3)), title(\"Mar\")\r\nnexttile, plot(rand(3)), title(\"Apr\")\r\nnexttile, plot(rand(3)), title(\"May\")\r\nnexttile(8), plot(rand(3)), title(\"Jun\")\r\nnexttile(9), plot(rand(3)), title(\"Jul\")\r\nnexttile(12), plot(rand(3)), title(\"Aug\")\r\nnexttile(13), plot(rand(3)), title(\"Sep\")\r\nnexttile(14), plot(rand(3)), title(\"Oct\")\r\nnexttile(15), plot(rand(3)), title(\"Nov\")\r\nnexttile(16), plot(rand(3)), title(\"Dec\")\r\nnexttile(6,[2,2]); geoplot([-44 77],[172 20],\"m-*\")\r\n%%\r\n% Maybe I should hold a contest to see if my pictures\r\n% each month are identifiable.  I'll decide that later :-).\r\n%% Observations\r\n% Notice how I lay out my grid of plots, which thankfully has room for\r\n% 12 months surrounding the central map.  Did you know that you could lay\r\n% out plots so nicely now?  And add the all important annotations, plot by\r\n% plot, including titles and axis labels?  Let me know\r\n% <https:\/\/blogs.mathworks.com\/loren\/?p=3531#respond here>.\r\n\r\n##### SOURCE END ##### afd03424fb434d3b9bcd82611b76c24f\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2020\/subplotSuccessor_01.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p>I travel a lot.  Mostly for work.  I do try to take advantage of the priviledge - visiting so many amazing places -- and spend a little extra time occasionally.  People even joke that I should be writing a travel blog.  Of course I prefer to write one on MATLAB.  But how about combining these just for fun today.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2020\/01\/14\/how-to-chart-my-year\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/3531"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/comments?post=3531"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/3531\/revisions"}],"predecessor-version":[{"id":3535,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/3531\/revisions\/3535"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=3531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=3531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=3531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}