MATLAB: How can i merge several subplot in one figure

subplot

Hi every one
I have several subplots like :
and i want to merge them such as:
could anyone help me to do that?
Thank you so much.

Best Answer

It looks like you might be using a stackedplot which currently doesn't support adding objects to the axes after the plot is created. You can, however, plot multiple lines in each axis (see this answer).
Subplots and tiledlayouts do allow adding objects to the axes.
Option 1:
  • use hold(ax,'on') to hold the axes 'ax'.
  • use plot(ax,____) to plot on axes 'ax'
Option 2:
  • Copy a plotted line 'h' to axes 'ax' using copyobj(h,ax)