{"id":9940,"date":"2018-07-13T09:00:24","date_gmt":"2018-07-13T13:00:24","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=9940"},"modified":"2018-07-12T18:52:09","modified_gmt":"2018-07-12T22:52:09","slug":"maximize-your-figures","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2018\/07\/13\/maximize-your-figures\/","title":{"rendered":"Maximize your figures"},"content":{"rendered":"<div class=\"content\"><p><a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871\">Jiro&#8217;s<\/a> pick this week is a new feature in R2018a to <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.ui.figure-properties.html?searchHighlight=windowstate&amp;s_tid=doc_srchtitle#d119e305946\">maximize\/minimize<\/a> the figure window.<\/p><p>For quite some time, people have created <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/?term=maximize+figure\">many entries<\/a> for controlling the state of figure windows. Some of them set the figure position to match the size of the screen. Some even adjust the size so that the window does not overlap with the task bar. Other entries make use of the underlying JavaFrame.<\/p><p>R2018a now provides documented <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/figure.html\"><tt>figure<\/tt><\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/uifigure.html\"><tt>uifigure<\/tt><\/a> property called <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.ui.figure-properties.html?searchHighlight=windowstate&amp;s_tid=doc_srchtitle#d119e305946\"><tt>WindowState<\/tt><\/a>. The property takes one of the following 4 strings:<\/p><div><ul><li><tt>'normal'<\/tt> (default) &#8211; The normal state of figure windows.<\/li><li><tt>'maximized'<\/tt> &#8211; Same as clicking on the maximize button on the figure.<\/li><li><tt>'minimized'<\/tt> &#8211; Same as clicking on the minimize button on the figure.<\/li><li><tt>'fullscreen'<\/tt> &#8211; Fills the screen with the minimize, restore, close button hidden.<\/li><\/ul><\/div><pre class=\"language-matlab\">f = figure;\r\nf.WindowState = <span class=\"string\">'maximized'<\/span>;\r\n<\/pre><p><b>Comments<\/b><\/p><p>Give it a try and let us know what you think <a href=\"http:\/\/blogs.mathworks.com\/pick\/?p=9940#respond\">here<\/a>.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_b3ef7a73978146ae89955d73f123e069() {\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='b3ef7a73978146ae89955d73f123e069 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' b3ef7a73978146ae89955d73f123e069';\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 2018 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_b3ef7a73978146ae89955d73f123e069()\"><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; R2018a<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2018a<br><\/p><\/div><!--\r\nb3ef7a73978146ae89955d73f123e069 ##### SOURCE BEGIN #####\r\n%%\r\n% <http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871 Jiro>'s\r\n% pick this week is a new feature in R2018a to\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.ui.figure-properties.html?searchHighlight=windowstate&s_tid=doc_srchtitle#d119e305946\r\n% maximize\/minimize> the figure window.\r\n%\r\n% For quite some time, people have created\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/?term=maximize+figure\r\n% many entries> for controlling the state of figure windows. Some of them\r\n% set the figure position to match the size of the screen. Some even\r\n% adjust the size so that the window does not overlap with the task bar.\r\n% Other entries make use of the underlying JavaFrame.\r\n%\r\n% R2018a now provides documented\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/figure.html |figure|> and\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/uifigure.html |uifigure|>\r\n% property called\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.ui.figure-properties.html?searchHighlight=windowstate&s_tid=doc_srchtitle#d119e305946\r\n% |WindowState|>. The property takes one of the following 4 strings:\r\n%\r\n% * |'normal'| (default) - The normal state of figure windows.\r\n% * |'maximized'| - Same as clicking on the maximize button on the figure.\r\n% * |'minimized'| - Same as clicking on the minimize button on the figure.\r\n% * |'fullscreen'| - Fills the screen with the minimize, restore, close\r\n% button hidden.\r\n%\r\n%   f = figure;\r\n%   f.WindowState = 'maximized';\r\n%\r\n% *Comments*\r\n%\r\n% Give it a try and let us know what you think\r\n% <http:\/\/blogs.mathworks.com\/pick\/?p=9940#respond here>.\r\n\r\n##### SOURCE END ##### b3ef7a73978146ae89955d73f123e069\r\n-->","protected":false},"excerpt":{"rendered":"<p>Jiro&#8217;s pick this week is a new feature in R2018a to maximize\/minimize the figure window.For quite some time, people have created many entries for controlling the state of figure windows. Some&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2018\/07\/13\/maximize-your-figures\/\">read more >><\/a><\/p>","protected":false},"author":35,"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\/9940"}],"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\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=9940"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/9940\/revisions"}],"predecessor-version":[{"id":9948,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/9940\/revisions\/9948"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=9940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=9940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=9940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}