在Mathematica中,如何叠加两个ListLinePlot?

时间:2014-11-30 04:21:45

标签: wolfram-mathematica interpolation

我使用ListPlot通过一些数据点绘制两条平滑线。但我想叠加图。我了解到ListPlot用于插值的方法是将每个坐标插值为列表索引的函数。所以我不能简单地加两个 我的两点插值。

感谢,

jzm

以下是复制/粘贴的一些文字:

myPoints1 = {{1.4620657889458748`, 
335.2985577878116`}, {1.4620965802217518`, 
103.38351787529564`}, {1.4621942025270345`, 
62.5559208248015`}, {1.462354896492246`, 
45.566589506360216`}, {1.4625751467402768`, 
36.264281440327565`}, {1.4628516301983985`, 
30.399003865053114`}, {1.4631812807492346`, 
26.367460111951058`}, {1.4635611902991474`, 
23.429554855802188`}, {1.4639886111585874`, 
21.195443300677702`}, {1.464460983399038`, 
19.440829611123966`}, {1.4649759015994719`, 
18.02777886500251`}, {1.4655311109490736`, 
16.86675689819105`}, {1.466124470097565`, 
15.896899417397284`}, {1.4667539758770534`, 
15.075547889029616`}, {1.467417728656181`, 
14.37183869811537`}, {1.468113935160521`, 
13.76291072113658`}, {1.4688409098827062`, 
13.231534377122449`}, {1.4695970390339186`, 
12.764290193109172`}, {1.4703808152150737`, 
12.350655500316538`}, {1.47119080820051`, 
11.982259112096562`}, {1.4720256766729714`, 
11.652466731657922`}, {1.4728841551349938`, 
11.35608813384227`}, {1.4737650210799367`, 
11.088805023428025`}, {1.4746670942175184`, 
10.846730689594123`}, {1.4755892711659102`, 
10.626599181057326`}, {1.4765305432312286`, 
10.425844517518913`}, {1.4774899140433866`, 
10.242189544437958`}, {1.4784664768294848`, 
10.07388845283117`}, {1.4794593535682306`, 
9.91948469998374`}, {1.480467656424019`, 
9.777491405153027`}, {1.4814906043125302`, 
9.646805534544441`}, {1.4825273964568986`, 
9.526291139015447`}, {1.4835772786981303`, 
9.414764726544572`}, {1.4846395968104766`, 
9.311395888282872`}, {1.4857136927436698`, 
9.215545785306015`}, {1.4867989654798728`, 
9.12678547130485`}, {1.487894785812934`, 
9.0445918653539`}, {1.489000547636927`, 
8.968341543739935`}, {1.49011571024499`, 
7.71616343700933`}, {1.4912397307928495`, 
4.4771368717931965`}, {1.4930948425223702`, 
2.7599903709003706`}, {1.4972705714803425`, 2.137733395169292`}};

myPoints2 = {{1.9550995254889463 , 0.7164793699550908},{1.9391287471262355 , 0.41710931241140287},{1.9139528821159193 , 0.3490726623599497},{1.884617534719042 , 0.3308820126668058},{1.8540123750258504 , 0.33265450551933234} ,{1.8237456098779754 , 0.3452794413751484},{1.7946805323610866 , 0.36513934480358856},{1.7672498634600862 , 0.3905924543768967},{1.7416378319498413 , 0.42085584504202456},{1.717886011205134 , 0.45557423825820337},{1.6959554065943552 {{ 1}}},{1.675763216373194 , 0.49463019895914645},{1.6572047192352064 , 0.5380524422510392},{1.6401662975943239 , 0.5859687470445493},{1.6245331447101943 , 0.6385812315738714},{1.6101937002933333 , 0.6961532977719818}, {1.5970420916568349 , 0.7590036122922289},{1.5849793700525658 , 0.8275045669571167},{1.5739139593253322 , 0.9020832266507519},{1.5637616875683809 , 0.9832255360102758},{1.5544455489784297 , 1.071482155332956},{1.5458952859916812 {{1 },} {1.538046945587126 , 1.1674755467368436},{1.5308423787211705 , 1.2719109855898907},{1.5242287288899015 , 1.3855881585132812},{1.5181579889629853 , 1.5094157124835617},{1.512586535548833 , 1.6444321762294256},{ 1.5074747129386745 , 1.7918272163885938},{1.5027864632086367 , 1.952969437543702},{1.4984889655043911 , 2.1294427702228105},{1.4945523307439923 , 2.3230885849762424},{1.4909493139037207 , 2.536061738604728},{1.4876550515968234 {{1} },{{1.4846468371914137 , 2.7708992557015053},{1.481903916697491 , 3.0306073328297867},{1.4794072959177726 , 3.3187795649748657},{1.477139571958530 5 , 3.6397480437107252},{1.4750847772800355 , 3.9987774524193394},{1.4732282431253443 , 4.4023273698572325},{1.4715564902918326 , 4.858408392792459},{1.4700571242943155 , 5.37708563628973},{1.4687187279247118 {{1} },{1.4675307832019475 , 5.971204815109932},{1.4664835796976867 , 6.657415608955233},{1.46556811155878 , 7.457674059555506},{1.4647760611386595 , 8.40154880208839},{1.4640997339059703 , 9.529729255387132},{1.463531979901696 , 10.899794007715421},{1.4630661880201312 , 12.596323274840168},{1.462696204020183 , 14.748618559900901},{1.4624163023794263 , 17.564564972128032},{1.462221186527755 , 21.401490423013954},{1.4621058905589708 , 26.92897502098747 },{1.4620657889458748 , 35.566591773864054}};

我想要的不是

, 
    50.94289950596402

不知道如何获得两个情节的价值重叠的情节。请帮助!:) "叠加"的含义是在每个x轴上得到两条曲线的值的加号。

1 个答案:

答案 0 :(得分:0)

听起来你想要这样的东西,以及#34;加上#34;你的台词。

it1 = Interpolation[myPoints1];
it2 = Interpolation[myPoints2];
t1 = Table[it1[i], {i, 1.467, 1.497, 0.001}];
t2 = Table[it2[i], {i, 1.467, 1.497, 0.001}];
t3 = Transpose[{Range[1.467, 1.497, 0.001], t1 + t2}];
ListPlot[{myPoints1, myPoints2, t3}, Joined -> True,
 PlotRange -> {{1.467, 1.497}, {0, 30}}, PlotMarkers -> Automatic]

enter image description here