How can I add a zoom in the peak of the curve ?
94 次查看(过去 30 天)
显示 更早的评论
Hi
How can I add a zoom in the peak of the curve like the attached one ?
0 个评论
采纳的回答
Star Strider
2020-8-29
Using these data with the code I provided in my Answer to your previous Question How can I insert a detail in the peak of the curve ?
The ‘V Vectors’ , ‘V_86’, ’V_89’, ‘V_91’, ‘V_92’, ‘V_95’, are provided in ‘Mallouli Marwa V Vectors.mat’, attached.
This Code —
omega = 125.6:0.1:502.4;
freq = omega./(2*pi);
figure
ax1 = axes('Position',[0.2 0.1 0.7 0.8]);
ax2 = axes('Position',[0.25 0.65 0.15 0.2]);
plot(ax1, freq,V_86,'g', freq,V_89,'k', freq,V_91,'m',freq,V_92,'c',freq,V_95,'b','LineWidth',2)
legend(ax1, 'FVF = 0.86','FVF = 0.89','FVF = 0.91','FVF = 0.92','FVF = 0.95');
xlabel(ax1,'Frequency [Hz]');
ylabel(ax1,'|Voltage FRF| [V/g]');
Lv = (freq>=45) & (freq<=52);
plot(ax2, freq(Lv),V_86(Lv),'g', freq(Lv),V_89(Lv),'k', freq(Lv),V_91(Lv),'m',freq(Lv),V_92(Lv),'c',freq(Lv),V_95(Lv),'b','LineWidth',2)
ax2.XTickLabel = [];
ax2.YTickLabel = [];
annotation('arrow',[0.37 0.56], [0.8 0.8])
Produces This Plot —
Experiment with my code to get different results.
12 个评论
Star Strider
2020-9-3
Experiment with the Position limits:
ax2 = axes('Position',[0.25 0.65 0.15 0.20]);
Remember that they are respectively [left bottom width height]. If you want to increase the width, increase elment 3, perhaps:
ax2 = axes('Position',[0.25 0.65 0.20 0.20]);
I did not test that to see what it looked like. It may also be necessary to adjust the annotation arrow.
更多回答(2 个)
Bjorn Gustavsson
2020-8-29
My prefered tool for this is: on-figure-magnifier - at the moment, my preferences vary since you can find a range of similar tools if you search for "magnify" on the file exchange.
HTH
0 个评论
Image Analyst
2020-8-29
See my demos that allow you to put insets of images or plots into other images or plots. When you plot the inset, change xlim and ylim to zoom in on the part your want to enlarge.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axes Appearance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!