MATLAB: Can’t I see figure windows in the multiple monitor setup

figureMATLABmaximizeoffscreen

I have a multiple monitor set up. The figure window does not pop up when trying to open it in the Live Editor or plotting from the command line. I need to right click on the small figure window in the bottom, choose "Maximize" and drag it to show the figure.
When I try to locate the default figure position by using the following command:
>> get(0,'DefaultFigurePosition')
I get [-1267 -440 560 420] on all monitors.

Best Answer

A possible workaround to solve the issue is:
  1. Use "matlabroot" command to get the directory of your MATLAB R2020b. For example, I get the following path: E:\MATLAB.
  2. Then find MATLAB\R2020b\toolbox\local\hgrc.m file under the path you get in the step 1.
  3. Try to locate and change the following line in hgrc.m file for changing the default figure position:
>> screen = screenPos(1,:);
to
>> screen = screens(and(screens(:,1)==1,screens(:,2)==1),:);