Matlab figure disappears in multiple monitor setup

25 sec read

I have multiple monitors attached to my laptop. Whenever I want to create a new figure in MatLab, the main screen seems to flash once and the figure is nowhere to find.

The reason is the DefaultFigurePosition property. If you run

get(0,'DefaultFigurePosition')

You probably will find the values are out of your screen, and that’s exactly the reason. For example, on my computer the first value (left) is negative, and 2nd value (bottom) is too large.

The solution is to use the following command

set(0,'defaultfigureposition',[680 278 560 420])

You don’t want to manually run the above command everytime you run MatLab. So you can put the command to the startup.m file, which is located in \toolbox\local\startup.m


Don't want to miss new papers in your field? Check out Stork we developed:

nirs2img, create an image file from NIRS data

I was asked where to get nirs2img script. Here it is. The download link is at the bottom of this article. nirs2img is to...
Xu Cui
51 sec read

mergefile.m – a MatLab script to merge CSV files

My wife asked me to write a script to merge some csv files she has. Usually this can be accomplished by a simple command in...
Xu Cui
35 sec read

xjview 9.6 released

In this version, we modified the templates for 3-D render view and use a high-resolution template. It also includes a few scalp view. You...
Xu Cui
31 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *