Clear Filters
Clear Filters

How can I add a detail on a curve ?

2 views (last 30 days)
Mallouli Marwa
Mallouli Marwa on 8 Nov 2023
Commented: Mallouli Marwa on 13 Nov 2023
Hi
How can I add a detail on a curve like the attached curve?
%% Power vs resistance
R_load = [0.1e3;1e3;2e3;3e3;5e3;8e3;1e4;2e4;3e4;4e4;5e4;6e4;7e4;8e4;8e4;9e4;1e5;2e5;3e5;4e5;5e5;6e5;7e5;8e5;8.2e5;8.4e5;8.6e5;8.8e5;9e5;1e6;1.2e6;1.4e6;1.6e6;1.8e6;2e6;2.2e6;2.4e6;2.6e6;2.8e6;3e6;4e6;5e6;6e6;7e6;8e6;9e6;1e7];
P_5A = [1.56953823909828e-06;1.56687918049125e-05;3.12785557184260e-05;4.68293908543979e-05;7.77546763200362e-05;0.000123703174240804;0.000154043766543704;0.000302278232490324;0.000444814879535822;0.000581772898270544;0.000713277940731776;0.000839460965252646;0.000960457172626983;0.00107640503164947;0.00107640503164947;0.00118744539131277;0.00129372067633086;0.00212561438902560;0.00262966380148845;0.00291387640760615;0.00305504117446637;0.00310475080333186;0.00309680921723902;0.00305314877394973;0.00304148105554867;0.00302905340743054;0.00301594419041455;0.00300222523844404;0.00298796240253778;0.00291043523002729;0.00274002518860660;0.00256830104076839;0.00240580881966686;0.00225620210361635;0.00212012851359723;0.00199696548783769;0.00188560905787350;0.00178483243281477;0.00169344448784147;0.00161035396226388;0.00128932128043609;0.00107256362173372;0.000917304066096720;0.000800920628455987;0.000710553049336800;0.000638407139794046;0.000579502016395546];
P_4D = [1.16933316661717e-06;1.16773358690171e-05;2.33191574260900e-05;3.49255153155914e-05;5.80320445077152e-05;9.24271478546841e-05;0.000115181368265912;0.000226858450793180;0.000335086451406552;0.000439923504167450;0.000541430284222633;0.000639669641951211;0.000734706260224652;0.000826606334433328;0.000826606334433328;0.000915437274796396;0.00100126743035774;0.00170978117149373;0.00219285947438679;0.00250981441993561;0.00270747345930897;0.00282078530565265;0.00287506858832590;0.00288838691099903;0.00288733495537973;0.00288524999309223;0.00288220844153898;0.00287828158028777;0.00287353589662846;0.00283955566718741;0.00273787305320887;0.00261507650378811;0.00248698209376378;0.00236135265457006;0.00224182076267643;0.00212988195564422;0.00202592800101269;0.00192979181430556;0.00184103822098601;0.00175911969855285;0.00143268160455314;0.00120428586730794;0.00103716304223060;0.000910097113815731;0.000810433142187383;0.000730261955308172;0.000664419737290220];
P_5J = [2.62782401389767e-06;2.61943553750532e-05;5.22029913978826e-05;7.80269974076492e-05;0.000129125462027363;0.000204415495206167;0.000253716271194118;0.000489827073430400;0.000709376317145988;0.000913369033892876;0.00110276803680250;0.00127849179796721;0.00144141331880613;0.00159235979989238;0.00159235979989238;0.00173211294478852;0.00186140975783188;0.00271241358999232;0.00305879569492133;0.00315579449419123;0.00312980192731880;0.00304431805955557;0.00293190240153086;0.00280950576339816;0.00278469998306414;0.00275990766326272;0.00273516850795272;0.00271051716971926;0.00268598382931163;0.00256589000504430;0.00234360966941192;0.00214837735880877;0.00197872826733217;0.00183137636491160;0.00170291591557957;0.00159032332014381;0.00149105507258536;0.00140301489386119;0.00132448619446996;0.00125406308725011;0.000989356396082577;0.000816075915555660;0.000694141580131589;0.000603776251423849;0.000534164204977138;0.000478909934095558;0.000433995239360540];
P_2 = [5.58107044809639e-07;5.57639724254204e-06;1.11424209438832e-05;1.66980890223044e-05;2.77784298551714e-05;4.43217204137638e-05;5.52993078752067e-05;0.000109577274532956;0.000162851471990401;0.000215139216244707;0.000266457567929462;0.000316823333175085;0.000366253064659317;0.000414763062834589;0.000414763062834589;0.000462369377319669;0.000509087808443614;0.000930740095193124;0.00127921190338563;0.00156654075413285;0.00180281794221117;0.00199646524612646;0.00215449345425282;0.00228273236275832;0.00230524729705639;0.00232680172834298;0.00234742898870058;0.00236716120925925;0.00238602936499823;0.00246841767407349;0.00258335063822583;0.00264829115886646;0.00267779239196002;0.00268213957042082;0.00266866108632670;0.00264261873311790;0.00260781651768034;0.00256702063874983;0.00252225192735597;0.00247499143072960;0.00223067948915118;0.00200594560689688;0.00181248692359568;0.00164841181747030;0.00150914384722341;0.00139019964046745;0.00128780910274658];
P_33 = [0.000178007565390909;0.00138465849082248;0.00210101234239171;0.00242752862468921;0.00254301337536586;0.00230677576692397;0.00210961809065353;0.00139355638065616;0.00102105472759507;0.000802744828021853;0.000660548009730044;0.000560860602411901;0.000487193015368977;0.000430570445232263;0.000430570445232263;0.000385706786450899;0.000349291590264213;0.000179558247652597;0.000120811881965640;9.10258093248337e-05;7.30212640400734e-05;6.09626811049344e-05;5.23221428529199e-05;4.58268077622027e-05;4.47165679710798e-05;4.36588494592468e-05;4.26500115657907e-05;4.16867425054667e-05;4.07660230539229e-05;3.67118106709249e-05;3.06211772233483e-05;2.62638761717267e-05;2.29921524791232e-05;2.04452563853798e-05;1.84063390322734e-05;1.67372077012286e-05;1.53456279852311e-05;1.41676850961566e-05;1.31576896659418e-05;1.22821137835579e-05;9.21579515393666e-06;7.37465732194056e-06;6.14667082543245e-06;5.26926265011557e-06;4.61105612758564e-06;4.09902859162126e-06;3.68935040689132e-06];
P_30 = [9.26474786389572e-05;0.000814686355397184;0.00141274850267992;0.00184185752740849;0.00234774800387493;0.00260774152305531;0.00261940350419182;0.00220730548588418;0.00178639239869800;0.00148060035266658;0.00125855321483064;0.00109230147671571;0.000963904973448664;0.000862047723106917;0.000862047723106917;0.000779403310214350;0.000711069353046778;0.000377952704710106;0.000257143315100369;0.000194824790196717;0.000156810922393669;0.000131206494609388;0.000112788623536701;9.89043940004741e-05;9.65278341865084e-05;9.42627927019428e-05;9.21016010285252e-05;9.00372779108274e-05;8.80634540601558e-05;7.93641224779084e-05;6.62707288207478e-05;5.68856194451362e-05;4.98288777255970e-05;4.43296723950972e-05;3.99236047950359e-05;3.63142045395477e-05;3.33033191610852e-05;3.07534786503556e-05;2.85663183280183e-05;2.66695970961610e-05;2.00224213544835e-05;1.60276509800368e-05;1.33617747160631e-05;1.14562561662343e-05;1.00263944364622e-05;8.91385130037681e-06;8.02354680450903e-06];
P_65 = [1.75186370263245e-06;1.74807080804276e-05;3.48773292193379e-05;5.21901784234673e-05;8.65658198857047e-05;0.000137508853688129;0.000171060917131592;0.000333995413682062;0.000489114068638464;0.000636722881494336;0.000777122269386364;0.000910606239128619;0.00103746171541390;0.00115796800768655;0.00115796800768655;0.00127239639947232;0.00138100984524253;0.00219900745772746;0.00266225674974188;0.00290656560294619;0.00301660106944465;0.00304450546983366;0.00302245110786153;0.00297043573480824;0.00295763534175988;0.00294422642238259;0.00293027661224187;0.00291584764334899;0.00290099586833506;0.00282204699915443;0.00265385621189264;0.00248765400981561;0.00233177078416953;0.00218883334281305;0.00205904192889203;0.00194160583294163;0.00183538518237414;0.00173917734374506;0.00165183996128020;0.00157233792754331;0.00126408806868803;0.00105476895860607;0.000904145345728871;0.000790824967459914;0.000702579015077538;0.000631959830854416;0.000574188224909360];
P_69 = [9.92173913081107e-07;9.90769023764995e-06;1.97841895360655e-05;2.96295436621897e-05;4.92270012123441e-05;7.83907628287076e-05;9.76788746158169e-05;0.000192281331550667;0.000283857459345274;0.000372460110846989;0.000458144523755939;0.000540967964696074;0.000620989396612282;0.000698269169121375;0.000698269169121375;0.000772868731298654;0.000844850366260931;0.00143454784455486;0.00183004151671898;0.00208435354694583;0.00223871208672169;0.00232341346027161;0.00236007987327361;0.00236392028431014;0.00236174841983381;0.00235876626880142;0.00235503658747907;0.00235061776474301;0.00234556412680146;0.00231242488367197;0.00222091635703986;0.00211469506587415;0.00200602837390294;0.00190073265415534;0.00180138627822263;0.00170893128819821;0.00162348869032658;0.00154478045702518;0.00147235009495399;0.00140567788376901;0.00114146026399473;0.000957762529144860;0.000823852810210551;0.000722294046354258;0.000642778371978980;0.000578899831970282;0.000526492340401409];
P_pz26 = [2.94047054013684e-06;2.92749965842158e-05;5.82637457283823e-05;8.69693671629645e-05;0.000143543506804834;0.000226356987600351;0.000280234962288459;0.000534484804589781;0.000765383196089368;0.000975256187409358;0.00116616318235780;0.00133993178862746;0.00149818755796099;0.00164237944425408;0.00164237944425408;0.00177380166143859;0.00189361250439877;0.00263769274711231;0.00291161430143385;0.00297520621676009;0.00294030555447721;0.00285914017122650;0.00275749812329246;0.00264856499828998;0.00262657687497096;0.00260461600573670;0.00258271307523127;0.00256089488539166;0.00253918480244396;0.00243287911751283;0.00223543146245087;0.00206073021441778;0.00190766709980223;0.00177364556636877;0.00165592348907786;0.00155202837898384;0.00145985165758416;0.00137763403594953;0.00130391884277890;0.00123750105107111;0.000985124396914957;0.000817492119235122;0.000698337159626844;0.000609378406568500;0.000540463939640790;0.000485521075290018;0.000440699891773788];
P_pz28 = [1.96546165032729e-06;1.95975399905040e-05;3.90688254278852e-05;5.84147697699922e-05;9.67342499821958e-05;0.000153295803093402;0.000190401937472900;0.000368967072655671;0.000536510469206443;0.000693781684809800;0.000841470848311210;0.000980214096947586;0.00111059844898940;0.00123316617732777;0.00123316617732777;0.00134841874114532;0.00145682032558866;0.00224506472961423;0.00267410376261383;0.00289957751951203;0.00300523525863295;0.00303854851240532;0.00302754729021303;0.00298932434301684;0.00297943362603971;0.00296895710779711;0.00295795288402111;0.00294647414044117;0.00293456959368254;0.00287009902775537;0.00272810483246148;0.00258323417766080;0.00244389912384185;0.00231341219519648;0.00219275130471018;0.00208182410734345;0.00198006782431619;0.00188673965090519;0.00180105754281734;0.00172226669986250;0.00140954105871388;0.00119052325171914;0.00102951568412509;0.000906471505181660;0.000809500616097578;0.000731163999100893;0.000666588360711450];
figure(2)
loglog(R_load,P_5A*1e6,'r',R_load,P_4D*1e6,'m',R_load,P_5J*1e6,'b',R_load,P_2*1e6,'g',R_load,P_33*1e6,'k--',R_load,P_30*1e6,'k',R_load,P_65*1e6,'g--',R_load,P_69*1e6,'r--',R_load,P_pz26*1e6,'m--',R_load,P_pz28*1e6,'b--','LineWidth',2)
hold all
xlabel('Resistive load (\Omega)')
ylabel('|Power| [\muW/g^2]')
  3 Comments
Mallouli Marwa
Mallouli Marwa on 8 Nov 2023
Moved: Dyuman Joshi on 8 Nov 2023
They are not the same curves.
Dyuman Joshi
Dyuman Joshi on 8 Nov 2023
"They are not the same curves."
So what?
The logic and the method is still the same. Change the values accordingly.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 8 Nov 2023
In general, the concept is the same as your other question -- it doesn't matter if the curves are different or not. Basically you
  1. Add an axes
  2. Position the axes over your underlying axes.
  3. Plot to the small axes on top of your underlying axes.
See attached demos.
  4 Comments
Mallouli Marwa
Mallouli Marwa on 13 Nov 2023
Can you send me code please.
Mallouli Marwa
Mallouli Marwa on 13 Nov 2023
Hi
I have added two axes but I want the detail on the peak.
Please see the code.
figure(2)
ax1 = axes('Position',[0.2 0.1 0.7 0.8]);
loglog(ax1,R_load,P_5A*1e6,'r',R_load,P_4D*1e6,'k',R_load,P_5J*1e6,'b',R_load,P_2*1e6,'g',R_load,P_42*1e6,'m',R_load,P_65*1e6,'g--',R_load,P_69*1e6,'r--',R_load,P_pz26*1e6,'m--',R_load,P_pz28*1e6,'b--','LineWidth',2)
legend (ax1,'PZT-5A','PZT-4D','PZT-5J','PZT-2','PMN-42%PT','EC-65','EC-69','Pz26','Pz28');
hold all
xlabel(ax1,'Resistive load [\Omega]')
ylabel(ax1,'|Power| [\muW/g^2]')
ax1.YLim = [1e-1 1e4];
ax2 = axes('Position',[0.25 0.69 0.15 0.2]);
Lv = (R_load>=1e6) & (R_load<=1e7);
plot(ax2,R_load(Lv),P_5A(Lv)*1e6,'r',R_load(Lv),P_4D(Lv)*1e6,'k',R_load(Lv),P_5J(Lv)*1e6,'b',R_load(Lv),P_2(Lv)*1e6,'g',R_load(Lv),P_42(Lv)*1e6,'m',R_load(Lv),P_65(Lv)*1e6,'g--',R_load(Lv),P_69(Lv)*1e6,'r--',R_load(Lv),P_pz26(Lv)*1e6,'m--',R_load(Lv),P_pz28(Lv)*1e6,'b--','LineWidth',2)
ax2.XTickLabel = [];
ax2.YTickLabel = [];
ax2.XLim = [1e2 1e7];
annotation('arrow',[0.40 0.51], [0.8 0.65])

Sign in to comment.

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!