MATLAB set figure background

It is ugly to take a screenshot from matlab figure directly because of the grey background. Sometimes I wanna change it to white and look more harmonious.

In matlatb, we could use following command to change the figure properties:

set(gcf,'color','w')

However, it can only work for single figure. If you want to set it to default, you may need:

set(0,'defaultfigurecolor','w')

And then, it works. But when you restart the matlab, you need to type the command again. Is there any to run some command at start up automatically? Of course.

The first choice is to use -r option in terminal(if you under LINUX), just like this:

matlab -r 'set(0,'defaultfigurecolor','w');'

The second choice is to add personal command content to matlatb start up file, such as matlabroot/toolbox/local/matlabrc.m, just add it at the file’s ending(It is a write protectly file, you should be careful)

此条目发表在LINUX, 软件安装分类目录,贴了标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。