FullScreen of a Figure with no Borders and Toolbar

Hello, I would like to display a full-screen image using figure, with no borders around, no Windows toolbar, nothing except the image, which changes every loop. Is that possible? I have problems using screen function with my MacBookAir, therefore I am obliged to use simply figure to implement the task. Ay suggestions will be appreciated. Thanks!

 Accepted Answer

hFig = figure('units','normalized','outerposition',[0 0 1 1]);
So if you have displayed your image using either imshow or image as
image(myimg)
then you can change the size as
% get the figure and axes handles
hFig = gcf;
hAx = gca;
% set the figure to full screen
set(hFig,'units','normalized','outerposition',[0 0 1 1]);
% set the axes to full screen
set(hAx,'Unit','normalized','Position',[0 0 1 1]);
% hide the toolbar
set(hFig,'menubar','none')
% to hide the title
set(hFig,'NumberTitle','off');
Try the above and see what happens!

5 Comments

It works perfectly! Thank you Geoff!
I tried your method. However, it only remove some margin of the MatLAB window, but still leave a title line and side frames of the window. Also I have to set my pc to hide Windows task bar manually. Is there any way to display only the image itself? Thanks!
Very useful, thanks
There are still two narrow strips at left and right sides.
If you have narrow black stripes use imshow()

Sign in to comment.

More Answers (1)

As of release R2018a, you can set the WindowState property of a figure to maximize the figure programmatically or display it fullscreen. If you set the MenuBar and ToolBar properties to 'none' as well the figure will have no borders, no menus, and no toolbar.
figure('WindowState', 'fullscreen', ...
'MenuBar', 'none', ...
'ToolBar', 'none')

3 Comments

It is good to know this is an option, but this doesn't quite solve my issue. I want to place a figure over literally everything on a second monitor, so that the only thing that is visible is the figure. This means no operating sys menu bars, or anything. When I run the above command on linux + matlab 2018a, I have a bar surrounding the figure like any application in linux, as well as the linux menu bars. Thanks anyhoo!
I believe the program you are looking for is Psychtoolbox. It's a third party add-on toolbox for MATLAB. Link can be found here: http://psychtoolbox.org/

Sign in to comment.

Categories

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

Asked:

Fed
on 27 Feb 2015

Commented:

on 22 Aug 2023

Community Treasure Hunt

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

Start Hunting!