{"id":9568,"date":"2018-03-23T09:00:39","date_gmt":"2018-03-23T13:00:39","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=9568"},"modified":"2018-03-23T09:56:12","modified_gmt":"2018-03-23T13:56:12","slug":"keeping-track-of-figures","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2018\/03\/23\/keeping-track-of-figures\/","title":{"rendered":"Keeping track of figures"},"content":{"rendered":"<div class=\"content\">\n<p><!--introduction--><!--\/introduction--><\/p>\n<p><a href=\"https:\/\/www.mathworks.com\/\/matlabcentral\/fileexchange\/authors\/911\">Brett<\/a>&#8216;s Pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/41891-figmenu--an-automatic-figure-selection-menu\"><tt>figmenu<\/tt><\/a>, by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/20355\">Douglas Schwarz<\/a>.<\/p>\n<p>I cut my MATLAB teeth some 25 years ago surfing the now-defunct CSSM newsgroup that formed the original heart of MATLAB Central. Getting started, writing what I now know to be horribly ugly (but functional!) code, I learned very much from a few key contributors. Doug was one of them&#8211;always ready with a thougthful answer to my naive questions. And his code was always solid and well written&#8211;guiding me down my current path. (Thanks, Doug!)<\/p>\n<p>Doug&#8217;s <tt>figmenu<\/tt> is a simple utility that helps to manage multiple figures. When &#8216;on,&#8217; all new figures are created with a &#8220;figures&#8221; menu with which figures can be controlled:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/figmenuFig1.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/><\/p>\n<p>As you can see, you can cycle through, maximize, restore, or close any open figures. You can also programmatically query the state of the figmenu, or add or remove figures from the uimenu list. There are many ways of managing your figures; <tt>figmenu<\/tt> is a nice addition to that arsenal. (Doug suggests in the header of his function that you consider adding <tt>figmenu<\/tt> to your <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/startup-and-shutdown.html\">startup<\/a> file.)<\/p>\n<p>I have one minor suggestion for Doug: I like to keep my windows <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.ui.figure-properties.html\">docked<\/a> by default. (In fact, I set that as a &#8220;windowstyle&#8221; preference in <i>my<\/i> startup file.) But if I try to &#8220;maximize&#8221; a docked figure window using <tt>figmenu<\/tt>, I get a bunch of warnings. That could probably be handled more gracefully.<\/p>\n<p>Nonetheless, this is a really nice tool. Thanks, Doug, for many years of contributions to the MathWorks community, and for this useful tool!<\/p>\n<p>As always, I welcome your <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=9568#respond\">thoughts and comments<\/a>.<\/p>\n<p><script language=\"JavaScript\"> <!-- \n    function grabCode_1ab58d09274f4406a236caf76424541f() {\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='1ab58d09274f4406a236caf76424541f ' + '##### ' + 'SOURCE BEGIN' + ' #####';\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 1ab58d09274f4406a236caf76424541f';\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        copyright = 'Copyright 2018 The MathWorks, Inc.';\n\n        w = window.open();\n        d = w.document;\n        d.write('<\/p>\n\n\n\n\n<p>\n<\/p>\n\n\n\n\n<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\n\n\n\n<p>\n<\/p>\n\n\n\n\n<p>\\n');\n\n        d.title = title + ' (MATLAB code)';\n        d.close();\n    }   \n     --> <\/script><\/p>\n<p style=\"text-align: right; font-size: xx-small; font-weight: lighter; font-style: italic; color: gray;\"><a><span style=\"font-size: x-small; font-style: italic;\">Get<br \/>\nthe MATLAB code<noscript>(requires JavaScript)<\/noscript><\/span><\/a><\/p>\n<p>Published with MATLAB\u00ae R2018a<\/p>\n<\/div>\n<p><!--\n1ab58d09274f4406a236caf76424541f ##### SOURCE BEGIN #####\n%% Keeping track of figures\n%%\n% <https:\/\/www.mathworks.com\/\/matlabcentral\/fileexchange\/authors\/911 Brett>'s\n% Pick this week is\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/41891-figmenu--an-automatic-figure-selection-menu |figmenu|>,\n% by <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/20355 Douglas % Schwarz>.\n%\n% I cut my MATLAB teeth some 25 years ago surfing the now-defunct CSSM\n% newsgroup that formed the original heart of MATLAB Central. Getting\n% started, writing what I now know to be horribly ugly (but functional!)\n% code, I learned very much from a few key contributors. Doug was one of\n% themREPLACE_WITH_DASH_DASHalways ready with a thougthful answer to my naive questions. And\n% his code was always solid and well writtenREPLACE_WITH_DASH_DASHguiding me down my current\n% path. (Thanks, Doug!)\n%\n% Doug's |figmenu| is a simple utility that helps to manage multiple\n% figures. When 'on,' all new figures are created with a \"figures\" menu\n% with which figures can be controlled:\n%%\n%\n% <<https:\/\/blogs.mathworks.com\/pick\/files\/figmenuFig1.png>>\n%\n\n%%\n% As you can see, you can cycle through, maximize, restore, or close any\n% open figures. You can also programmatically query the state of the\n% figmenu, or add or remove figures from the uimenu list. There are many\n% ways of managing your figures; |figmenu| is a nice addition to that\n% arsenal. (Doug suggests in the header of his function that you consider\n% adding |figmenu| to your\n% <https:\/\/www.mathworks.com\/help\/matlab\/startup-and-shutdown.html startup>\n% file.)\n\n%%\n% I have one minor suggestion for Doug: I like to keep my windows\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.ui.figure-properties.html % docked>\n% by default. (In fact, I set that as a \"windowstyle\" preference in _my_ startup file.) But if\n% I try to \"maximize\" a docked figure window using |figmenu|, I get a bunch of warnings.\n% That could probably be handled more gracefully.\n\n%%\n% Nonetheless, this is a really nice tool. Thanks, Doug, for many years of\n% contributions to the MathWorks community, and for this useful tool!\n%%\n% As always, I welcome your\n% <https:\/\/blogs.mathworks.com\/pick\/?p=9568#respond thoughts and comments>.\n##### SOURCE END ##### 1ab58d09274f4406a236caf76424541f\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/figmenuFig1.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>Brett&#8216;s Pick this week is figmenu, by Douglas Schwarz.<br \/>\nI cut my MATLAB teeth some 25 years ago surfing the now-defunct CSSM newsgroup that formed the original heart of MATLAB Central. Getting&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2018\/03\/23\/keeping-track-of-figures\/\">read more >><\/a><\/p>\n","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\/9568"}],"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=9568"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/9568\/revisions"}],"predecessor-version":[{"id":9590,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/9568\/revisions\/9590"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=9568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=9568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=9568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}