How can I add a zoom in the peak of the curve ?

176 ビュー (過去 30 日間)
Mallouli Marwa
Mallouli Marwa 2020 年 8 月 29 日
コメント済み: Star Strider 2020 年 9 月 3 日
Hi
How can I add a zoom in the peak of the curve like the attached one ?

採用された回答

Star Strider
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 件のコメント
Mallouli Marwa
Mallouli Marwa 2020 年 9 月 3 日
How can I broaden the scale of the detail figure to make it more visible ?
Star Strider
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
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

Image Analyst
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.
  1 件のコメント
Mallouli Marwa
Mallouli Marwa 2020 年 8 月 29 日
Thanks good examples.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by