We explained the drawing of multiple curves in one graph and creating separate figures at the 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® with a very basic example below.
YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!
How To Use ‘subplot()’ Command In MatLab®?
If you need to combine and show your graphs in Matlab® as above, you need to use the ‘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 the green arrows above. And the graphs are shown on one figure in 3×1 orientation respectively as shown by the 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 a 3×1 dimensioned figure as above. The first and the second number as the 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 another 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 the ‘subplot()’ command is like above and it is very easy and useful. Leave your comments and questions below about the ‘subplot()’ command in Matlab®!
This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®
Your precious feedbacks are very important to us.