做app 的模板下载网站有哪些内容,淘客优惠券网站建设,公司网站开发有哪些,建设工程管理是做什么的Matlab:不包含边界和工具栏的figure(移除保存图片的白边)当我们使用matlab的imshow命令显示图片时#xff0c;会有白框和工具栏出现。在保存图片时会出现白色的边框。下面将说明如何去除这些显示。Matlab启动时运行脚本script.m#xff0c;文件位置在~/matlab/ directory。在…Matlab:不包含边界和工具栏的figure(移除保存图片的白边)当我们使用matlab的imshow命令显示图片时会有白框和工具栏出现。在保存图片时会出现白色的边框。下面将说明如何去除这些显示。Matlab启动时运行脚本script.m文件位置在~/matlab/ directory。在该文件加上一行或者在显示figure时加命令iptsetpref(ImshowBorder,tight);图片即可显示并且保存时没有白框。此方法仅仅适用imshow命令不适用imagesc命令。如果在startup.m文件中包含以下命令%在所有的figure去除菜单栏和工具栏set(0,DefaultFigureMenu,none);%disp命令显示无空行format compact;这三条命令可以去除matlab默认的很多没有意义的显示信息。翻译原文http://www.shawnlankton.com/2007/06/matlab-figures-without-borders-and-toolbars/comment-page-1/#comment-2101Something that has bothered me for *the entire* time I’ve used it is that when you show images using ‘imshow’ the resulting figure has the image surrounded in a sea of gray border. Well, I hate that gray border. It serves no purpose and today I have figuredout how to remove it!Matlab runs a script called ‘startup.m’ when it starts. This is located in your ~/matlab/ directory. If you include this line into that file (or just type it before you make the figure) then you remove the gray border:iptsetpref(ImshowBorder,tight);Its glorious… Now the picture scales to fill the whole window! (note this only works with the ‘imshow’ command, not ‘imagesc’).BUT! That’s not all. I also learned about some other cute little tricks that should be included in your startup.m (if you’re me at least).%removes menu and toolbar from all new figuresset(0,DefaultFigureMenu,none);%makes disp() calls show things without empty linesformat compact;I feel like these three commands cut a lot of the pointless (inefficient) crap out of Matlab’s default display interface. Thanks to commenter Matt whopointed me toward the set(0,’Default… thing. You can use this to set up *tons* of settings so that you don’t have to set it every time. Just call:set(0,Default);For some other useful tips on exporting figures for papers, check this relatedpost.