Matlab GUI Tutorial - Custom Background Images and Custom Buttons
28 Nov 2007 Quan Quach 14 comments 16223 views
Introduction
Changing the way your GUI is presented can make your GUI more appealing to the eye. This tutorial will show you how to add a background image to your GUI. In addition, it will also show you how to modify your buttons to display custom images too.

This tutorial is written for those with some experience creating a Matlab GUI. If you’re new to creating GUIs in Matlab, you should visit this tutorial first. Basic knowledge of Matlab is highly recommended. Matlab version 2007a is used in writing this tutorial. Both earlier versions and new versions should be compatible as well (as long as it isan’t too outdated). Let’s get started!
14 Responses to “Matlab GUI Tutorial - Custom Background Images and Custom Buttons”
Leave a Reply
Include MATLAB code in your comment by doing the following:
<pre lang="MATLAB">
%insert code here
</pre>

Using this approach you can make your GUI like a Mac theme with glossy buttons! I have received a lot of comments when doing this. So I encourage you to do the same.
thanks for the encouragement, turtie! hope the coming holiday season treats you well
I’ve added an axes control on the figure, but I can’t seem to find the function for it in the m-file. I just want to load up a simple image on the figure when the program runs. Is there another way to do this?
decypher,
I don’t know of another way to do this.
The function you are looking for is the “opening function”. This function runs when the GUI is executed. Within this function, you set the code to display the image. Please try it again and come back if you are not able to get it to work.
Quan
Hi,
This 3 page tutorial was very useful. When I include a background picture in the gui, the panels are disappearing. But I just want my panel border to be visible in the gui. How do I do this?
Bbye,
Priyanka.
hi.
interesting post….
however if 1 call the gui again.. the background image is not loaded….
any idea how to handle this prob…
thnks
regards,
nishna
Hey guys thanks for all the wonderful tutorials youve created, really has helped with my final year project, ive used your tutorials to create several guis which i can launch from one main menu gui for various aspects. But i was wondering how to i set matlab, or gui properties so that everytime i press the button on the main menu to launch the gui, it runs in the exsisting figure windows instead of opening a new one each time?
Thank you
hi
thanks a ton for ur tutorials its helped me lot. But i have a problem.. plz help me out. I am not able to display 2 dimension images in exact way it is in GUI axes of matlab. the colors and intensity varies a lot. Can you please let me know how to do it..
thank you
Hello Ramya,
What type of image are you trying to put in your background?
Quan
no i am not trying to put in background. but i am trying to dispay an image which is not RGB image. the image type with two planes i want to display like suppose an image f i want to display f(:,:,1) in the axis. Can you please help me out?? is this possible?
Hi all,
Any idea how to put in a picture in a gui with Matlab being on the Linux platform?
I have a GUI design but would like to add a picture.
Cheers
Froggy007
THANX ALOT!!
Really nice post!
Thanks for the tutorial.
Like many noted before me: your explanations are concise, to the point, clear and complete. Thanks.