{"id":2582,"date":"2010-08-06T13:35:17","date_gmt":"2010-08-06T13:35:17","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2010\/08\/06\/labeling-an-array-of-subplots\/"},"modified":"2010-08-06T13:35:17","modified_gmt":"2010-08-06T13:35:17","slug":"labeling-an-array-of-subplots","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2010\/08\/06\/labeling-an-array-of-subplots\/","title":{"rendered":"Labeling an Array of Subplots"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction><\/introduction>\r\n   <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/911\">Brett<\/a>'s Pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/3218-mtit--a-pedestrian-major-title-creator\">\"MTIT: A Pedestrian Major Title Creator\"<\/a>, by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/4309\">Us<\/a>.\r\n   <\/p>\r\n   <p>If you have the <a href=\"https:\/\/www.mathworks.com\/products\/bioinfo\/\">Bioinformatics Toolbox<\/a>, you may be familiar with the <tt>suptitle<\/tt> function, which was originally created as a helper function for an in-Toolbox demo. Additionally, and especially if you've\r\n      been following this blog for a long time, you may be familiar with <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/12143\">Ben Barrowes's<\/a> Toolbox-independent <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/7772-suplabel\"><tt>suplabel<\/tt><\/a>, which my predecessor <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/3777\">Scott Hirsch<\/a> <a href=\"https:\/\/blogs.mathworks.com\/pick\/2005\/06\/08\/super-labels\/\">selected<\/a> as a Pick-of-the-Week in June of 2005.\r\n   <\/p>\r\n   <p>This week, I wanted to feature another entry in the \"label-your-subplots\" category. Us's <tt>mtit<\/tt> is, as we've come to expect, solidly implemented, and the syntax is simple, and, in the output variable, provides easy access\r\n      to changing the properties of the text-containing axes and the label (text) itself.\r\n   <\/p>\r\n   <p><tt>img = imread('peppers.png');<\/tt><\/p>\r\n   <p><tt>exploreRGB(img,2)<\/tt><\/p>\r\n   <p><tt>h = mtit('Here is my Supertitle');<\/tt><\/p>\r\n   <p><tt>set(h.th,'fontsize',18,'color','b')<\/tt><\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/majortitle.png\"> <\/p>\r\n   <p>(Pardon the plug for my own <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/19-delta-sigma-toolbox-explorergb\"><tt>exploreRGB<\/tt><\/a>; I find it quite useful when I'm analyzing color images. Consider it lagniappe, and grab it if you'd like!)\r\n   <\/p>\r\n   <p><a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2582#respond\"> Comments?<\/a>\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_0030ec63f3244b608fa7b557ef051a7f() {\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='0030ec63f3244b608fa7b557ef051a7f ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 0030ec63f3244b608fa7b557ef051a7f';\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 = 'Brett Shoelson';\r\n        copyright = 'Copyright 2010 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_0030ec63f3244b608fa7b557ef051a7f()\"><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.10<br><\/p>\r\n<\/div>\r\n<!--\r\n0030ec63f3244b608fa7b557ef051a7f ##### SOURCE BEGIN #####\r\n%% Labeling an Array of Subplots\r\n%% \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/911 Brett>'s Pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/3218-mtit--a-pedestrian-major-title-creator \"MTIT: A Pedestrian Major Title Creator\">, by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/4309 Us>.\r\n\r\n%%\r\n% If you have the <https:\/\/www.mathworks.com\/products\/bioinfo\/ Bioinformatics Toolbox>,\r\n% you may be familiar with the |suptitle|\r\n% function, which was originally created as a helper function for an in-Toolbox demo.\r\n% Additionally, and especially if you've been following this blog for a long time,\r\n% you may be familiar with <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/12143 Ben Barrowes's> Toolbox-independent \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/7772-suplabel |suplabel|>, which my predecessor <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/3777 Scott Hirsch>\r\n% <https:\/\/blogs.mathworks.com\/pick\/2005\/06\/08\/super-labels\/ selected> as a Pick-of-the-Week in June of 2005.\r\n\r\n%% \r\n% This week, I wanted to feature another entry in the \"label-your-subplots\"\r\n% category. Us's |mtit| is, as we've come to expect, solidly implemented,\r\n% and the syntax is simple, and, in the output variable, provides easy\r\n% access to changing the properties of the text-containing axes and the\r\n% label (text) itself.\r\n%\r\n% |img = imread('peppers.png');|\r\n%\r\n% |exploreRGB(img,2)|\r\n%\r\n% |h = mtit('Here is my Supertitle');|\r\n%\r\n% |set(h.th,'fontsize',18,'color','b')|\r\n\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/majortitle.png>>\r\n% \r\n\r\n%%\r\n% (Pardon the plug for my own\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/19-delta-sigma-toolbox-explorergb |exploreRGB|>; I find it quite useful when I'm analyzing color images. Consider it lagniappe, and grab it if you'd like!)\r\n%%\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2582#respond  Comments?>\r\n\r\n##### SOURCE END ##### 0030ec63f3244b608fa7b557ef051a7f\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n   Brett's Pick this week is \"MTIT: A Pedestrian Major Title Creator\", by Us.\r\n   \r\n   If you have the Bioinformatics Toolbox, you may be familiar with the suptitle function, which was... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2010\/08\/06\/labeling-an-array-of-subplots\/\">read more >><\/a><\/p>","protected":false},"author":34,"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\/2582"}],"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\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2582"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2582\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}