{"id":962,"date":"2014-08-11T10:53:46","date_gmt":"2014-08-11T15:53:46","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=962"},"modified":"2014-06-26T10:56:42","modified_gmt":"2014-06-26T15:56:42","slug":"ever-needed-to-move-a-figure","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2014\/08\/11\/ever-needed-to-move-a-figure\/","title":{"rendered":"Ever Needed to Move a Figure?"},"content":{"rendered":"\r\n<div class=\"content\"><!--introduction--><p>Have you ever needed to move a figure?  Perhaps because it is offscreen&gt;? Or at least the menus or close box are not visible?  This happens to me from time to time when I get code from someone else who is programming specifically to the size of their display.  Working on a laptop, I often have fewer available pixels.  What to do?<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#2e2275f5-0f8b-4bfe-901d-1e2b6ef6beaf\">How to Find my Figure?<\/a><\/li><li><a href=\"#55a91430-2727-4787-94c5-30e3ec5bd38f\">Degrees of Freedom<\/a><\/li><li><a href=\"#bc6f6f5e-8211-4218-a89a-fa8951e171d1\">Have You Needed Help Locating Something?<\/a><\/li><\/ul><\/div><h4>How to Find my Figure?<a name=\"2e2275f5-0f8b-4bfe-901d-1e2b6ef6beaf\"><\/a><\/h4><p>I used the <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_env\/find-functions-using-the-function-browser.html\">Function Browser<\/a> to search for \"move figure\" and found <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/movegui.html\"><tt>movegui<\/tt><\/a>.  It might be just the ticket for you.<\/p><h4>Degrees of Freedom<a name=\"55a91430-2727-4787-94c5-30e3ec5bd38f\"><\/a><\/h4><p>As you can see from the documentation, <tt>movegui<\/tt> gives you a fair amount of latitude for moving your figure around. The two choices I find most useful and easiest to remember for my purposes: <tt>onscreen<\/tt> and <tt>center<\/tt>. I think you can guess what they each do :-)<\/p><h4>Have You Needed Help Locating Something?<a name=\"bc6f6f5e-8211-4218-a89a-fa8951e171d1\"><\/a><\/h4><p>Do you use the Function Browser to help you?  Do you ever need to reposition \"lost\" figure windows, like I have?  Let me know <a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=962#respond\">here<\/a>.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_07c15c0fff324e59a5f15594da791d23() {\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='07c15c0fff324e59a5f15594da791d23 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 07c15c0fff324e59a5f15594da791d23';\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 2014 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_07c15c0fff324e59a5f15594da791d23()\"><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; R2014a<br><\/p><\/div><!--\r\n07c15c0fff324e59a5f15594da791d23 ##### SOURCE BEGIN #####\r\n%% Ever Needed to Move a Figure?\r\n% Have you ever needed to move a figure?  Perhaps because it is offscreen>?\r\n% Or at least the menus or close box are not visible?  This happens to me\r\n% from time to time when I get code from someone else who is programming\r\n% specifically to the size of their display.  Working on a laptop, I often\r\n% have fewer available pixels.  What to do?\r\n%% How to Find my Figure?\r\n% I used the\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/matlab_env\/find-functions-using-the-function-browser.html\r\n% Function Browser> to search for \"move figure\" and found\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/movegui.html |movegui|>.  It\r\n% might be just the ticket for you.\r\n\r\n%% Degrees of Freedom\r\n% As you can see from the documentation, |movegui| gives you a fair amount\r\n% of latitude for moving your figure around. The two choices I find most\r\n% useful and easiest to remember for my purposes: |onscreen| and |center|.\r\n% I think you can guess what they each do :-)\r\n\r\n%% Have You Needed Help Locating Something?\r\n% Do you use the Function Browser to help you?  Do you ever need to\r\n% reposition \"lost\" figure windows, like I have?  Let me know\r\n% <https:\/\/blogs.mathworks.com\/loren\/?p=962#respond here>.\r\n\r\n\r\n##### SOURCE END ##### 07c15c0fff324e59a5f15594da791d23\r\n-->","protected":false},"excerpt":{"rendered":"<!--introduction--><p>Have you ever needed to move a figure?  Perhaps because it is offscreen&gt;? Or at least the menus or close box are not visible?  This happens to me from time to time when I get code from someone else who is programming specifically to the size of their display.  Working on a laptop, I often have fewer available pixels.  What to do?... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2014\/08\/11\/ever-needed-to-move-a-figure\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[21,39],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/962"}],"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=962"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/962\/revisions"}],"predecessor-version":[{"id":968,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/962\/revisions\/968"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}