how to make figure full axes

6 views (last 30 days)
기태
기태 on 6 Sep 2024
Commented: Adam Danz on 6 Sep 2024
How to make figure full axes
The title part above keeps on expanding the figure window, but it doesn't disappear. I tried using the function called undecorateFig, but only the Matlab logo disappeared, and that part didn't disappear. If anyone knows, please let me know.
fig = figure('Units', 'pixels', 'Position', [2560 0 1920 1080], 'MenuBar', 'none', 'ToolBar', 'none', ...
'Name', '', 'NumberTitle', 'off');
ax = axes('Parent', fig, 'Units', 'pixels', 'Position', [0 0 1920 1080]);
set(ax, 'LooseInset', [0, 0, 0, 0]);
ax.OuterPosition = [0 0 1920 1080];
x = linspace(0, 10, 100);
y = sin(x);
plot(ax, x, y);
axis off

Accepted Answer

Voss
Voss on 6 Sep 2024
Edited: Voss on 6 Sep 2024

Setting the figure's WindowState property to 'fullscreen' may achieve the desired effect, e.g.:

fig = figure('Units', 'pixels', 'Position', [2560 0 1920 1080], 'MenuBar', 'none', 'ToolBar', 'none', ...
    'Name', '', 'NumberTitle', 'off', 'WindowState', 'fullscreen');
  1 Comment
Adam Danz
Adam Danz on 6 Sep 2024
I would also suggest using normalized axes with position set to [0 0 1 1]
ax = axes('Parent', fig, 'Units', 'normalized', 'Position', [0 0 1 1]);

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!