{"id":11525,"date":"2020-05-17T08:55:08","date_gmt":"2020-05-17T12:55:08","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=11525"},"modified":"2020-05-17T08:55:08","modified_gmt":"2020-05-17T12:55:08","slug":"changing-figure-settings","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2020\/05\/17\/changing-figure-settings\/","title":{"rendered":"Changing figure settings"},"content":{"rendered":"\r\n<div class=\"content\"><p><a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871\">Jiro<\/a>'s Pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/75507\">SetFigPaper<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/5890853\">jmrplens<\/a>.<\/p><p>Many of you may know <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/23629\">export_fig<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/642467-yair-altman\">Yair<\/a> (originally created by Oliver Woodford) which gives you many options for exporting your figures. jmrplens's <tt>setfigpaper<\/tt> reminded me of this. It's much simpler in the things it does, but it's elegantly simple, with options that are typically needed for formating your figure.<\/p><p>Here is a sample figure from the example code that is included with this entry.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_setfigpaper\/setfigpaper_sample.png\" alt=\"\"> <\/p><p>Then you call <tt>setfigpaper<\/tt> with appropriate parameters.<\/p><pre class=\"language-matlab\">setfigpaper(<span class=\"string\">'Width'<\/span>,[20,0.5],<span class=\"string\">'FontName'<\/span>,<span class=\"string\">'Calibri'<\/span>,<span class=\"string\">'FontSize'<\/span>,12,<span class=\"string\">'Grayscale'<\/span>,1)\r\n<\/pre><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_setfigpaper\/setfigpaper_sample2.png\" alt=\"\"> <\/p><p>What's impressive is that he has tested this with over 70 different plot types (see the help for this function), including <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/parallelplot.html\"><tt>parallelplot<\/tt><\/a> which was introduced in R2019a.<\/p><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=11525#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/75507#comment\">comment<\/a> for jmrplens.<\/p><p><b>New Reputation Points and Short-Term Leaderboard<\/b><\/p><p>Oh, and one more thing. We have introduced a new type of recognition called <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/about\/fx\/?s_tid=gn_mlc_fex_rep#Build_Reputation\">\"reputation points\"<\/a>, which you can earn based on some activities, such as receiving a 4 or 5-star rating. But what's exciting is that if your entry gets Picked as a Pick of the week, you get 50 points!<\/p><p>Another new feature is the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\">Short-Term Leaderboard<\/a>. Before, you only saw the all-time leaderboard, and for those of you who started contributing later in the game had a difficult time getting on the top leaderboard. But we believe people should be recognized just as much for the recent contributions as for the legacy contributions from many years ago. With the current leaderboard, you can view the rankings by week, month, year, or all-time.<\/p><p>Read about it <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/discussions\/highlights\/132408\">here<\/a>.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_4a401d311a214f3db92db2c6834914a7() {\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='4a401d311a214f3db92db2c6834914a7 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 4a401d311a214f3db92db2c6834914a7';\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 2020 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_4a401d311a214f3db92db2c6834914a7()\"><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; R2020a<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2020a<br><\/p><\/div><!--\r\n4a401d311a214f3db92db2c6834914a7 ##### SOURCE BEGIN #####\r\n%%\r\n% <http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871 Jiro>'s\r\n% Pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/75507 SetFigPaper>\r\n% by <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/5890853\r\n% jmrplens>.\r\n%\r\n% Many of you may know\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/23629 export_fig>\r\n% by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/642467-yair-altman\r\n% Yair> (originally created by Oliver Woodford) which gives you many\r\n% options for exporting your figures. jmrplens's |setfigpaper| reminded me\r\n% of this. It's much simpler in the things it does, but it's elegantly\r\n% simple, with options that are typically needed for formating your figure.\r\n% \r\n% Here is a sample figure from the example code that is included with this\r\n% entry.\r\n%\r\n% <<setfigpaper_sample.png>>\r\n%\r\n% Then you call |setfigpaper| with appropriate parameters.\r\n%\r\n%   setfigpaper('Width',[20,0.5],'FontName','Calibri','FontSize',12,'Grayscale',1)\r\n%\r\n% <<setfigpaper_sample2.png>>\r\n%\r\n% What's impressive is that he has tested this with over 70 different plot\r\n% types (see the help for this function), including\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/parallelplot.html\r\n% |parallelplot|> which was introduced in R2019a.\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=11525#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/75507#comment\r\n% comment> for jmrplens.\r\n%\r\n% *New Reputation Points and Short-Term Leaderboard*\r\n%\r\n% Oh, and one more thing. We have introduced a new type of recognition\r\n% called\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/about\/fx\/?s_tid=gn_mlc_fex_rep#Build_Reputation\r\n% \"reputation points\">, which you can earn based on some activities, such\r\n% as receiving a 4 or 5-star rating. But what's exciting is that if your\r\n% entry gets Picked as a Pick of the week, you get 50 points!\r\n%\r\n% Another new feature is the\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors Short-Term\r\n% Leaderboard>. Before, you only saw the all-time leaderboard, and for\r\n% those of you who started contributing later in the game had a difficult\r\n% time getting on the top leaderboard. But we believe people should be\r\n% recognized just as much for the recent contributions as for the\r\n% legacy contributions from many years ago. With the current leaderboard,\r\n% you can view the rankings by week, month, year, or all-time.\r\n%\r\n% Read about it\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/discussions\/highlights\/132408\r\n% here>.\r\n##### SOURCE END ##### 4a401d311a214f3db92db2c6834914a7\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_setfigpaper\/setfigpaper_sample.png\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\nJiro's Pick this week is SetFigPaper by jmrplens.Many of you may know export_fig by Yair (originally created by Oliver Woodford) which gives you many options for exporting your figures. jmrplens's... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2020\/05\/17\/changing-figure-settings\/\">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\/11525"}],"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=11525"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11525\/revisions"}],"predecessor-version":[{"id":11529,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11525\/revisions\/11529"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=11525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=11525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=11525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}