{"id":2442,"date":"2009-07-10T11:45:37","date_gmt":"2009-07-10T11:45:37","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2009\/07\/10\/addaxis\/"},"modified":"2017-01-06T21:23:54","modified_gmt":"2017-01-07T02:23:54","slug":"addaxis","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2009\/07\/10\/addaxis\/","title":{"rendered":"addaxis"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction>\r\n      <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/5021\">Bob<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/9016-addaxis\">addaxis<\/a>  by Harry Lee.\r\n      <\/p>\r\n   <\/introduction>\r\n\r\n   <p>First, I'd like to thank Andres for drawing my attention to this submission with his <a href=\"https:\/\/blogs.mathworks.com\/pick\/2009\/07\/02\/linkzoom\/#comment-13193\">comment<\/a> to last week's pick, <a href=\"https:\/\/blogs.mathworks.com\/pick\/2009\/07\/02\/linkzoom\">linkzoom<\/a>.\r\n   <\/p>\r\n   <p>What <tt>addaxis<\/tt> provides is a way to overlay plots. Suppose you want to compare a set of curves. They share common units along the X axes\r\n      (ie, time) but their Y scales are different. Plotting them on the same axes may not be useful. Using a number of subplots\r\n      may be undesirable as well. Harry's solution might be something to consider.\r\n   <\/p>\r\n   <p>This submission is a mini toolbox of functions. The example above uses <tt>addaxis<\/tt>, <tt>addaxislabel<\/tt> and <tt>addaxisplot<\/tt>. Just type \"help addaxis\" at the MATLAB command prompt. You might also check out his Readme.txt file to get started.\r\n   <\/p>\r\n   <p>This type of plotting capability is very specialized which is reflected in his design approach. If it doesn't meet your exact\r\n      needs, just modify it. Sure beats starting from scratch!\r\n   <\/p>\r\n   <p><a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2442#respond\">Comments?<\/a><\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_b9a2f89f880e424ea209b685499ac0a4() {\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='b9a2f89f880e424ea209b685499ac0a4 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' b9a2f89f880e424ea209b685499ac0a4';\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        author = 'Robert Bemis';\r\n        copyright = 'Copyright 2009 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 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');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \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_b9a2f89f880e424ea209b685499ac0a4()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.9<br><\/p>\r\n<\/div>\r\n<!--\r\nb9a2f89f880e424ea209b685499ac0a4 ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/5021 Bob>'s \r\n% pick this week is \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/9016-addaxis addaxis> \r\n%  by Harry Lee.\r\n%%\r\n% https:\/\/www.mathworks.com\/matlabcentral\/fx_files\/9016\/1\/addaxis_screenshot.jpg\r\n%%\r\n% First, I'd like to thank Andres for drawing my attention to this submission\r\n% with his \r\n% <https:\/\/blogs.mathworks.com\/pick\/2009\/07\/02\/linkzoom\/#comment-13193 comment>\r\n% to last week's pick, \r\n% <https:\/\/blogs.mathworks.com\/pick\/2009\/07\/02\/linkzoom linkzoom>.\r\n% \r\n%%\r\n% What |addaxis| provides is a way to overlay plots. Suppose you want to\r\n% compare a set of curves. They share common units along the X axes (ie,\r\n% time) but their Y scales are different. Plotting them on the same axes may\r\n% not be useful. Using a number of subplots may be undesirable as well.\r\n% Harry's solution might be something to consider. \r\n%%\r\n% This submission is a mini toolbox of functions. The example above uses\r\n% |addaxis|, |addaxislabel| and |addaxisplot|. Just type \"help addaxis\" at\r\n% the MATLAB command prompt. You might also check out his Readme.txt file to\r\n% get started.\r\n%%\r\n% This type of plotting capability is very specialized which is reflected in\r\n% his design approach. If it doesn't meet your exact needs, just modify it.\r\n% Sure beats starting from scratch!\r\n%%\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2442#respond Comments?>\r\n\r\n##### SOURCE END ##### b9a2f89f880e424ea209b685499ac0a4\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n      Bob's pick this week is addaxis  by Harry Lee.\r\n      \r\n   \r\n\r\n   First, I'd like to thank Andres for drawing my attention to this submission with his comment to last week's... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2009\/07\/10\/addaxis\/\">read more >><\/a><\/p>","protected":false},"author":46,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2442"}],"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\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2442"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2442\/revisions"}],"predecessor-version":[{"id":8326,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2442\/revisions\/8326"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}