Controlling default location where figures are drawn

33 views (last 30 days)
I find that whenever I create a sequence of figures, they are all drawn overlapped in the same location on the screen, so that I have to do a lot of clicking and dragging to view them. Is there a preference setting somewhere that can change this default behavior, e.g., so that when they are drawn, they appear before me spread out like a deck of cards across the desktop?

Accepted Answer

Walter Roberson
Walter Roberson on 7 Nov 2015
The location that figures are placed at, when not placed specifically, is the coordinates
get(0,'DefaultFigurePosition')
with units get(0,'DefaultFigureUnits') . (For R2014b or later, it is better to use groot instead of 0 in these commands, so for example get(groot,'DefaultFigurePosition')
These values are fixed coordinates that do not take into account any other figure that might exist.
You might want to set the root DefaultFigureWindowStyle to 'docked' . This will get you tabbed plots instead of being all spread out.
You could also set the root DefaultFigureCreateFcn to the handle of a routine you create, and give that routine the responsibility of looking to see where existing figures are, and setting the Position to display elsewhere. Watch out for figures that are being positioned by program; you could probably detect them by noticing that their Position would not match the default Position.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!