Q: How to make a plot insert?
SUBPLOT command is great as long as you want non-intersecting panels. In order to make a plot insert, however, you have to use AXES function directly, e.g.
plot(something) new_axis = axes('position',[ 0.15 0.15 0.3 0.3]); plot(something else)Figuring the correct 'position' property of the new axis may be a bit tricky. Instead, I usually create it first using some arbitrary values (like in the example above), then resize the new axis, move it where I want it (you need to select the axis and choose Tools | Unlock Axes Position to be able to do that), and then get the corresponding 'position':
get(new_axis,'position')and insert it in the final code, probably fine-tuning it for better alignment.
Often it is useful to make the background of the insert transparent (like in the plot to the right):
set(new_axis,'color','none');... or get rid of the axes box altogether (like I did in the final version of the plot):
set(new_axis,'visible','off');