how to make figure full axes

6 次查看(过去 30 天)
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

采纳的回答

Voss
Voss 2024-9-6
编辑:Voss 2024-9-6

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 个评论
Adam Danz
Adam Danz 2024-9-6
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]);

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by