Plot inside a plot with automatic adjustment

2 views (last 30 days)
I am using a plot inside a plot based on kindly instructions from this community. My problem, however, is that the internal box should always be at the corner of the curve of the external box; the internal box size (height and width) should always adjust itself to touch to the line described by the function of the external box. At the figure attached this was done manually. Looking forward to hearing from you. Thanks a lot.
a=1;ro=0.5;pref1=5;pref2=5;z=10:87:10401 ; x2=a*((z.^(1./ro)).*(1./(z.^pref2))).^(1./pref1); y2 = y;%sin(2*pi*x2); x1 = linspace(0,pi/2); y1 = 2*cos(x1/3.3); figure(1) plot(x1,y1) axes('Position',[.13 .11 .5 .5]) box on plot(x2,y2)

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!