Next Post:

Drawing Logarithmic 2D Graphs In MatLab(Illustrated Expression)

Showing Many Of Graphs In One Window In MatLab(Illustrated Expression)


We explained the drawing multiple curves in one graph and the creating separate figures in same time in Matlab graph drawing or curve drawing. Also you can combine your different curves and figures in one window in Matlab. In this article, we will explain how to combine different figures and graphs in one window with ‘subplot()’ command in Matlab wit a very basic example below.

How To Use ‘subplot()’ Command In MatLab?

Use of ‘subplot()’ command in Matlab graph drawing.

If you need to combine and show your graphs in Matlab as above, you need to use ‘subplot()’ command between your graph drawing codes. As you can see above, we typed the subplot() codes between the individual graph drawing codes as shown by green arrows above. And the graphs are shown on one figure in 3×1 orientation respectivelyu as shown by red arrow in Matlab.

For example, subplot(311) code means that, the first and the second numbers which are ‘3’ and ‘1’, means you want to create 3×1 dimensioned figure as above. The first and the second number as same in all subplot() commands above ‘31’. The last number is the placement of the graphs which is right below that subplot() command, up to other subplot() command. For example the second subplot() which is subplot(312) above, the graph below that subplot() placed as second in the figure.

So the general use of ‘subplot()’ command is like above and it is very easy and useful. Leave your comments and questions below about ‘subplot()’ command in Matlab!

  • Site Comments

At least 10 characters required.