How can I add two zooms in a curve ?

2 visualizzazioni (ultimi 30 giorni)
Hi
How can I add two zooms in the same figure (figure 1) like (wanted figure (figure 2)) and broaden the scale of the figure (detail) to obtain a visible detail?

Risposta accettata

Ameer Hamza
Ameer Hamza il 4 Set 2020
You can create another axes() object. Something like this
clear all
clc
I_5A = [0.000123825236646691;0.000123722392109044;0.000122694779852025;0.000121555388771738;0.000120419431791400;0.000119287782724754;0.000118161251031637;0.000117040584227876;0.000115926470389038;0.000114819540718174;0.000114819540718174;0.000113720372151063;0.000112629489975593;0.000102260170059494;9.30077460233241e-05;8.48956862661999e-05;7.78330980151455e-05;7.16908005587166e-05;6.63370826399181e-05;6.16522341976204e-05;6.07861406926201e-05;5.99418708078735e-05;5.91187051207007e-05;5.83159496497235e-05;5.75329352270685e-05;5.38922087509904e-05;4.77693863061478e-05;4.28412569613595e-05;3.88026201912699e-05;3.54398876104642e-05;3.26006813765009e-05;3.01740999792522e-05;2.80778663527745e-05;2.62498424637621e-05;2.46423278177349e-05;2.32181570132498e-05;1.79994868195203e-05;1.46873340586970e-05;1.24013037160740e-05;1.07295393484802e-05;9.45420170479729e-06;8.44942306521039e-06;7.63746005731288e-06;3.89332805817682e-06;2.61220712833023e-06;1.96540934254705e-06;1.57533124462552e-06;1.31444538605441e-06;9.87399513931000e-07;8.78152396368119e-07;7.90671222688504e-07];
I_5H = [0.000164765719382064;0.000164513951649237;0.000161998530308038;0.000159213819562354;0.000156447346955302;0.000153705880536684;0.000150995241519513;0.000148320378280944;0.000145685441975960;0.000143093861662626;0.000143093861662626;0.000140548417344061;0.000138051309768377;0.000115926388445256;9.87045086576175e-05;8.53842082676109e-05;7.49572641902101e-05;6.66537268330040e-05;5.99236627089755e-05;5.43786484926364e-05;5.33859846653502e-05;5.24276279731557e-05;5.15018982348099e-05;5.06072183821925e-05;4.97421071034404e-05;4.58141245321149e-05;3.95329369224022e-05;3.47430558282745e-05;3.09758966851225e-05;2.79385521598211e-05;2.54392943238348e-05;2.33476879574017e-05;2.15720618882535e-05;2.00461796729649e-05;1.87210299363543e-05;1.75595905956304e-05;1.33986144690012e-05;1.08295672940628e-05;9.08635560618488e-06;7.82617325813263e-06;6.87278777844169e-06;6.12636647913076e-06;5.52613803179064e-06;2.79102573197738e-06;1.86690347249748e-06;1.40251065256311e-06;1.12312852610183e-06;9.36562705397871e-07;7.03005436111262e-07;6.25066588670057e-07;5.62684396428646e-07];
I_7A = [5.64133384193980e-05;5.64022165662107e-05;5.62907918743756e-05;5.61665572658219e-05;5.60418862364312e-05;5.59167947411994e-05;5.57912985722912e-05;5.56654133566915e-05;5.55391545540054e-05;5.54125374544027e-05;5.54125374544027e-05;5.52855771767067e-05;5.51582886666221e-05;5.38705121837945e-05;5.25650207844651e-05;5.12537630053390e-05;4.99468750726058e-05;4.86527701559798e-05;4.73782757728659e-05;4.61287981240512e-05;4.58822906222429e-05;4.56369814135983e-05;4.53928966419926e-05;4.51500608456939e-05;4.49084970103587e-05;4.37204595626763e-05;4.14491352805999e-05;3.93239664274564e-05;3.73458963144934e-05;3.55106948570092e-05;3.38111016635785e-05;3.22382818260212e-05;3.07827785011683e-05;2.94351123063875e-05;2.81861404299909e-05;2.70272564187330e-05;2.23280422739525e-05;1.89477962705931e-05;1.64232014535796e-05;1.44755412226829e-05;1.29317602485033e-05;1.16802507704552e-05;1.06463804398211e-05;5.62586566843837e-06;3.81712533021061e-06;2.88755527607767e-06;2.32182641221689e-06;1.94137012785216e-06;1.46210696207307e-06;1.30144537965324e-06;1.17259085248895e-06];
I_8 = [8.41195143623078e-05;8.40816863413173e-05;8.37011923664941e-05;8.32739210350689e-05;8.28422459123447e-05;8.24065049069573e-05;8.19670284876884e-05;8.15241393539204e-05;8.10781521492787e-05;8.06293732168461e-05;8.06293732168461e-05;8.01781003942158e-05;7.97246228465400e-05;7.51258365121365e-05;7.05589359482331e-05;6.61734418323359e-05;6.20532968679289e-05;5.82362282426749e-05;5.47302817693168e-05;5.15259827960896e-05;5.09197628392862e-05;5.03246906386040e-05;4.97405832610967e-05;4.91672538104639e-05;4.86045123661797e-05;4.59428647991134e-05;4.13032169124903e-05;3.74265396941875e-05;3.41606045339767e-05;3.13839645419154e-05;2.90016638380375e-05;2.69397983388590e-05;2.51406844451053e-05;2.35590072078857e-05;2.21588772674470e-05;2.09116190380485e-05;1.62923115073975e-05;1.33267088245827e-05;1.12676158114247e-05;9.75658416039531e-06;8.60135738865300e-06;7.68989487157248e-06;6.95260385259158e-06;3.54656046205768e-06;2.37967660019483e-06;1.79044507531191e-06;1.43507228647436e-06;1.19739763043791e-06;8.99453998343966e-07;7.99930236795726e-07;7.20236111691629e-07];
I_4 = [9.80240486045579e-05;9.79660349048071e-05;9.73833852417138e-05;9.67310580064144e-05;9.60741593993106e-05;9.54133162644540e-05;9.47491323847321e-05;9.40821881763544e-05;9.34130405067493e-05;9.27422226262916e-05;9.27422226262916e-05;9.20702442042957e-05;9.13975914598310e-05;8.47248124634487e-05;7.83608893308352e-05;7.24811588481463e-05;6.71474432222706e-05;6.23567216819276e-05;5.80734790258128e-05;5.42488637325477e-05;5.35344008900723e-05;5.28357946323959e-05;5.21526409496015e-05;5.14845418757233e-05;5.08311061279183e-05;4.77707075674163e-05;4.25473485011066e-05;3.82810781342652e-05;3.47489475565218e-05;3.17864173209265e-05;2.92717518023684e-05;2.71140183575567e-05;2.52444499311352e-05;2.36103542837426e-05;2.21708277610341e-05;2.08937201637682e-05;1.62028543299949e-05;1.32196760437825e-05;1.11594633351833e-05;9.65270911131662e-06;8.50338659772091e-06;7.59806588222941e-06;6.86663614318234e-06;3.49670344805530e-06;2.34507874935526e-06;1.76401338535465e-06;1.41370209325115e-06;1.17946676782472e-06;8.85893317427254e-07;7.87843440943060e-07;7.09334497236992e-07];
I_840 = [0.000102427354410086;0.000102361046959076;0.000101697113997753;0.000100957942651996;0.000100217762994038;9.94771049254790e-05;9.87364723526956e-05;9.79963435606395e-05;9.72571716593190e-05;9.65193850937175e-05;9.65193850937175e-05;9.57833882084065e-05;9.50495618586363e-05;8.78990463605348e-05;8.12373533304991e-05;7.51688279491727e-05;6.97088483828301e-05;6.48263608377396e-05;6.04698030796201e-05;5.65815073434425e-05;5.58550057727606e-05;5.51445293995817e-05;5.44496537657679e-05;5.37699632112588e-05;5.31050511919206e-05;4.99886019665537e-05;4.46574155594916e-05;4.02876093083613e-05;3.66566453671452e-05;3.36007124767812e-05;3.09985023543317e-05;2.87591757003126e-05;2.68138189883389e-05;2.51094492293740e-05;2.36047981380942e-05;2.22673230453043e-05;1.73329525996713e-05;1.41763232736611e-05;1.19875309555662e-05;1.03820803823502e-05;9.15478657203649e-06;8.18639225948140e-06;7.40292973406552e-06;3.78070009945353e-06;2.53806356891567e-06;1.91014028890489e-06;1.53127459346074e-06;1.27781820351777e-06;9.60009181834740e-07;8.53828882215619e-07;7.68796853023451e-07];
I_850 = [0.000120784615572624;0.000120683599019675;0.000119670431320279;0.000118539362252476;0.000117404265507117;0.000116266682732816;0.000115128061164343;0.000113989754905980;0.000112853026737528;0.000111719050362422;0.000111719050362422;0.000110588913022658;0.000109463618410919;9.86447632116485e-05;8.89240102303744e-05;8.04402351626133e-05;7.31248536586902e-05;6.68353148267201e-05;6.14172804058107e-05;5.67293272203543e-05;5.58683169332770e-05;5.50307325888187e-05;5.42157402508327e-05;5.34225379017127e-05;5.26503545740755e-05;4.90797940879293e-05;4.31494699776402e-05;3.84448030542108e-05;3.46348822634641e-05;3.14937268029766e-05;2.88634336167640e-05;2.66310863301500e-05;2.47141602500512e-05;2.30511270157403e-05;2.15952764560479e-05;2.03105655407775e-05;1.56431261501626e-05;1.27128470499777e-05;1.07044945044417e-05;9.24294463244655e-06;8.13197293890341e-06;7.25909939266269e-06;6.55526512445542e-06;3.32718152536724e-06;2.22908970864363e-06;1.67592280345858e-06;1.34270672097254e-06;1.12001507469828e-06;8.41035120784605e-07;7.47889970912072e-07;6.73319224230525e-07];
I_P504 = [0.000122702096140600;0.000122595214542578;0.000121528206371203;0.000120347098594547;0.000119171552211859;0.000118002397633186;0.000116840396869009;0.000115686246601622;0.000114540581299420;0.000113403976344780;0.000113403976344780;0.000112276951150104;0.000111159972240242;0.000100613377852202;9.12971338413354e-05;8.31900962233827e-05;7.61712625331541e-05;7.00926774741296e-05;6.48114391055367e-05;6.02013846543783e-05;5.93501762947681e-05;5.85207163264200e-05;5.77122687272456e-05;5.69241250168977e-05;5.61556034147382e-05;5.25852247073605e-05;4.65905563878111e-05;4.17731318686127e-05;3.78293087243584e-05;3.45478239022034e-05;3.17785528695251e-05;2.94125373626760e-05;2.73691044519074e-05;2.55874182684668e-05;2.40208303460603e-05;2.26330261891687e-05;1.75480532552666e-05;1.43206951192459e-05;1.20929610340487e-05;1.04636412648397e-05;9.22054898912902e-06;8.24108030684969e-06;7.44950295751880e-06;3.79846234316798e-06;2.54879836997476e-06;1.91779580589410e-06;1.53721435983921e-06;1.28266729513450e-06;9.63553190344695e-07;8.56951970941361e-07;7.71588208644617e-07];
I_P508 = [0.000131783402611546;0.000131657289451173;0.000130407409888558;0.000129042317196700;0.000127701628051995;0.000126384827824264;0.000125091409479959;0.000123820873961097;0.000122572730498082;0.000121346496863289;0.000121346496863289;0.000120141699571644;0.000118957874033892;0.000108177339141112;9.90496203315859e-05;9.12520974297218e-05;8.45321572764430e-05;7.86924120695458e-05;7.35780304196215e-05;6.90667387832755e-05;6.82279161819244e-05;6.74085851227383e-05;6.66080969821130e-05;6.58258304929872e-05;6.50611903850610e-05;6.14832148423179e-05;5.53683175203626e-05;5.03404787252332e-05;4.61376242330730e-05;4.25745351077079e-05;3.95169593718843e-05;3.68653956336316e-05;3.45446338257812e-05;3.24968262606431e-05;3.06767847399320e-05;2.90487178338376e-05;2.29497560339522e-05;1.89623907021001e-05;1.61534531979576e-05;1.40683898409752e-05;1.24595769982649e-05;1.11806894374884e-05;1.01397395279299e-05;5.24996379208944e-06;3.54165314838132e-06;2.67211040519518e-06;2.14536892691539e-06;1.79209640129703e-06;1.34811184384111e-06;1.19952264927460e-06;1.08043644724026e-06];
I_151 = [0.000149749222859204;0.000149564094074923;0.000147723492934587;0.000145702167208165;0.000143707242524508;0.000141739916038611;0.000139801185323891;0.000137891866048995;0.000136012608721399;0.000134163914450586;0.000134163914450586;0.000132346149707931;0.000130559560080082;0.000114398657517318;0.000101108710614321;9.02080271379697e-05;8.12126178386386e-05;7.37187527414757e-05;6.74100211990293e-05;6.20435511836240e-05;6.10661436717603e-05;6.01176022762369e-05;5.91967347051537e-05;5.83024091431566e-05;5.74335508125450e-05;5.34372500560843e-05;4.68673950073957e-05;4.17040590869717e-05;3.75472437943358e-05;3.41329868808264e-05;3.12809861216293e-05;2.88643057240824e-05;2.67911951064665e-05;2.49937927015430e-05;2.34208832839957e-05;2.20331212200199e-05;1.69906784300089e-05;1.38220431347129e-05;1.16478618090029e-05;1.00639794828374e-05;8.85892947411818e-06;7.91140810443837e-06;7.14687724562320e-06;3.63390470614369e-06;2.43617935783776e-06;1.83224451138959e-06;1.46825317168304e-06;1.22491126216708e-06;9.19966338550017e-07;8.18128272659723e-07;7.36589441877803e-07];
I_255 = [0.000112851888354442;0.000112774572030483;0.000111997796336876;0.000111127731438640;0.000110251393818745;0.000109369850871058;0.000108484122910258;0.000107595182736488;0.000106703955502807;0.000105811318856164;0.000105811318856164;0.000104918103323089;0.000104025092912106;9.52474927070529e-05;8.70519880229480e-05;7.96549646858969e-05;7.30944825020975e-05;6.73216189134270e-05;6.22532124977192e-05;5.77987671411484e-05;5.69738664769834e-05;5.61694258323660e-05;5.53848192010281e-05;5.46194376023954e-05;5.38726892861335e-05;5.03989435926763e-05;4.45565912343482e-05;3.98607120589333e-05;3.60210149018578e-05;3.28320452425903e-05;3.01464901624200e-05;2.78569501627028e-05;2.58837539086521e-05;2.41667975636056e-05;2.26600184245382e-05;2.13275967415703e-05;1.64665805331114e-05;1.34001400426799e-05;1.12927334697560e-05;9.75644250303700e-06;8.58727352314301e-06;7.66788848239639e-06;6.92607198656969e-06;3.51885787761230e-06;2.35820088288041e-06;1.77324327208076e-06;1.42079409184736e-06;1.18521521811652e-06;8.90053749060691e-07;7.91497012241708e-07;7.12590647002301e-07];
R_load = [0.1e3;1e3;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;2e7;3e7;4e7;5e7;6e7;8e7;9e7;1e8];
figure (1)
ax1 = axes('Position',[0.2 0.1 0.7 0.8]);
loglog(ax1,R_load,I_5A,'c',R_load,I_840,'k',R_load,I_850,'g',R_load,I_P504,'b:',R_load,I_P508,'r',R_load,I_151,'b',R_load,I_255,'m--','LineWidth',2)
legend(ax1,'PZT-5A','APC-840','APC-850','SONOX-P504','SONOX-P508','PIC-151','PIC-255')
xlabel(ax1,'Load Resistance (\Omega)')
ylabel(ax1,'|Current| [\muA/g]');
ax1.YLim = [1e-6 1e-3];
ax2 = axes('Position',[0.25 0.69 0.15 0.2]);
Lv = (R_load>=1e4) & (R_load<=1e5);
plot(ax2, R_load(Lv),I_5A(Lv),'c', R_load(Lv),I_840(Lv),'k', R_load(Lv),I_850(Lv),'g',R_load(Lv),I_P504(Lv),'b:',R_load(Lv),I_P508(Lv),'r',R_load(Lv),I_151(Lv),'b',R_load(Lv),I_255(Lv),'m--','LineWidth',2)
ax2.XTickLabel = [];
ax2.YTickLabel = [];
ax2.XLim = [1e4 1e5];
annotation('arrow',[0.40 0.51], [0.8 0.65])
ax3 = axes('Position',[0.55 0.15 0.15 0.2]);
Lv = (R_load>=8e6) & (R_load<=1e7);
plot(ax3, R_load(Lv),I_5A(Lv),'c', R_load(Lv),I_840(Lv),'k', R_load(Lv),I_850(Lv),'g',R_load(Lv),I_P504(Lv),'b:',R_load(Lv),I_P508(Lv),'r',R_load(Lv),I_151(Lv),'b',R_load(Lv),I_255(Lv),'m--','LineWidth',2)
ax3.XTickLabel = [];
ax3.YTickLabel = [];
axis(ax3,[8e6 1e7 6e-6 1.2e-5]);
annotation('arrow',[0.72 0.77], [0.22 0.3])
  2 Commenti
Mallouli Marwa
Mallouli Marwa il 6 Set 2020
Hi
How can I enlarge the space between line in the two zooms.
Ameer Hamza
Ameer Hamza il 7 Set 2020
You can change the YLim property of the axes to the only zoom along the y-axis. It will help in moving the lines apart.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Visual Exploration in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by