Matlab GUI With Multiple Axes

We can create Matlab with multiple axes with command subplot.  Example :

subplot(2,2,1); plot(x1,y1);
subplot(2,2,2); plot(x1,y4);
subplot(2,2,3); plot(x1,y4);
subplot(2,2,4); plot(x1,y4);

Output image from this Matlab with multiple axes code is :

But when we create a gui program (with GUIDE) in matlab, we can not create Matlab GUI with multiple axes directly. This is a trick how to create plot Matlab GUI with multiple axes.

  • Open matlab gui figure and add panel.
  • Add axes in top of panel.
  • This is a Matlab GUI with Multiple axes design

Add this script to you m-file from this GUI generated :

subplot(2,2,1, 'Parent',handles.uipanel1)
subplot(2,2,2, 'Parent',handles.uipanel1)
subplot(2,2,3, 'Parent',handles.uipanel1)
subplot(2,2,4, 'Parent',handles.uipanel1)

So, ouput from this Matlab GUI with multiple axes :

You can download the complete code for this Matlab GUI with multiple axis from this tutorial at here.


Add a Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.