bio_img_graphics-and-apps

MATLAB Graphics and App Building

MATLAB graphics, data visualization, and app building

Introducing the Tabbed Figure Container

Brian Knolhoff Guest Writer: Brian Knolhoff
Brian is a software engineer on the Figure Infrastructure and Services team at MathWorks.  After first encountering MATLAB while calibrating radar systems, he now enjoys building and modernizing the tools that support engineers and scientists in their daily work.  Outside of the office, Brian enjoys playing guitar, hockey, and board games, and maintains a collection of vintage and modern pinball machines.
Okay everybody, let's all hop in the DeLorean, and set the time controls for July 2002. Online gaming has finally come to the PS2, Attack of the Clones is out (but everyone is really just waiting for The Two Towers to come out in December), and here in Massachusetts where I live, everyone is still arguing about The Tuck Rule, whatever that is.
Also, MATLAB R13 just hit the shelves. After installing from your CD-ROM, you run a script that creates figures and captures a screenshot to bring with you back to the future.
Now, back in 2025, you run a similar script in MATLAB R2023b, and compare.
for n = 1:6
    figure;
    ord = n+8;
    m = magic(ord);
    imagesc(m);
    title(num2str(ord));
    axis equal;
end
Here's what you see:
MATLAB R13 (2002) 👇

MATLAB R2023b 👇

 

R2025a: Bringing Figures into the Future

Despite significant changes over the last 20 years, including faster computers and larger widescreen monitors that look great for watching The Two Towers, figures in MATLAB have the same look and feel as they did 20 years ago:
  • They are small relative to most monitor sizes
  • They all launch on top of one another
  • They lack modern UI elements as seen in the MATLAB Desktop, such as a toolstrip
With MATLAB R2025a, we have redesigned how figures look and feel to take advantage of modern computing resources.By default, figures now launch into an undocked Figure Container:

Figure Container Features

The Figure Container has a variety of new features designed to make data exploration and organization of your figures easier.

New Figure Default Size

Figures launch at a larger default size than in previous releases, calculated dynamically based on your screen size. The aspect ratio is different as well, designed with modern widescreen monitors in mind.

Enhanced Persistence

When you interactively resize the Figure Container, that new size is remembered throughout your MATLAB session. So, if you close all your docked figures and then open a new one, that interactive position and size is restored.

Figures as Tabs for Organization

By default, figures launch as tabs in a Figure Container. This organizes all your data exploration figures into one place. Figures can still be easily undocked – you can either drag & drop them out of the Figure Container or launch them stand-alone programmatically:
f = figure('WindowStyle','normal');

Tiling Figures

Figures can be easily tiled within the Figure Container for visual comparisons. You can do this either from the toolstrip, interactively via drag and drop, or through our context menu! Watch this video to see these tips in action.

Toolstrip and Side Panels

By default, all figures generated by the figure() command now launch with an integrated toolstrip and side panel tools. Stay tuned to the Graphics and App Building Blog for my colleague Travis's article on these new features!

Some Frequently Asked Questions

Another quick trip in the DeLorean, and I'm back with some commonly asked questions when using the new workflow…

What About App Workflows? Will Apps Launch Docked?

Many users use figures for app workflows, either using AppDesigner, or building them manually using the uifigure command. We automatically detect these workflows, and the apps launch undocked, without a toolstrip.

How About Scripts That Set Figure Position?

Many users also use scripts to launch figures and place them at a particular position on the screen using the Position property. How does that work for a docked figure?
Previously, MATLAB would issue a warning if you tried to set Position on a docked figure. However, now in these circumstances, we do as you say! No need to worry about warnings; the figure will automatically undock and render at the specified position.
f1 = figure("Position", [25 81 600 445]);
colormap(f1,"nebula");
surf(peaks);
[x,y] = meshgrid(-7:0.1:7);
z = sin(x) + cos(y);
contourLevels = 50;
f2 = figure("Position", [626 81 600 445]);
colormap(f2,"lines");
contour(x,y,z, contourLevels, "LineWidth", 2);

Are There Other Auto-Undock Features?

Like setting Position, some other Figure name-value argument combinations will automatically undock your figures. These properties include Position, OuterPosition, Resize, WindowState, MenuBar, Toolbar, and DockControls. This behavior occurs because certain values for these properties are inconsistent with the nature of a docked figure. We recognize that users’ existing scripts may set these values, so to preserve script compatibility, figures are automatically undocked when any of these property-value combinations are applied.
Similarly, setting a figure’s MenuBar property to ‘figure’ will convert the figure from containing a toolstrip to containing a MenuBar instead. This will also undock the figure since all the figures docked into the Figure Container have a toolstrip.
More information on specific properties can be found on our Figure Properties help page.

Why is WindowStyle still “Docked?”

Okay, okay, but why is the WindowStyle still ‘docked’ if the figures are all in an undocked container?
We understand; these figures feel a bit undocked. The key thing to be aware of is that the WindowStyle property applies to the figure itself, not the container the figure is docked into. So, the Figure is docked, but the container is not. I know – “heavy, Doc!”
In this case, we are prioritizing compatibility with previous releases; documents docked into floating windows have historically been considered “docked” for the figure’s WindowStyle property!

What if I Want the Figure Container Docked in the Desktop?

The tabbed container itself can also be docked into the desktop! To do so, click on the dock button in the Figure Container here:

As You Try It Out, We Would Love Your Feedback!

While we may still be waiting on hoverboards, flying cars, and self-sizing sneakers, we’re thrilled to bring you a more modern and flexible figure experience in MATLAB. We hope you’ll take the new Figure Container out for a spin and see how it can enhance your workflows. (Just keep it under 88 MPH.)
We’d love to hear what you think—feel free to leave a comment below or use the feedback button on the “Home” tab of the MATLAB Desktop toolstrip.
And be sure to check back soon when my colleague Travis dives into the evolution of the new Figure Toolstrip.

Help Shape the Future of MATLAB🔬

Much of what we build is inspired by how you use our products. If you'd like to help guide future development, consider becoming a UX research participant. Sign up here.

 

|
  • print

コメント

コメントを残すには、ここ をクリックして MathWorks アカウントにサインインするか新しい MathWorks アカウントを作成します。