This post explains how to plot data in main-inset figure.
In inset figure a portion of main figure data is plotted in close-up.
Some people referred to it as figure-within-figure or figure-inside-figure.
To plot main-inset figure, follow the steps here:
- Create a handle to main figure
- Plot the data of main figure
- Now create an axes for the inset/child figure. Use ‘parent’ and ‘position’ info of main figure, while creating axes for inset
- Now plot selected data in inset figure
x=[0:0.25:2]; y=x.^2; z=x; hf1=figure(1); plot(x,y,x,z); % main plot axes('parent',hf1,'position',[0.20 0.65 0.25 0.25]); % normalized units are used for position % parent - handle to main figure % position - [x,y,width,height] of inset plot(x(2:6),y(2:6),x(2:6),z(2:6)); % inset plot